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
@@ -683,11 +683,14 @@ static int __init msi_init(void)
|
||||
printk(KERN_INFO "MSI: Brightness ignored, must be controlled "
|
||||
"by ACPI video driver\n");
|
||||
} else {
|
||||
struct backlight_properties props;
|
||||
memset(&props, 0, sizeof(struct backlight_properties));
|
||||
props.max_brightness = MSI_LCD_LEVEL_MAX - 1;
|
||||
msibl_device = backlight_device_register("msi-laptop-bl", NULL,
|
||||
NULL, &msibl_ops);
|
||||
NULL, &msibl_ops,
|
||||
&props);
|
||||
if (IS_ERR(msibl_device))
|
||||
return PTR_ERR(msibl_device);
|
||||
msibl_device->props.max_brightness = MSI_LCD_LEVEL_MAX-1;
|
||||
}
|
||||
|
||||
ret = platform_driver_register(&msipf_driver);
|
||||
|
Reference in New Issue
Block a user