atmel_lcdfb: Use proper blanking on negative contrast polarity
authorAlexander Stein <alexander.stein@systec-electronic.com>
Wed, 5 Oct 2011 07:59:58 +0000 (09:59 +0200)
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
Fri, 11 Nov 2011 16:50:55 +0000 (16:50 +0000)
If used with negative polarity the PWM unit cannot be disabled. This would
result in a full contrast screen.
Instead let the PWM unit enabled using 0x0 as compare value which darkens
the display.
In result no power saving is possible if inverted contrast polarity
is used.

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
drivers/video/atmel_lcdfb.c

index 7e66263b18c1a57709d50d0b437199d57e6b9bc7..8bfee6aecc8bc9308a9d7dd3d2444183131043cf 100644 (file)
@@ -99,8 +99,11 @@ static int atmel_bl_update_status(struct backlight_device *bl)
                brightness = 0;
 
        lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_VAL, brightness);
-       lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR,
+       if (contrast_ctr & ATMEL_LCDC_POL_POSITIVE)
+               lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR,
                        brightness ? contrast_ctr : 0);
+       else
+               lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, contrast_ctr);
 
        bl->props.fb_blank = bl->props.power = sinfo->bl_power = power;