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/backlight/omap1_bl.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/backlight/omap1_bl.c')
-rw-r--r-- | drivers/video/backlight/omap1_bl.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/video/backlight/omap1_bl.c b/drivers/video/backlight/omap1_bl.c index a3a7f8938175..333d28e6b062 100644 --- a/drivers/video/backlight/omap1_bl.c +++ b/drivers/video/backlight/omap1_bl.c | |||
@@ -132,6 +132,7 @@ static const struct backlight_ops omapbl_ops = { | |||
132 | 132 | ||
133 | static int omapbl_probe(struct platform_device *pdev) | 133 | static int omapbl_probe(struct platform_device *pdev) |
134 | { | 134 | { |
135 | struct backlight_properties props; | ||
135 | struct backlight_device *dev; | 136 | struct backlight_device *dev; |
136 | struct omap_backlight *bl; | 137 | struct omap_backlight *bl; |
137 | struct omap_backlight_config *pdata = pdev->dev.platform_data; | 138 | struct omap_backlight_config *pdata = pdev->dev.platform_data; |
@@ -143,7 +144,10 @@ static int omapbl_probe(struct platform_device *pdev) | |||
143 | if (unlikely(!bl)) | 144 | if (unlikely(!bl)) |
144 | return -ENOMEM; | 145 | return -ENOMEM; |
145 | 146 | ||
146 | dev = backlight_device_register("omap-bl", &pdev->dev, bl, &omapbl_ops); | 147 | memset(&props, 0, sizeof(struct backlight_properties)); |
148 | props.max_brightness = OMAPBL_MAX_INTENSITY; | ||
149 | dev = backlight_device_register("omap-bl", &pdev->dev, bl, &omapbl_ops, | ||
150 | &props); | ||
147 | if (IS_ERR(dev)) { | 151 | if (IS_ERR(dev)) { |
148 | kfree(bl); | 152 | kfree(bl); |
149 | return PTR_ERR(dev); | 153 | return PTR_ERR(dev); |
@@ -160,7 +164,6 @@ static int omapbl_probe(struct platform_device *pdev) | |||
160 | omap_cfg_reg(PWL); /* Conflicts with UART3 */ | 164 | omap_cfg_reg(PWL); /* Conflicts with UART3 */ |
161 | 165 | ||
162 | dev->props.fb_blank = FB_BLANK_UNBLANK; | 166 | dev->props.fb_blank = FB_BLANK_UNBLANK; |
163 | dev->props.max_brightness = OMAPBL_MAX_INTENSITY; | ||
164 | dev->props.brightness = pdata->default_intensity; | 167 | dev->props.brightness = pdata->default_intensity; |
165 | omapbl_update_status(dev); | 168 | omapbl_update_status(dev); |
166 | 169 | ||