diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-07-25 20:12:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-25 23:57:08 -0400 |
commit | ef22f6a70c9186c8e25f757b0e8f7374b37f69bf (patch) | |
tree | 2a2dcaa322941a54059421a96d462fc3a8585354 /drivers/video/backlight | |
parent | a4c8aaa559733d03cb6bb4fa62c25ae756c53e94 (diff) |
backlight: set backlight type and max_brightness before backlights are registered
Since commit a19a6ee "backlight: Allow properties to be passed at
registration" and commit bb7ca74 "backlight: add backlight type", we can
set backlight type and max_brightness before backlights are registered.
Some newly added drivers did not set it properly, let's fix it.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Jingoo Han <jg1.han@samsung.com>
Cc: Donghwa Lee <dh09.lee@samsung.com>
Cc: InKi Dae <inki.dae@samsung.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/backlight')
-rw-r--r-- | drivers/video/backlight/ams369fg06.c | 9 | ||||
-rw-r--r-- | drivers/video/backlight/ld9040.c | 8 | ||||
-rw-r--r-- | drivers/video/backlight/s6e63m0.c | 9 |
3 files changed, 18 insertions, 8 deletions
diff --git a/drivers/video/backlight/ams369fg06.c b/drivers/video/backlight/ams369fg06.c index 2c314303f915..9f0a491e2a05 100644 --- a/drivers/video/backlight/ams369fg06.c +++ b/drivers/video/backlight/ams369fg06.c | |||
@@ -479,6 +479,7 @@ static int __devinit ams369fg06_probe(struct spi_device *spi) | |||
479 | struct ams369fg06 *lcd = NULL; | 479 | struct ams369fg06 *lcd = NULL; |
480 | struct lcd_device *ld = NULL; | 480 | struct lcd_device *ld = NULL; |
481 | struct backlight_device *bd = NULL; | 481 | struct backlight_device *bd = NULL; |
482 | struct backlight_properties props; | ||
482 | 483 | ||
483 | lcd = kzalloc(sizeof(struct ams369fg06), GFP_KERNEL); | 484 | lcd = kzalloc(sizeof(struct ams369fg06), GFP_KERNEL); |
484 | if (!lcd) | 485 | if (!lcd) |
@@ -511,16 +512,18 @@ static int __devinit ams369fg06_probe(struct spi_device *spi) | |||
511 | 512 | ||
512 | lcd->ld = ld; | 513 | lcd->ld = ld; |
513 | 514 | ||
515 | memset(&props, 0, sizeof(struct backlight_properties)); | ||
516 | props.type = BACKLIGHT_RAW; | ||
517 | props.max_brightness = MAX_BRIGHTNESS; | ||
518 | |||
514 | bd = backlight_device_register("ams369fg06-bl", &spi->dev, lcd, | 519 | bd = backlight_device_register("ams369fg06-bl", &spi->dev, lcd, |
515 | &ams369fg06_backlight_ops, NULL); | 520 | &ams369fg06_backlight_ops, &props); |
516 | if (IS_ERR(bd)) { | 521 | if (IS_ERR(bd)) { |
517 | ret = PTR_ERR(bd); | 522 | ret = PTR_ERR(bd); |
518 | goto out_lcd_unregister; | 523 | goto out_lcd_unregister; |
519 | } | 524 | } |
520 | 525 | ||
521 | bd->props.max_brightness = MAX_BRIGHTNESS; | ||
522 | bd->props.brightness = DEFAULT_BRIGHTNESS; | 526 | bd->props.brightness = DEFAULT_BRIGHTNESS; |
523 | bd->props.type = BACKLIGHT_RAW; | ||
524 | lcd->bd = bd; | 527 | lcd->bd = bd; |
525 | 528 | ||
526 | if (!lcd->lcd_pd->lcd_enabled) { | 529 | if (!lcd->lcd_pd->lcd_enabled) { |
diff --git a/drivers/video/backlight/ld9040.c b/drivers/video/backlight/ld9040.c index 62bcde3c97f2..5934655eb1ff 100644 --- a/drivers/video/backlight/ld9040.c +++ b/drivers/video/backlight/ld9040.c | |||
@@ -668,6 +668,7 @@ static int ld9040_probe(struct spi_device *spi) | |||
668 | struct ld9040 *lcd = NULL; | 668 | struct ld9040 *lcd = NULL; |
669 | struct lcd_device *ld = NULL; | 669 | struct lcd_device *ld = NULL; |
670 | struct backlight_device *bd = NULL; | 670 | struct backlight_device *bd = NULL; |
671 | struct backlight_properties props; | ||
671 | 672 | ||
672 | lcd = kzalloc(sizeof(struct ld9040), GFP_KERNEL); | 673 | lcd = kzalloc(sizeof(struct ld9040), GFP_KERNEL); |
673 | if (!lcd) | 674 | if (!lcd) |
@@ -699,14 +700,17 @@ static int ld9040_probe(struct spi_device *spi) | |||
699 | 700 | ||
700 | lcd->ld = ld; | 701 | lcd->ld = ld; |
701 | 702 | ||
703 | memset(&props, 0, sizeof(struct backlight_properties)); | ||
704 | props.type = BACKLIGHT_RAW; | ||
705 | props.max_brightness = MAX_BRIGHTNESS; | ||
706 | |||
702 | bd = backlight_device_register("ld9040-bl", &spi->dev, | 707 | bd = backlight_device_register("ld9040-bl", &spi->dev, |
703 | lcd, &ld9040_backlight_ops, NULL); | 708 | lcd, &ld9040_backlight_ops, &props); |
704 | if (IS_ERR(bd)) { | 709 | if (IS_ERR(bd)) { |
705 | ret = PTR_ERR(bd); | 710 | ret = PTR_ERR(bd); |
706 | goto out_unregister_lcd; | 711 | goto out_unregister_lcd; |
707 | } | 712 | } |
708 | 713 | ||
709 | bd->props.max_brightness = MAX_BRIGHTNESS; | ||
710 | bd->props.brightness = MAX_BRIGHTNESS; | 714 | bd->props.brightness = MAX_BRIGHTNESS; |
711 | lcd->bd = bd; | 715 | lcd->bd = bd; |
712 | 716 | ||
diff --git a/drivers/video/backlight/s6e63m0.c b/drivers/video/backlight/s6e63m0.c index e1803ba23176..694e5aab0d69 100644 --- a/drivers/video/backlight/s6e63m0.c +++ b/drivers/video/backlight/s6e63m0.c | |||
@@ -738,6 +738,7 @@ static int __devinit s6e63m0_probe(struct spi_device *spi) | |||
738 | struct s6e63m0 *lcd = NULL; | 738 | struct s6e63m0 *lcd = NULL; |
739 | struct lcd_device *ld = NULL; | 739 | struct lcd_device *ld = NULL; |
740 | struct backlight_device *bd = NULL; | 740 | struct backlight_device *bd = NULL; |
741 | struct backlight_properties props; | ||
741 | 742 | ||
742 | lcd = kzalloc(sizeof(struct s6e63m0), GFP_KERNEL); | 743 | lcd = kzalloc(sizeof(struct s6e63m0), GFP_KERNEL); |
743 | if (!lcd) | 744 | if (!lcd) |
@@ -769,16 +770,18 @@ static int __devinit s6e63m0_probe(struct spi_device *spi) | |||
769 | 770 | ||
770 | lcd->ld = ld; | 771 | lcd->ld = ld; |
771 | 772 | ||
773 | memset(&props, 0, sizeof(struct backlight_properties)); | ||
774 | props.type = BACKLIGHT_RAW; | ||
775 | props.max_brightness = MAX_BRIGHTNESS; | ||
776 | |||
772 | bd = backlight_device_register("s6e63m0bl-bl", &spi->dev, lcd, | 777 | bd = backlight_device_register("s6e63m0bl-bl", &spi->dev, lcd, |
773 | &s6e63m0_backlight_ops, NULL); | 778 | &s6e63m0_backlight_ops, &props); |
774 | if (IS_ERR(bd)) { | 779 | if (IS_ERR(bd)) { |
775 | ret = PTR_ERR(bd); | 780 | ret = PTR_ERR(bd); |
776 | goto out_lcd_unregister; | 781 | goto out_lcd_unregister; |
777 | } | 782 | } |
778 | 783 | ||
779 | bd->props.max_brightness = MAX_BRIGHTNESS; | ||
780 | bd->props.brightness = MAX_BRIGHTNESS; | 784 | bd->props.brightness = MAX_BRIGHTNESS; |
781 | bd->props.type = BACKLIGHT_RAW; | ||
782 | lcd->bd = bd; | 785 | lcd->bd = bd; |
783 | 786 | ||
784 | /* | 787 | /* |