From 3f45c08ed4e10918910db379173d9e036146c97a Mon Sep 17 00:00:00 2001
From: luowei <lw@rock-chips.com>
Date: Wed, 23 Mar 2011 11:55:30 +0800
Subject: [PATCH] add standby for lcd_ili9803_cpt4_3

---
 .../video/display/screen/lcd_ili9803_cpt4_3.c | 67 +++++++++++--------
 1 file changed, 38 insertions(+), 29 deletions(-)

diff --git a/drivers/video/display/screen/lcd_ili9803_cpt4_3.c b/drivers/video/display/screen/lcd_ili9803_cpt4_3.c
index 8964d8932903..b41a8dc86257 100755
--- a/drivers/video/display/screen/lcd_ili9803_cpt4_3.c
+++ b/drivers/video/display/screen/lcd_ili9803_cpt4_3.c
@@ -163,8 +163,8 @@ int init(void)
 { 
 	volatile u32 data;
 
-    if(gLcd_info)
-        gLcd_info->io_init();
+	if(gLcd_info)
+	gLcd_info->io_init();
 
 	printk("lcd init...\n");
 	spi_screenreg_cmd(0xB1);
@@ -272,51 +272,60 @@ int init(void)
 	spi_screenreg_cmd(0x29);
 	mdelay(10);
 	spi_screenreg_cmd(0x2C);
-    if(gLcd_info)
-        gLcd_info->io_deinit();
+	if(gLcd_info)
+	gLcd_info->io_deinit();
 
     return 0;
 }
 
 int standby(u8 enable)	//***enable =1 means suspend, 0 means resume 
 {
-	
+#if 1	
     if(gLcd_info)
         gLcd_info->io_init();
-	#if 0
+
 	if(enable) {
-		spi_screenreg_set(0x10, 0xffff, 0xffff);
-		spi_screenreg_set(0x28, 0xffff, 0xffff);
+		spi_screenreg_cmd(0xB7);
+		spi_screenreg_param(0x0f);
 	} else { 
-		spi_screenreg_set(0x29, 0xffff, 0xffff);
-		spi_screenreg_set(0x11, 0xffff, 0xffff);
+ 		CS_OUT() ;
+		for(int i=0;i<6;i++)
+		{
+			CS_SET();
+			DRVDelayUs(1);
+			CS_CLR();
+			DRVDelayUs(1);
+			CS_SET();
+			mdelay(2);			
+		}
 	}
-  #endif
+
     if(gLcd_info)
         gLcd_info->io_deinit();
+#endif
     return 0;
 }
+
 void set_backlight(int brightness)
 {
-#if 0
-	if (g_spi != NULL)
-	{
-		fbprintk("AMS369FG06:set_backlight = %d\r\n", brightness);
-		if (brightness < 0)
-		{
-			brightness = 0;
-		}
-		if (brightness > 4)
-		{
-			brightness = 4;
-		}
+#if 1
+ 	if(gLcd_info)
+        gLcd_info->io_init();
 
-		g_backlight_level = brightness;
-		write_data(pBrighenessLevel[brightness], ARRAY_SIZE(pBrighenessLevel[brightness]));
+	printk("lcd_ili9803:set_backlight = %d\r\n", brightness);
+	if (brightness < 0)
+	{
+		brightness = 0;
 	}
+	if (brightness > 4)
+	{
+		brightness = 4;
+	}
+	spi_screenreg_cmd(0x51);
+	spi_screenreg_param(brightness<<5);
+		
+  	 if(gLcd_info)
+        gLcd_info->io_deinit();
+
 #endif
 }
-void rk2818_backlight_ctl(int suspend)
-{
-	standby(suspend);
-}
\ No newline at end of file
-- 
2.34.1