summaryrefslogtreecommitdiff
path: root/drivers/video/backlight/omap1_bl.c
diff options
context:
space:
mode:
authorMatthew Garrett <mjg@redhat.com>2010-02-18 00:39:44 +0300
committerRichard Purdie <rpurdie@linux.intel.com>2010-03-16 22:47:54 +0300
commita19a6ee6cad2b20292a774c2f56ba8039b0fac9c (patch)
tree631916ce6181336c5c28eb0cf5484c40c92986b6 /drivers/video/backlight/omap1_bl.c
parent57e148b6a975980944f4466ccb669b1d02dfc6a1 (diff)
downloadlinux-a19a6ee6cad2b20292a774c2f56ba8039b0fac9c.tar.xz
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.c7
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 = {
static int omapbl_probe(struct platform_device *pdev)
{
+ struct backlight_properties props;
struct backlight_device *dev;
struct omap_backlight *bl;
struct omap_backlight_config *pdata = pdev->dev.platform_data;
@@ -143,7 +144,10 @@ static int omapbl_probe(struct platform_device *pdev)
if (unlikely(!bl))
return -ENOMEM;
- dev = backlight_device_register("omap-bl", &pdev->dev, bl, &omapbl_ops);
+ memset(&props, 0, sizeof(struct backlight_properties));
+ props.max_brightness = OMAPBL_MAX_INTENSITY;
+ dev = backlight_device_register("omap-bl", &pdev->dev, bl, &omapbl_ops,
+ &props);
if (IS_ERR(dev)) {
kfree(bl);
return PTR_ERR(dev);
@@ -160,7 +164,6 @@ static int omapbl_probe(struct platform_device *pdev)
omap_cfg_reg(PWL); /* Conflicts with UART3 */
dev->props.fb_blank = FB_BLANK_UNBLANK;
- dev->props.max_brightness = OMAPBL_MAX_INTENSITY;
dev->props.brightness = pdata->default_intensity;
omapbl_update_status(dev);