mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
drivers/video/backlight/tps65217_bl.c add default brightness value option
Signed-off-by: Matus Ujhelyi <[email protected]> Cc: Grant Likely <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
17e45db62a
commit
4d22f8c306
3 changed files with 18 additions and 1 deletions
|
|
@ -245,6 +245,18 @@ tps65217_bl_parse_dt(struct platform_device *pdev)
|
|||
}
|
||||
}
|
||||
|
||||
if (!of_property_read_u32(node, "default-brightness", &val)) {
|
||||
if (val < 0 ||
|
||||
val > 100) {
|
||||
dev_err(&pdev->dev,
|
||||
"invalid 'default-brightness' value in the device tree\n");
|
||||
err = ERR_PTR(-EINVAL);
|
||||
goto err;
|
||||
}
|
||||
|
||||
pdata->dft_brightness = val;
|
||||
}
|
||||
|
||||
of_node_put(node);
|
||||
|
||||
return pdata;
|
||||
|
|
@ -311,7 +323,8 @@ static int tps65217_bl_probe(struct platform_device *pdev)
|
|||
return PTR_ERR(tps65217_bl->bl);
|
||||
}
|
||||
|
||||
tps65217_bl->bl->props.brightness = 0;
|
||||
tps65217_bl->bl->props.brightness = pdata->dft_brightness;
|
||||
backlight_update_status(tps65217_bl->bl);
|
||||
platform_set_drvdata(pdev, tps65217_bl);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue