From: Alexander Stein <alexander.stein@systec-electronic.com>
Date: Tue, 20 Jul 2010 06:55:40 +0000 (+0200)
Subject: atmel_lcd: Allow contrast polarity to be either positive or negative
X-Git-Tag: v2025.01-rc5-pxa1908~20075^2
X-Git-Url: http://git.dujemihanovic.xyz/img/html/index.html?a=commitdiff_plain;h=cdfcedbf250ba2ec01b2555cffde83e9947e9fbf;p=u-boot.git

atmel_lcd: Allow contrast polarity to be either positive or negative

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
---

diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index db867638f6..c02ffd8036 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -143,8 +143,9 @@ void lcd_ctrl_init(void *lcdbase)
 
 	/* Set contrast */
 	value = ATMEL_LCDC_PS_DIV8 |
-		ATMEL_LCDC_POL_POSITIVE |
 		ATMEL_LCDC_ENA_PWMENABLE;
+	if (!panel_info.vl_cont_pol_low)
+		value |= ATMEL_LCDC_POL_POSITIVE;
 	lcdc_writel(panel_info.mmio, ATMEL_LCDC_CONTRAST_CTR, value);
 	lcdc_writel(panel_info.mmio, ATMEL_LCDC_CONTRAST_VAL, ATMEL_LCDC_CVAL_DEFAULT);
 
diff --git a/include/lcd.h b/include/lcd.h
index cd9d49d3ae..0e098d925e 100644
--- a/include/lcd.h
+++ b/include/lcd.h
@@ -167,6 +167,7 @@ typedef struct vidinfo {
 	u_long vl_sync;		/* Horizontal / vertical sync */
 	u_long vl_bpix;		/* Bits per pixel, 0 = 1, 1 = 2, 2 = 4, 3 = 8, 4 = 16 */
 	u_long vl_tft;		/* 0 = passive, 1 = TFT */
+	u_long vl_cont_pol_low;	/* contrast polarity is low */
 
 	/* Horizontal control register. */
 	u_long vl_hsync_len;	/* Length of horizontal sync */