drivers: video: fbdev: atmel_lcdfb.c: Add ability to inverted backlight PWM.
authorMichael Welling <mwelling@ieee.org>
Fri, 4 Jul 2014 02:26:36 +0000 (21:26 -0500)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Wed, 30 Jul 2014 11:13:33 +0000 (14:13 +0300)
The code has a variable to change the polarity of the PWM backlight control but
it was not being initialized. This patch adds a devicetree entry to set the
variable if required.

Signed-off-by: Michael Welling <mwelling@ieee.org>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Documentation/devicetree/bindings/video/atmel,lcdc.txt
drivers/video/fbdev/atmel_lcdfb.c

index 1ec175eddca8f010f2dc6551eb87bb635f212698..b75af94a5e52c5a100470e1c0a98e093085f1fcd 100644 (file)
@@ -46,6 +46,7 @@ Required properties (as per of_videomode_helper):
 
 Optional properties (as per of_videomode_helper):
  - atmel,lcdcon-backlight: enable backlight
+ - atmel,lcdcon-backlight-inverted: invert backlight PWM polarity
  - atmel,lcd-wiring-mode: lcd wiring mode "RGB" or "BRG"
  - atmel,power-control-gpio: gpio to power on or off the LCD (as many as needed)
 
index e683b6ef95940dc6e5424691abff0806c61a784f..010443f5f55598cefe6f57834f3011e077cd1513 100644 (file)
@@ -290,7 +290,7 @@ static void init_contrast(struct atmel_lcdfb_info *sinfo)
 
        /* contrast pwm can be 'inverted' */
        if (pdata->lcdcon_pol_negative)
-                       contrast_ctr &= ~(ATMEL_LCDC_POL_POSITIVE);
+               contrast_ctr &= ~(ATMEL_LCDC_POL_POSITIVE);
 
        /* have some default contrast/backlight settings */
        lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, contrast_ctr);
@@ -1095,6 +1095,7 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo)
        pdata->lcd_wiring_mode = ret;
 
        pdata->lcdcon_is_backlight = of_property_read_bool(display_np, "atmel,lcdcon-backlight");
+       pdata->lcdcon_pol_negative = of_property_read_bool(display_np, "atmel,lcdcon-backlight-inverted");
 
        timings = of_get_display_timings(display_np);
        if (!timings) {