rk30_phonepad:improve auto lcd driver
authorluowei <lw@rock-chips.com>
Sun, 14 Oct 2012 05:51:02 +0000 (13:51 +0800)
committerluowei <lw@rock-chips.com>
Sun, 14 Oct 2012 05:51:02 +0000 (13:51 +0800)
drivers/video/display/screen/lcd_auto.c [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index dfec50c..42dc181
 #include <linux/ts-auto.h>\r
 #include "screen.h"\r
 \r
+extern struct rk29_bl_info rk29_bl_info;\r
+\r
 \r
 //FOR ID0\r
 /* Base */\r
 #define OUT_TYPE_ID0                   SCREEN_RGB\r
-\r
 #define OUT_FACE_ID0                   OUT_P888\r
-#define OUT_CLK_ID0                    50000000\r
-#define LCDC_ACLK_ID0                  500000000\r
+#define OUT_CLK_ID0                    71000000\r
+#define LCDC_ACLK_ID0                  300000000     //29 lcdc axi DMA ÆµÂÊ\r
 \r
 /* Timing */\r
-#define H_PW_ID0                       100\r
-#define H_BP_ID0                       100\r
-#define H_VD_ID0                       1024\r
-#define H_FP_ID0                       120\r
-\r
-#define V_PW_ID0                       10\r
-#define V_BP_ID0                       10\r
-#define V_VD_ID0                       600\r
-#define V_FP_ID0                       15\r
-\r
-#define LCD_WIDTH_ID0                  202\r
-#define LCD_HEIGHT_ID0                 152\r
+#define H_PW_ID0                       10\r
+#define H_BP_ID0                       64\r
+#define H_VD_ID0                       800\r
+#define H_FP_ID0                       16\r
+\r
+#define V_PW_ID0                       3\r
+#define V_BP_ID0                       8\r
+#define V_VD_ID0                       1280\r
+#define V_FP_ID0                       10\r
+\r
+\r
 /* Other */\r
 #define DCLK_POL_ID0                   0\r
-#define SWAP_RB_ID0                    0   \r
+#define SWAP_RB_ID0                    0\r
+\r
+#define LCD_WIDTH_ID0                  152\r
+#define LCD_HEIGHT_ID0                 202\r
+\r
+\r
 \r
 //FOR ID2\r
 #define OUT_TYPE_ID2                   SCREEN_RGB\r
 #define LCD_WIDTH_ID3                  270\r
 #define LCD_HEIGHT_ID3                 202\r
 \r
-\r
+#if defined(CONFIG_TS_AUTO)\r
 extern struct ts_private_data *g_ts;\r
-extern int rk_get_board_id(void);\r
+#else\r
+static struct ts_private_data *g_ts = NULL;\r
+#endif\r
 \r
+#if defined(CONFIG_RK_BOARD_ID)\r
+extern int rk_get_board_id(void);\r
+#else\r
+static int rk_get_board_id(void)\r
+{\r
+       return -1;\r
+}\r
+#endif\r
 static int lcd_get_id(void)\r
 {\r
        int id = -1;\r
-#if 0\r
-       id = rk_get_board_id();\r
+       int ts_id = -1;\r
        \r
-#else\r
-       struct ts_max_pixel pixel;\r
-\r
+#if defined(CONFIG_RK_BOARD_ID)\r
+       id = rk_get_board_id(); \r
+#elif defined(CONFIG_TS_AUTO)\r
        if(!g_ts)\r
                return -1;\r
-       \r
-       pixel = g_ts->ops->pixel;\r
-       if((pixel.max_x == 1024)&&(pixel.max_y == 600))\r
-               id = 0;\r
-       else if((pixel.max_x == 1024)&&(pixel.max_y == 768))    \r
-               id = 2;\r
-       else if((pixel.max_x == 1280)&&(pixel.max_y == 800))    \r
-               id = 3;\r
+\r
+       ts_id = g_ts->ops->id_i2c;\r
+\r
+       switch(ts_id)\r
+       {\r
+               case TS_ID_FT5306:      \r
+                       id = 2;\r
+                       break;\r
+               case TS_ID_GT8110:      \r
+                       id = 3;\r
+                       break;\r
+               case TS_ID_GT828:\r
+                       id = 0;\r
+                       break;\r
+               default:\r
+                       break;\r
+       }\r
+\r
 #endif\r
        return id;\r
 }\r