aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/backlight/mbp_nvidia_bl.c
diff options
context:
space:
mode:
authorMatthew Garrett <mjg@redhat.com>2010-02-17 16:39:44 -0500
committerRichard Purdie <rpurdie@linux.intel.com>2010-03-16 19:47:54 +0000
commita19a6ee6cad2b20292a774c2f56ba8039b0fac9c (patch)
tree631916ce6181336c5c28eb0cf5484c40c92986b6 /drivers/video/backlight/mbp_nvidia_bl.c
parent57e148b6a975980944f4466ccb669b1d02dfc6a1 (diff)
downloadkernel_samsung_aries-a19a6ee6cad2b20292a774c2f56ba8039b0fac9c.zip
kernel_samsung_aries-a19a6ee6cad2b20292a774c2f56ba8039b0fac9c.tar.gz
kernel_samsung_aries-a19a6ee6cad2b20292a774c2f56ba8039b0fac9c.tar.bz2
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/video/backlight/mbp_nvidia_bl.c')
-rw-r--r--drivers/video/backlight/mbp_nvidia_bl.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/video/backlight/mbp_nvidia_bl.c b/drivers/video/backlight/mbp_nvidia_bl.c
index 2e78b07..0881358 100644
--- a/drivers/video/backlight/mbp_nvidia_bl.c
+++ b/drivers/video/backlight/mbp_nvidia_bl.c
@@ -250,6 +250,7 @@ static const struct dmi_system_id __initdata mbp_device_table[] = {
static int __init mbp_init(void)
{
+ struct backlight_properties props;
if (!dmi_check_system(mbp_device_table))
return -ENODEV;
@@ -257,14 +258,17 @@ static int __init mbp_init(void)
"Macbook Pro backlight"))
return -ENXIO;
- mbp_backlight_device = backlight_device_register("mbp_backlight",
- NULL, NULL, &driver_data->backlight_ops);
+ memset(&props, 0, sizeof(struct backlight_properties));
+ props.max_brightness = 15;
+ mbp_backlight_device = backlight_device_register("mbp_backlight", NULL,
+ NULL,
+ &driver_data->backlight_ops,
+ &props);
if (IS_ERR(mbp_backlight_device)) {
release_region(driver_data->iostart, driver_data->iolen);
return PTR_ERR(mbp_backlight_device);
}
- mbp_backlight_device->props.max_brightness = 15;
mbp_backlight_device->props.brightness =
driver_data->backlight_ops.get_brightness(mbp_backlight_device);
backlight_update_status(mbp_backlight_device);