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-wmi.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-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) | |||
249 | goto err_uninstall_notifier; | 249 | goto err_uninstall_notifier; |
250 | 250 | ||
251 | if (!acpi_video_backlight_support()) { | 251 | if (!acpi_video_backlight_support()) { |
252 | backlight = backlight_device_register(DRV_NAME, | 252 | struct backlight_properties props; |
253 | NULL, NULL, &msi_backlight_ops); | 253 | memset(&props, 0, sizeof(struct backlight_properties)); |
254 | props.max_brightness = ARRAY_SIZE(backlight_map) - 1; | ||
255 | backlight = backlight_device_register(DRV_NAME, NULL, NULL, | ||
256 | &msi_backlight_ops, | ||
257 | &props); | ||
254 | if (IS_ERR(backlight)) | 258 | if (IS_ERR(backlight)) |
255 | goto err_free_input; | 259 | goto err_free_input; |
256 | 260 | ||
257 | backlight->props.max_brightness = ARRAY_SIZE(backlight_map) - 1; | ||
258 | err = bl_get(NULL); | 261 | err = bl_get(NULL); |
259 | if (err < 0) | 262 | if (err < 0) |
260 | goto err_free_backlight; | 263 | goto err_free_backlight; |