diff options
author | Matthew Garrett <mjg@redhat.com> | 2010-02-17 22:39:44 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-03-16 20:47:54 +0100 |
commit | a19a6ee6cad2b20292a774c2f56ba8039b0fac9c (patch) | |
tree | 631916ce6181336c5c28eb0cf5484c40c92986b6 /drivers/platform/x86/msi-wmi.c | |
parent | backlight: Add backlight_device parameter to check_fb (diff) | |
download | linux-a19a6ee6cad2b20292a774c2f56ba8039b0fac9c.tar.xz linux-a19a6ee6cad2b20292a774c2f56ba8039b0fac9c.zip |
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-wmi.c')
-rw-r--r-- | drivers/platform/x86/msi-wmi.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/platform/x86/msi-wmi.c b/drivers/platform/x86/msi-wmi.c index f5f70d4c6913..fb7ccaae6563 100644 --- a/drivers/platform/x86/msi-wmi.c +++ b/drivers/platform/x86/msi-wmi.c @@ -249,12 +249,15 @@ static int __init msi_wmi_init(void) goto err_uninstall_notifier; if (!acpi_video_backlight_support()) { - backlight = backlight_device_register(DRV_NAME, - NULL, NULL, &msi_backlight_ops); + struct backlight_properties props; + memset(&props, 0, sizeof(struct backlight_properties)); + props.max_brightness = ARRAY_SIZE(backlight_map) - 1; + backlight = backlight_device_register(DRV_NAME, NULL, NULL, + &msi_backlight_ops, + &props); if (IS_ERR(backlight)) goto err_free_input; - backlight->props.max_brightness = ARRAY_SIZE(backlight_map) - 1; err = bl_get(NULL); if (err < 0) goto err_free_backlight; |