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/video/atmel_lcdfb.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/video/atmel_lcdfb.c')
-rw-r--r-- | drivers/video/atmel_lcdfb.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index 3d886c6902f9..11de3bfd4e54 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c | |||
@@ -117,6 +117,7 @@ static struct backlight_ops atmel_lcdc_bl_ops = { | |||
117 | 117 | ||
118 | static void init_backlight(struct atmel_lcdfb_info *sinfo) | 118 | static void init_backlight(struct atmel_lcdfb_info *sinfo) |
119 | { | 119 | { |
120 | struct backlight_properties props; | ||
120 | struct backlight_device *bl; | 121 | struct backlight_device *bl; |
121 | 122 | ||
122 | sinfo->bl_power = FB_BLANK_UNBLANK; | 123 | sinfo->bl_power = FB_BLANK_UNBLANK; |
@@ -124,8 +125,10 @@ static void init_backlight(struct atmel_lcdfb_info *sinfo) | |||
124 | if (sinfo->backlight) | 125 | if (sinfo->backlight) |
125 | return; | 126 | return; |
126 | 127 | ||
127 | bl = backlight_device_register("backlight", &sinfo->pdev->dev, | 128 | memset(&props, 0, sizeof(struct backlight_properties)); |
128 | sinfo, &atmel_lcdc_bl_ops); | 129 | props.max_brightness = 0xff; |
130 | bl = backlight_device_register("backlight", &sinfo->pdev->dev, sinfo, | ||
131 | &atmel_lcdc_bl_ops, &props); | ||
129 | if (IS_ERR(bl)) { | 132 | if (IS_ERR(bl)) { |
130 | dev_err(&sinfo->pdev->dev, "error %ld on backlight register\n", | 133 | dev_err(&sinfo->pdev->dev, "error %ld on backlight register\n", |
131 | PTR_ERR(bl)); | 134 | PTR_ERR(bl)); |
@@ -135,7 +138,6 @@ static void init_backlight(struct atmel_lcdfb_info *sinfo) | |||
135 | 138 | ||
136 | bl->props.power = FB_BLANK_UNBLANK; | 139 | bl->props.power = FB_BLANK_UNBLANK; |
137 | bl->props.fb_blank = FB_BLANK_UNBLANK; | 140 | bl->props.fb_blank = FB_BLANK_UNBLANK; |
138 | bl->props.max_brightness = 0xff; | ||
139 | bl->props.brightness = atmel_bl_get_brightness(bl); | 141 | bl->props.brightness = atmel_bl_get_brightness(bl); |
140 | } | 142 | } |
141 | 143 | ||