mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
backlight: Allow properties to be passed at registration
Values such as max_brightness should be set before backlights are registered, but the current API doesn't allow that. Add a parameter to backlight_device_register and update drivers to ensure that they set this correctly. Signed-off-by: Matthew Garrett <[email protected]> Signed-off-by: Richard Purdie <[email protected]>
This commit is contained in:
parent
57e148b6a9
commit
a19a6ee6ca
49 changed files with 271 additions and 151 deletions
|
|
@ -144,6 +144,7 @@ void pmu_backlight_set_sleep(int sleep)
|
|||
|
||||
void __init pmu_backlight_init()
|
||||
{
|
||||
struct backlight_properties props;
|
||||
struct backlight_device *bd;
|
||||
char name[10];
|
||||
int level, autosave;
|
||||
|
|
@ -161,13 +162,15 @@ void __init pmu_backlight_init()
|
|||
|
||||
snprintf(name, sizeof(name), "pmubl");
|
||||
|
||||
bd = backlight_device_register(name, NULL, NULL, &pmu_backlight_data);
|
||||
memset(&props, 0, sizeof(struct backlight_properties));
|
||||
props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
|
||||
bd = backlight_device_register(name, NULL, NULL, &pmu_backlight_data,
|
||||
&props);
|
||||
if (IS_ERR(bd)) {
|
||||
printk(KERN_ERR "PMU Backlight registration failed\n");
|
||||
return;
|
||||
}
|
||||
uses_pmu_bl = 1;
|
||||
bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
|
||||
pmu_backlight_init_curve(0x7F, 0x46, 0x0E);
|
||||
|
||||
level = bd->props.max_brightness;
|
||||
|
|
|
|||
Loading…
Reference in a new issue