rk616_mipi:add mipi lcd reset pin in the board 'board-rk3168-tb.c'
authorlibing <libing@rock-chips.com>
Mon, 26 Aug 2013 02:28:41 +0000 (10:28 +0800)
committerlibing <libing@rock-chips.com>
Mon, 26 Aug 2013 02:28:41 +0000 (10:28 +0800)
arch/arm/mach-rk30/board-rk3168-tb.c

index bd74a1bac58ec0b51e50f41a92a8d2b3243959f7..dd4ea7c549798588e4c8459cc772b6318559109b 100755 (executable)
@@ -484,6 +484,7 @@ static struct sensor_platform_data cm3217_info = {
 #define LCD_CS_VALUE       GPIO_HIGH
 
 #define LCD_EN_PIN         RK30_PIN0_PB0
+#define MIPI_LCD_RST_PIN   RK30_PIN0_PC3   //mipi lcd's reset pin, if no reset pin, set's  INVALID_GPIO
 #define LCD_EN_VALUE       GPIO_HIGH
 
 static int rk_fb_io_init(struct rk29_fb_setting_info *fb_setting)
@@ -519,6 +520,23 @@ static int rk_fb_io_init(struct rk29_fb_setting_info *fb_setting)
                        gpio_direction_output(LCD_EN_PIN, LCD_EN_VALUE);
                }
        }
+
+    if(MIPI_LCD_RST_PIN !=INVALID_GPIO)
+       {
+               ret = gpio_request(MIPI_LCD_RST_PIN, NULL);
+               if (ret != 0)
+               {
+                       gpio_free(MIPI_LCD_RST_PIN);
+                       printk(KERN_ERR "request mipi lcd rst pin fail!\n");
+                       return -1;
+               }
+        
+               else
+               {
+            gpio_set_value(MIPI_LCD_RST_PIN, !GPIO_LOW);
+            msleep(20);
+               }
+       }
        return 0;
 }
 static int rk_fb_io_disable(void)
@@ -531,6 +549,12 @@ static int rk_fb_io_disable(void)
        {
                gpio_set_value(LCD_EN_PIN, !LCD_EN_VALUE);
        }
+
+    if(MIPI_LCD_RST_PIN !=INVALID_GPIO)
+       {
+               gpio_set_value(MIPI_LCD_RST_PIN, GPIO_LOW);
+        msleep(10);
+       }
        return 0;
 }
 static int rk_fb_io_enable(void)
@@ -543,6 +567,12 @@ static int rk_fb_io_enable(void)
        {
                gpio_set_value(LCD_EN_PIN, LCD_EN_VALUE);
        }
+
+    if(MIPI_LCD_RST_PIN !=INVALID_GPIO)
+       {
+        gpio_set_value(MIPI_LCD_RST_PIN, !GPIO_LOW);
+        msleep(10);
+       }
        return 0;
 }