From: yxj <yxj@rock-chips.com>
Date: Thu, 21 Feb 2013 06:46:04 +0000 (+0800)
Subject: rk3066b lcdc:support 1.8V io
X-Git-Tag: firefly_0821_release~7593
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b841c569c68b9c3c7028e2ee0083c4c83e15662f;p=firefly-linux-kernel-4.4.55.git

rk3066b lcdc:support 1.8V io
---

diff --git a/drivers/video/rockchip/lcdc/Kconfig b/drivers/video/rockchip/lcdc/Kconfig
index a0f3322565b9..a714142eabde 100644
--- a/drivers/video/rockchip/lcdc/Kconfig
+++ b/drivers/video/rockchip/lcdc/Kconfig
@@ -37,6 +37,13 @@ config LCDC0_RK3066B
         help
            Support lcdc0 if you say y here
 
+config RK3066B_LCDC0_IO_18V
+        bool "lcdc0 1.8v io support"
+        depends on LCDC0_RK3066B
+        default n
+        help
+         LCDC0 io voltage is 1.8V if you say y here,the default voltage is 3.3V
+
 config LCDC1_RK3066B
         bool "lcdc1 support"
         depends on LCDC_RK3066B
@@ -44,6 +51,14 @@ config LCDC1_RK3066B
         help
            Support lcdc1 if you say y here
 
+config RK3066B_LCDC1_IO_18V
+        bool "lcdc1 1.8v io support"
+        depends on LCDC1_RK3066B
+        default n
+        help
+         LCDC1 io voltage is 1.8V if you say y here,the default voltage is 3.3V
+
+
 config LCDC_RK3188
         bool "rk3188 lcdc support"
         depends on FB_ROCKCHIP && ARCH_RK3188
diff --git a/drivers/video/rockchip/lcdc/rk3066b_lcdc.c b/drivers/video/rockchip/lcdc/rk3066b_lcdc.c
index ce26a6f5566e..b71f69c31170 100755
--- a/drivers/video/rockchip/lcdc/rk3066b_lcdc.c
+++ b/drivers/video/rockchip/lcdc/rk3066b_lcdc.c
@@ -47,6 +47,8 @@ module_param(dbg_thresd, int, S_IRUGO|S_IWUSR);
 static int init_rk3066b_lcdc(struct rk_lcdc_device_driver *dev_drv)
 {
 	struct rk3066b_lcdc_device *lcdc_dev = container_of(dev_drv,struct rk3066b_lcdc_device,driver);
+	int v;
+	
 	if(lcdc_dev->id == 0) //lcdc0
 	{
 		lcdc_dev->pd = clk_get(NULL,"pd_lcdc0");
@@ -76,8 +78,27 @@ static int init_rk3066b_lcdc(struct rk_lcdc_device_driver *dev_drv)
 	clk_enable(lcdc_dev->dclk);
 	lcdc_dev->clk_on = 1;
 
+	if(lcdc_dev->id == 0)
+	{
+		#if defined(CONFIG_RK3066B_LCDC0_IO_18V)
+		v = 0x40004000;               //bit14: 1,1.8v;0,3.3v
+		writel_relaxed(v,RK30_GRF_BASE + GRF_IO_CON4);
+		#else
+		v = 0x40000000;              
+		writel_relaxed(v,RK30_GRF_BASE + GRF_IO_CON4);
+		#endif
+	}
+
 	if(lcdc_dev->id == 1) //iomux for lcdc1
 	{
+		#if defined(CONFIG_RK3066B_LCDC1_IO_18V)
+		v = 0x80008000;               //bit14: 1,1.8v;0,3.3v
+		writel_relaxed(v,RK30_GRF_BASE + GRF_IO_CON4);
+		#else
+		v = 0x80000000;
+		writel_relaxed(v,RK30_GRF_BASE + GRF_IO_CON4);
+		#endif
+		
 		iomux_set(LCDC1_DCLK);
 		iomux_set(LCDC1_DEN);
 		iomux_set(LCDC1_HSYNC);