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/msi-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/msi-laptop.c')
-rw-r--r-- | drivers/platform/x86/msi-laptop.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c index c2b05da4289a..996223a7c009 100644 --- a/drivers/platform/x86/msi-laptop.c +++ b/drivers/platform/x86/msi-laptop.c | |||
@@ -683,11 +683,14 @@ static int __init msi_init(void) | |||
683 | printk(KERN_INFO "MSI: Brightness ignored, must be controlled " | 683 | printk(KERN_INFO "MSI: Brightness ignored, must be controlled " |
684 | "by ACPI video driver\n"); | 684 | "by ACPI video driver\n"); |
685 | } else { | 685 | } else { |
686 | struct backlight_properties props; | ||
687 | memset(&props, 0, sizeof(struct backlight_properties)); | ||
688 | props.max_brightness = MSI_LCD_LEVEL_MAX - 1; | ||
686 | msibl_device = backlight_device_register("msi-laptop-bl", NULL, | 689 | msibl_device = backlight_device_register("msi-laptop-bl", NULL, |
687 | NULL, &msibl_ops); | 690 | NULL, &msibl_ops, |
691 | &props); | ||
688 | if (IS_ERR(msibl_device)) | 692 | if (IS_ERR(msibl_device)) |
689 | return PTR_ERR(msibl_device); | 693 | return PTR_ERR(msibl_device); |
690 | msibl_device->props.max_brightness = MSI_LCD_LEVEL_MAX-1; | ||
691 | } | 694 | } |
692 | 695 | ||
693 | ret = platform_driver_register(&msipf_driver); | 696 | ret = platform_driver_register(&msipf_driver); |