add lcd B080XAN02 driver
authorhhb <hhb@rock-chips.com>
Fri, 19 Jul 2013 04:57:16 +0000 (12:57 +0800)
committerhhb <hhb@rock-chips.com>
Fri, 19 Jul 2013 04:57:16 +0000 (12:57 +0800)
drivers/video/rockchip/screen/Kconfig
drivers/video/rockchip/screen/Makefile
drivers/video/rockchip/screen/lcd_B080XAN02_mipi.c [new file with mode: 0644]

index e5f0da662457078aefb09883eec1fe39c87475d2..abd9f2f6a487fc8d1f9d336b2df94b861f4d7ade 100644 (file)
@@ -187,6 +187,8 @@ config LCD_RK3028_86V
         bool "RGB 1024*600 for RK3028 86V"
 config LCD_LD089WU1_MIPI
        bool "mipi dsi lcd LD089WU1 1920X1200"
+config LCD_B080XAN02_MIPI
+       bool "mipi dsi lcd B080XAN02 1024X768"  
 endchoice
 
 
index 6a608d256aa688cc407be734e0a41d50fb39fa84..fcce6234747ff68a5abcc24ccb3876204dd571da 100644 (file)
@@ -64,6 +64,7 @@ obj-$(CONFIG_LCD_HH070D_LVDS)   += lcd_hh070d_lvds.o
 obj-$(CONFIG_LCD_RK3028_86V)   += lcd_E242868_rk3028_86v.o
 obj-$(CONFIG_LCD_MQ0801D)    += lcd_mq0801d.o
 obj-$(CONFIG_LCD_LD089WU1_MIPI)   += lcd_LD089WU1_mipi.o
+obj-$(CONFIG_LCD_B080XAN02_MIPI)   += lcd_B080XAN02_mipi.o
 
 
 quiet_cmd_gen = GEN     $@
diff --git a/drivers/video/rockchip/screen/lcd_B080XAN02_mipi.c b/drivers/video/rockchip/screen/lcd_B080XAN02_mipi.c
new file mode 100644 (file)
index 0000000..8676b6b
--- /dev/null
@@ -0,0 +1,130 @@
+#ifndef __LCD_B080XAN02__
+#define __LCD_B080XAN02__
+
+#if defined(CONFIG_MIPI_DSI)
+#include "../transmitter/mipi_dsi.h"
+#endif
+#include <mach/board.h>
+#include <mach/gpio.h>
+#include <mach/io.h>
+
+#if  defined(CONFIG_RK610_LVDS) || defined(CONFIG_RK616_LVDS)
+#define SCREEN_TYPE            SCREEN_LVDS
+#else
+#define SCREEN_TYPE            SCREEN_MIPI
+#endif
+#define LVDS_FORMAT         0     //mipi lcd don't need it, so 0 would be ok.
+#define OUT_FACE               OUT_P666  //OUT_P888
+
+
+#define DCLK                   67*1000000 //150*1000000
+#define LCDC_ACLK              300000000           //29 lcdc axi DMA ?¦Ì?¨º
+
+/* Timing */
+#define H_PW                    64  //16
+#define H_BP                   56 //40
+#define H_VD                   768 //1920
+#define H_FP                   60 //24
+
+#define V_PW                   14//50 //6
+#define V_BP                   30 // 26
+#define V_VD                   1024 //120
+#define V_FP                   36 //4
+
+#define LCD_WIDTH         119 //204 
+#define LCD_HEIGHT         159//       136
+/* Other */
+#if defined(CONFIG_RK610_LVDS) || defined(CONFIG_RK616_LVDS) || defined(CONFIG_MIPI_DSI)
+#define DCLK_POL       1
+#else
+#define DCLK_POL       0
+#endif
+#define DEN_POL                0
+#define VSYNC_POL      0
+#define HSYNC_POL      0
+
+#define SWAP_RB                0
+#define SWAP_RG                0
+#define SWAP_GB                0
+
+#define RK_SCREEN_INIT         1
+
+/* about mipi */
+#define MIPI_DSI_LANE 4
+#define MIPI_DSI_HS_CLK 528*1000000 //1000*1000000
+
+#if defined(RK_SCREEN_INIT)
+static struct rk29lcd_info *gLcd_info = NULL;
+
+int gTmp = 1;
+int rk_lcd_init(void) {
+
+       int ret = 0;
+       u8 dcs[16] = {0};
+       if(dsi_is_active() != 1)
+               return -1;
+       /*below is changeable*/
+
+       if(gTmp == 1)
+       {
+               ret = gpio_request(RK30_PIN0_PC3, "mipi rest pin");
+               if( ret != 0 )
+               {
+                       gpio_free(RK30_PIN0_PC3);
+                       printk("mipi rest pin error\n");
+                       return -EIO;
+               }
+               gTmp++;         
+       }
+
+       gpio_set_value(RK30_PIN0_PC3, !GPIO_LOW);
+       msleep(10);
+       gpio_set_value(RK30_PIN0_PC3, GPIO_LOW);
+       msleep(10);
+       gpio_set_value(RK30_PIN0_PC3, !GPIO_LOW);
+       msleep(20);
+       
+       dsi_enable_hs_clk(1);
+
+       dcs[0] = LPDT;
+       dcs[1] = dcs_exit_sleep_mode; 
+       dsi_send_dcs_packet(dcs, 2);
+       msleep(1);
+       dcs[0] = LPDT;
+       dcs[1] = dcs_set_display_on;
+       dsi_send_dcs_packet(dcs, 2);
+       msleep(10);
+       //dsi_enable_command_mode(0);
+       dsi_enable_video_mode(1);
+       
+       printk("++++++++++++++++%s:%d\n", __func__, __LINE__);
+}
+
+int rk_lcd_standby(u8 enable) {
+
+       u8 dcs[16] = {0};
+       if(dsi_is_active() != 1)
+               return -1;
+               
+       if(enable) {
+               /*below is changeable*/
+               dcs[0] = LPDT;
+               dcs[1] = dcs_set_display_off; 
+               dsi_send_dcs_packet(dcs, 2);
+               msleep(1);
+               dcs[0] = LPDT;
+               dcs[1] = dcs_enter_sleep_mode; 
+               dsi_send_dcs_packet(dcs, 2);
+               msleep(1);
+
+               printk("++++enable++++++++++++%s:%d\n", __func__, __LINE__);
+       
+       } else {
+               /*below is changeable*/
+               rk_lcd_init();
+               printk("++++++++++++++++%s:%d\n", __func__, __LINE__);  
+       }
+}
+#endif
+
+#endif