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/omap2 | |
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/omap2')
-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 = { | |||
486 | 486 | ||
487 | static int taal_probe(struct omap_dss_device *dssdev) | 487 | static int taal_probe(struct omap_dss_device *dssdev) |
488 | { | 488 | { |
489 | struct backlight_properties props; | ||
489 | struct taal_data *td; | 490 | struct taal_data *td; |
490 | struct backlight_device *bldev; | 491 | struct backlight_device *bldev; |
491 | int r; | 492 | int r; |
@@ -520,11 +521,16 @@ static int taal_probe(struct omap_dss_device *dssdev) | |||
520 | 521 | ||
521 | /* if no platform set_backlight() defined, presume DSI backlight | 522 | /* if no platform set_backlight() defined, presume DSI backlight |
522 | * control */ | 523 | * control */ |
524 | memset(&props, 0, sizeof(struct backlight_properties)); | ||
523 | if (!dssdev->set_backlight) | 525 | if (!dssdev->set_backlight) |
524 | td->use_dsi_bl = true; | 526 | td->use_dsi_bl = true; |
525 | 527 | ||
528 | if (td->use_dsi_bl) | ||
529 | props.max_brightness = 255; | ||
530 | else | ||
531 | props.max_brightness = 127; | ||
526 | bldev = backlight_device_register("taal", &dssdev->dev, dssdev, | 532 | bldev = backlight_device_register("taal", &dssdev->dev, dssdev, |
527 | &taal_bl_ops); | 533 | &taal_bl_ops, &props); |
528 | if (IS_ERR(bldev)) { | 534 | if (IS_ERR(bldev)) { |
529 | r = PTR_ERR(bldev); | 535 | r = PTR_ERR(bldev); |
530 | goto err2; | 536 | goto err2; |
@@ -534,13 +540,10 @@ static int taal_probe(struct omap_dss_device *dssdev) | |||
534 | 540 | ||
535 | bldev->props.fb_blank = FB_BLANK_UNBLANK; | 541 | bldev->props.fb_blank = FB_BLANK_UNBLANK; |
536 | bldev->props.power = FB_BLANK_UNBLANK; | 542 | bldev->props.power = FB_BLANK_UNBLANK; |
537 | if (td->use_dsi_bl) { | 543 | if (td->use_dsi_bl) |
538 | bldev->props.max_brightness = 255; | ||
539 | bldev->props.brightness = 255; | 544 | bldev->props.brightness = 255; |
540 | } else { | 545 | else |
541 | bldev->props.max_brightness = 127; | ||
542 | bldev->props.brightness = 127; | 546 | bldev->props.brightness = 127; |
543 | } | ||
544 | 547 | ||
545 | taal_bl_update_status(bldev); | 548 | taal_bl_update_status(bldev); |
546 | 549 | ||