diff options
author | Matthew Garrett <mjg@redhat.com> | 2010-02-18 00:39:44 +0300 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-03-16 22:47:54 +0300 |
commit | a19a6ee6cad2b20292a774c2f56ba8039b0fac9c (patch) | |
tree | 631916ce6181336c5c28eb0cf5484c40c92986b6 /drivers/video/omap2/displays/panel-taal.c | |
parent | 57e148b6a975980944f4466ccb669b1d02dfc6a1 (diff) | |
download | linux-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/omap2/displays/panel-taal.c')
-rw-r--r-- | drivers/video/omap2/displays/panel-taal.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c index fcd6a61a91eb..59769e85d41c 100644 --- a/drivers/video/omap2/displays/panel-taal.c +++ b/drivers/video/omap2/displays/panel-taal.c @@ -486,6 +486,7 @@ static struct attribute_group taal_attr_group = { static int taal_probe(struct omap_dss_device *dssdev) { + struct backlight_properties props; struct taal_data *td; struct backlight_device *bldev; int r; @@ -520,11 +521,16 @@ static int taal_probe(struct omap_dss_device *dssdev) /* if no platform set_backlight() defined, presume DSI backlight * control */ + memset(&props, 0, sizeof(struct backlight_properties)); if (!dssdev->set_backlight) td->use_dsi_bl = true; + if (td->use_dsi_bl) + props.max_brightness = 255; + else + props.max_brightness = 127; bldev = backlight_device_register("taal", &dssdev->dev, dssdev, - &taal_bl_ops); + &taal_bl_ops, &props); if (IS_ERR(bldev)) { r = PTR_ERR(bldev); goto err2; @@ -534,13 +540,10 @@ static int taal_probe(struct omap_dss_device *dssdev) bldev->props.fb_blank = FB_BLANK_UNBLANK; bldev->props.power = FB_BLANK_UNBLANK; - if (td->use_dsi_bl) { - bldev->props.max_brightness = 255; + if (td->use_dsi_bl) bldev->props.brightness = 255; - } else { - bldev->props.max_brightness = 127; + else bldev->props.brightness = 127; - } taal_bl_update_status(bldev); |