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 <mjg@redhat.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:

committed by
Richard Purdie

parent
57e148b6a9
commit
a19a6ee6ca
@@ -291,12 +291,15 @@ static int __init compal_init(void)
|
||||
/* Register backlight stuff */
|
||||
|
||||
if (!acpi_video_backlight_support()) {
|
||||
compalbl_device = backlight_device_register("compal-laptop", NULL, NULL,
|
||||
&compalbl_ops);
|
||||
struct backlight_properties props;
|
||||
memset(&props, 0, sizeof(struct backlight_properties));
|
||||
props.max_brightness = COMPAL_LCD_LEVEL_MAX - 1;
|
||||
compalbl_device = backlight_device_register("compal-laptop",
|
||||
NULL, NULL,
|
||||
&compalbl_ops,
|
||||
&props);
|
||||
if (IS_ERR(compalbl_device))
|
||||
return PTR_ERR(compalbl_device);
|
||||
|
||||
compalbl_device->props.max_brightness = COMPAL_LCD_LEVEL_MAX-1;
|
||||
}
|
||||
|
||||
ret = platform_driver_register(&compal_driver);
|
||||
|
Reference in New Issue
Block a user