mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -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
|
|
@ -998,6 +998,7 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
|
|||
}
|
||||
|
||||
if (acpi_video_backlight_support()) {
|
||||
struct backlight_properties props;
|
||||
int result;
|
||||
static int count = 0;
|
||||
char *name;
|
||||
|
|
@ -1010,12 +1011,14 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
|
|||
return;
|
||||
|
||||
sprintf(name, "acpi_video%d", count++);
|
||||
device->backlight = backlight_device_register(name,
|
||||
NULL, device, &acpi_backlight_ops);
|
||||
memset(&props, 0, sizeof(struct backlight_properties));
|
||||
props.max_brightness = device->brightness->count - 3;
|
||||
device->backlight = backlight_device_register(name, NULL, device,
|
||||
&acpi_backlight_ops,
|
||||
&props);
|
||||
kfree(name);
|
||||
if (IS_ERR(device->backlight))
|
||||
return;
|
||||
device->backlight->props.max_brightness = device->brightness->count-3;
|
||||
|
||||
result = sysfs_create_link(&device->backlight->dev.kobj,
|
||||
&device->dev->dev.kobj, "device");
|
||||
|
|
|
|||
Loading…
Reference in a new issue