diff options
author | Matthew Garrett <mjg@redhat.com> | 2010-02-17 16:39:44 -0500 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-03-16 15:47:54 -0400 |
commit | a19a6ee6cad2b20292a774c2f56ba8039b0fac9c (patch) | |
tree | 631916ce6181336c5c28eb0cf5484c40c92986b6 /drivers/platform/x86/compal-laptop.c | |
parent | 57e148b6a975980944f4466ccb669b1d02dfc6a1 (diff) |
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>
Diffstat (limited to 'drivers/platform/x86/compal-laptop.c')
-rw-r--r-- | drivers/platform/x86/compal-laptop.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/platform/x86/compal-laptop.c b/drivers/platform/x86/compal-laptop.c index 2740b40aad9b..71ff1545a93e 100644 --- a/drivers/platform/x86/compal-laptop.c +++ b/drivers/platform/x86/compal-laptop.c | |||
@@ -291,12 +291,15 @@ static int __init compal_init(void) | |||
291 | /* Register backlight stuff */ | 291 | /* Register backlight stuff */ |
292 | 292 | ||
293 | if (!acpi_video_backlight_support()) { | 293 | if (!acpi_video_backlight_support()) { |
294 | compalbl_device = backlight_device_register("compal-laptop", NULL, NULL, | 294 | struct backlight_properties props; |
295 | &compalbl_ops); | 295 | memset(&props, 0, sizeof(struct backlight_properties)); |
296 | props.max_brightness = COMPAL_LCD_LEVEL_MAX - 1; | ||
297 | compalbl_device = backlight_device_register("compal-laptop", | ||
298 | NULL, NULL, | ||
299 | &compalbl_ops, | ||
300 | &props); | ||
296 | if (IS_ERR(compalbl_device)) | 301 | if (IS_ERR(compalbl_device)) |
297 | return PTR_ERR(compalbl_device); | 302 | return PTR_ERR(compalbl_device); |
298 | |||
299 | compalbl_device->props.max_brightness = COMPAL_LCD_LEVEL_MAX-1; | ||
300 | } | 303 | } |
301 | 304 | ||
302 | ret = platform_driver_register(&compal_driver); | 305 | ret = platform_driver_register(&compal_driver); |