tizen 2.4 release
[kernel/u-boot-tm1.git] / drivers / video / sprdfb / lcd / lcd_nt35516_mipi.c
1 /* drivers/video/sc8825/lcd_nt35516_mipi.c
2  *
3  * Support for nt35516 mipi LCD device
4  *
5  * Copyright (C) 2010 Spreadtrum
6  *
7  * This software is licensed under the terms of the GNU General Public
8  * License version 2, as published by the Free Software Foundation, and
9  * may be copied, distributed, and modified under those terms.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  */
16
17 #include <asm/arch/sprd_lcd.h>
18 #include "../sprdfb.h"
19
20 #define printk printf
21
22 #define  LCD_DEBUG
23 #ifdef LCD_DEBUG
24 #define LCD_PRINT printk
25 #else
26 #define LCD_PRINT(...)
27 #endif
28
29 #define MAX_DATA   48
30
31 typedef struct LCM_Init_Code_tag {
32         unsigned int tag;
33         unsigned char data[MAX_DATA];
34 }LCM_Init_Code;
35
36 typedef struct LCM_force_cmd_code_tag{
37         unsigned int datatype;
38         LCM_Init_Code real_cmd_code;
39 }LCM_Force_Cmd_Code;
40
41 #define LCM_TAG_SHIFT 24
42 #define LCM_TAG_MASK  ((1 << 24) -1)
43 #define LCM_SEND(len) ((1 << LCM_TAG_SHIFT)| len)
44 #define LCM_SLEEP(ms) ((2 << LCM_TAG_SHIFT)| ms)
45 //#define ARRAY_SIZE(array) ( sizeof(array) / sizeof(array[0]))
46
47 #define LCM_TAG_SEND  (1<< 0)
48 #define LCM_TAG_SLEEP (1 << 1)
49
50 static LCM_Init_Code init_data[] = {
51
52 // NT35516, LGD
53 // VCC=2.8V, IOVCC=1.8V
54 {LCM_SEND(7), {5, 0, 0xFF,0xAA,0x55,0x25,0x01}},
55 {LCM_SEND(38), {36, 0, 0xF2,0x00,0x00,0x4A,0x0A,0xA8,0x00,0x00,
56         0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0B,
57         0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,
58         0x01,0x51,0x00,0x01,0x00,0x01}},
59 {LCM_SEND(10), {8, 0, 0xF3,0x02,0x03,0x07,0x45,0x88,0xD1,0x0D}},
60 // Manufacture Command Set for Page 0
61 {LCM_SEND(8), {6, 0, 0xF0,0x55,0xAA,0x52,0x08,0x00}},
62 /*
63 #if defined(CONFIG_SP8830EC)||defined(CONFIG_SP7730EC) || defined(CONFIG_SP5735) || defined(CONFIG_SP5735C1) || defined(CONFIG_SP7730ECTRISIM) || defined(CONFIG_SC9620OPENPHONE) || defined(CONFIG_SC9620FPGA) || defined(CONFIG_SP8830GA) || defined(CONFIG_SP7730GA) || defined(CONFIG_SP8830GEA) || defined(CONFIG_SP8730SEA) || defined(CONFIG_SP7730EEA_FPGA) || defined(CONFIG_SP8730SEEA) || defined(CONFIG_SP8730SEEA_QHD) || defined(CONFIG_SP8730SEEA_JIG) || defined(CONFIG_SP8730SEEA_JIGBOARD)  || defined(CONFIG_SP7730GGA) || defined(CONFIG_SP7731GGA_LC) || defined(CONFIG_SP7730GGA_LC) || defined(CONFIG_SP7731GEA) || defined(CONFIG_SP7731GEA_FWVGA) || defined(CONFIG_SP7731GEAOPENPHONE) || defined(CONFIG_SP7731GEA_LC) || defined (CONFIG_SP7730GGAOPENPHONE) || defined(CONFIG_TSHARKWSAMSUNG) || defined(CONFIG_PIKEAYOUNG2DTV) || defined(CONFIG_PIKEAYOUNG2) || defined(CONFIG_PIKEAVIVALTOVE) || defined(CONFIG_PIKEAVIVALTOVE_3M) || defined(CONFIG_PIKEAVIVALTOVE_3M_MARLIN)
64 */
65 #ifndef CONFIG_LCD_ROTATION_0
66 {LCM_SEND(6), {4, 0, 0xB1,0x7C,0x06,0x00}}, // command/video mode,rotate 180
67 #else
68 {LCM_SEND(6), {4, 0, 0xB1,0x7C,0x00,0x00}}, // command/video mode
69 #endif
70 {LCM_SEND(7), {5, 0, 0xB8,0x01,0x02,0x02,0x02}},
71 {LCM_SEND(6), {4, 0, 0xBC,0x00,0x00,0x00}},  // inversion
72 {LCM_SEND(9), {7, 0, 0xC9,0x63,0x06,0x0D,0x1A,0x17,0x00}},
73 // Manufacture Command Set for Page 1
74 {LCM_SEND(8), {6, 0, 0xF0,0x55,0xAA,0x52,0x08,0x01}},
75 {LCM_SEND(6), {4, 0, 0xB0,0x05,0x05,0x05}},
76 {LCM_SEND(6), {4, 0, 0xB1,0x05,0x05,0x05}},
77 {LCM_SEND(6), {4, 0, 0xB2,0x01,0x01,0x01}},
78 {LCM_SEND(6), {4, 0, 0xB3,0x0D,0x0D,0x0D}},
79 {LCM_SEND(6), {4, 0, 0xB4,0x09,0x09,0x09}},
80 {LCM_SEND(6), {4, 0, 0xB6,0x44,0x44,0x44}},
81 {LCM_SEND(6), {4, 0, 0xB7,0x34,0x34,0x34}},
82 {LCM_SEND(6), {4, 0, 0xB8,0x10,0x10,0x10}},
83 {LCM_SEND(6), {4, 0, 0xB9,0x36,0x36,0x36}},
84 {LCM_SEND(6), {4, 0, 0xBA,0x24,0x24,0x24}},
85 {LCM_SEND(6), {4, 0, 0xBC,0x00,0xD0,0x00}},
86 {LCM_SEND(6), {4, 0, 0xBD,0x00,0xD0,0x00}},
87 {LCM_SEND(2), {0xBE,0x5D}},
88 {LCM_SEND(5), {3, 0, 0xC0,0x04,0x00}},
89 {LCM_SEND(2), {0xCA,0x00}},
90 // Gradient Control for Gamma Voltage
91 {LCM_SEND(7), {5, 0, 0xD0,0x0A,0x10,0x0D,0x0F}},
92 {LCM_SEND(19), {17, 0, 0xD1,0x00,0xA7,0x01,0x0F,0x01,0x34,0x01,0x49,0x01,0x56,0x01,0x75,0x01,0x8F,0x01,0xB7}},
93 {LCM_SEND(19), {17, 0, 0xD2,0x01,0xD1,0x02,0x03,0x02,0x23,0x02,0x57,0x02,0x85,0x02,0x87,0x02,0xAA,0x02,0xE1}},
94 {LCM_SEND(19), {17, 0, 0xD3,0x03,0x04,0x03,0x31,0x03,0x42,0x03,0x6D,0x03,0x83,0x03,0x9C,0x03,0xAA,0x03,0xCD}},
95 {LCM_SEND(7), {5, 0, 0xD4,0x03,0xEF,0x03,0xFF}},
96 {LCM_SEND(19), {17, 0, 0xD5,0x00,0xA7,0x01,0x0F,0x01,0x34,0x01,0x49,0x01,0x56,0x01,0x75,0x01,0x8F,0x01,0xB7}},
97 {LCM_SEND(19), {17, 0, 0xD6,0x01,0xD1,0x02,0x03,0x02,0x23,0x02,0x57,0x02,0x85,0x02,0x87,0x02,0xAA,0x02,0xE1}},
98 {LCM_SEND(19), {17, 0, 0xD7,0x03,0x04,0x03,0x31,0x03,0x42,0x03,0x6D,0x03,0x83,0x03,0x9C,0x03,0xAA,0x03,0xCD}},
99 {LCM_SEND(7), {5, 0, 0xD8,0x03,0xEF,0x03,0xFF}},
100 {LCM_SEND(19), {17, 0, 0xD9,0x00,0xA7,0x01,0x0F,0x01,0x34,0x01,0x49,0x01,0x56,0x01,0x75,0x01,0x8F,0x01,0xB7}},
101 {LCM_SEND(19), {17, 0, 0xDD,0x01,0xD1,0x02,0x03,0x02,0x23,0x02,0x57,0x02,0x85,0x02,0x87,0x02,0xAA,0x02,0xE1}},
102 {LCM_SEND(19), {17, 0, 0xDE,0x03,0x04,0x03,0x31,0x03,0x42,0x03,0x6D,0x03,0x83,0x03,0x9C,0x03,0xAA,0x03,0xCD}},
103 {LCM_SEND(7), {5, 0, 0xDF,0x03,0xEF,0x03,0xFF}},
104 {LCM_SEND(19), {17, 0, 0xE0,0x00,0xA7,0x01,0x0F,0x01,0x34,0x01,0x49,0x01,0x56,0x01,0x75,0x01,0x8F,0x01,0xB7}},
105 {LCM_SEND(19), {17, 0, 0xE1,0x01,0xD1,0x02,0x03,0x02,0x23,0x02,0x57,0x02,0x85,0x02,0x87,0x02,0xAA,0x02,0xE1}},
106 {LCM_SEND(19), {17, 0, 0xE2,0x03,0x04,0x03,0x31,0x03,0x42,0x03,0x6D,0x03,0x83,0x03,0x9C,0x03,0xAA,0x03,0xCD}},
107 {LCM_SEND(7), {5, 0, 0xE3,0x03,0xEF,0x03,0xFF}},
108 {LCM_SEND(19), {17, 0, 0xE4,0x00,0xA7,0x01,0x0F,0x01,0x34,0x01,0x49,0x01,0x56,0x01,0x75,0x01,0x8F,0x01,0xB7}},
109 {LCM_SEND(19), {17, 0, 0xE5,0x01,0xD1,0x02,0x03,0x02,0x23,0x02,0x57,0x02,0x85,0x02,0x87,0x02,0xAA,0x02,0xE1}},
110 {LCM_SEND(19), {17, 0, 0xE6,0x03,0x04,0x03,0x31,0x03,0x42,0x03,0x6D,0x03,0x83,0x03,0x9C,0x03,0xAA,0x03,0xCD}},
111 {LCM_SEND(7), {5, 0, 0xE7,0x03,0xEF,0x03,0xFF}},
112 {LCM_SEND(19), {17, 0, 0xE8,0x00,0xA7,0x01,0x0F,0x01,0x34,0x01,0x49,0x01,0x56,0x01,0x75,0x01,0x8F,0x01,0xB7}},
113 {LCM_SEND(19), {17, 0, 0xE9,0x01,0xD1,0x02,0x03,0x02,0x23,0x02,0x57,0x02,0x85,0x02,0x87,0x02,0xAA,0x02,0xE1}},
114 {LCM_SEND(19), {17, 0, 0xEA,0x03,0x04,0x03,0x31,0x03,0x42,0x03,0x6D,0x03,0x83,0x03,0x9C,0x03,0xAA,0x03,0xCD}},
115 {LCM_SEND(7), {5, 0, 0xEB,0x03,0xEF,0x03,0xFF}},
116 // User Command Set
117 {LCM_SEND(2), {0x35,0x00}}, // Tearing Effect On
118 {LCM_SEND(5), {3, 0, 0x44, 0x03, 0x98}}, //set te scan line to 920
119 {LCM_SEND(2), {0x3A,0x77}}, // Interface Pixel Format
120 {LCM_SEND(2), {0x36,0x00}}, // Memory Data Access Control
121 {LCM_SEND(1), {0x22}}, // all pixel off
122 {LCM_SEND(1), {0x11}}, // sleep out
123 {LCM_SLEEP(120)},
124 {LCM_SEND(1), {0x29}}, // display on
125 {LCM_SLEEP(100),},
126 {LCM_SEND(2), {0x13,0x00}}, // normal on
127
128
129 #if 0
130 {LCM_SEND(7), {0x5, 0, 0xFF, 0xAA, 0x55, 0x25, 0x01}},
131 {LCM_SEND(7), {0x5, 0, 0xF3, 0x02, 0x03, 0x07, 0x15}},
132 {LCM_SEND(8), {0x6, 0, 0xF0, 0x55, 0xAA, 0x52, 0x08, 0x00}},
133 //{LCM_SEND(8), {0x06, 0, 0xF0,0x55,0xAA,0x52,0x08,0x00}},
134 //{LCM_SEND(8), {0x06, 0, 0xBD,0x02,0xC8,0x14,0x3C,0x01}},
135 {LCM_SEND(2), {0xB1, 0xFC}},
136
137 {LCM_SEND(7), {0x5, 0, 0xB8, 0x01, 0x02, 0x02, 0x02}},
138 {LCM_SEND(6), {0x4, 0, 0xBC, 0x05, 0x05, 0x05}}, //Zig-Zag Inversion
139 {LCM_SEND(8), {0x6, 0, 0xF0, 0x55, 0xAA, 0x52, 0x08, 0x01}},
140 {LCM_SEND(6), {0x4, 0, 0xB0, 0x05, 0x05, 0x05}},
141 {LCM_SEND(6), {0x4, 0, 0xB1, 0x05, 0x05, 0x05}},
142 {LCM_SEND(6), {0x4, 0, 0xB6, 0x34, 0x34, 0x34}},
143 {LCM_SEND(6), {0x4, 0, 0xB7, 0x24, 0x24, 0x24}},
144 {LCM_SEND(6), {0x4, 0, 0xB3, 0x10, 0x10, 0x10}},
145 {LCM_SEND(6), {0x4, 0, 0xB9, 0x34, 0x34, 0x34}},
146 {LCM_SEND(6), {0x4, 0, 0xB4, 0x0A, 0x0A, 0x0A}},
147 {LCM_SEND(6), {0x4, 0, 0xBA, 0x14, 0x14, 0x14}},
148 {LCM_SEND(6), {0x4, 0, 0xBC, 0x00, 0xA0, 0x00}},
149 {LCM_SEND(6), {0x4, 0, 0xBD, 0x00, 0xA0, 0x00}},
150 {LCM_SEND(2), {0xBE, 0x4E}},
151
152 {LCM_SEND(19),{17,  0, 0xD1, 0x00, 0x32, 0x00, 0x41, 0x00, 0x54, 0x00, 0x67, 0x00, 0x7A, 0x00, 0x98, 0x00, 0xB0, 0x00, 0xDB}},
153 {LCM_SEND(19),{17,  0, 0xD2, 0x01, 0x01, 0x01, 0x3F, 0x01, 0x70, 0x01, 0xB4, 0x01, 0xEC, 0x01, 0xED, 0x02, 0x1E, 0x02, 0x51}},
154 {LCM_SEND(19),{17,  0, 0xD3, 0x02, 0x6C, 0x02, 0x8D, 0x02, 0xA5, 0x02, 0xC9, 0x02, 0xEA, 0x03, 0x19, 0x03, 0x45, 0x03, 0x7A}},
155 {LCM_SEND(7), { 5, 0, 0xD4, 0x03, 0xB0, 0x03, 0xF4}},
156 {LCM_SEND(19),{17,  0, 0xD5, 0x00, 0x32, 0x00, 0x41, 0x00, 0x54, 0x00, 0x67, 0x00, 0x7A, 0x00, 0x98, 0x00, 0xB0, 0x00, 0xDB}},
157 {LCM_SEND(19),{17,  0, 0xD6, 0x01, 0x01, 0x01, 0x3F, 0x01, 0x70, 0x01, 0xB4, 0x01, 0xEC, 0x01, 0xED, 0x02, 0x1E, 0x02, 0x51}},
158 {LCM_SEND(19),{17,  0, 0xD7, 0x02, 0x6C, 0x02, 0x8D, 0x02, 0xA5, 0x02, 0xC9, 0x02, 0xEA, 0x03, 0x19, 0x03, 0x45, 0x03, 0x7A}},
159 {LCM_SEND(7), {0x7, 0, 0xD8, 0x03, 0xB0, 0x03, 0xF4}},
160 {LCM_SEND(19),{17,  0, 0xD9, 0x00, 0x32, 0x00, 0x41, 0x00, 0x54, 0x00, 0x67, 0x00, 0x7A, 0x00, 0x98, 0x00, 0xB0, 0x00, 0xDB}},
161 {LCM_SEND(19),{17,  0,0xDD, 0x01, 0x01, 0x01, 0x3F, 0x01, 0x70, 0x01, 0xB4, 0x01, 0xEC, 0x01, 0xED, 0x02, 0x1E, 0x02, 0x51}},
162 {LCM_SEND(19),{17, 0, 0xDE, 0x02, 0x6C, 0x02, 0x8D, 0x02, 0xA5, 0x02, 0xC9, 0x02, 0xEA, 0x03, 0x19, 0x03, 0x45, 0x03, 0x7A}},
163 {LCM_SEND(7), {0x5, 0, 0xDF, 0x03, 0xB0, 0x03, 0xF4}},
164 {LCM_SEND(19),{17,  0, 0xE0, 0x00, 0x32, 0x00, 0x41, 0x00, 0x54, 0x00, 0x67, 0x00, 0x7A, 0x00, 0x98, 0x00, 0xB0, 0x00, 0xDB}},
165 {LCM_SEND(19),{17,  0 ,0xE1, 0x01, 0x01, 0x01, 0x3F, 0x01, 0x70, 0x01, 0xB4, 0x01, 0xEC, 0x01, 0xED, 0x02, 0x1E, 0x02, 0x51}},
166 {LCM_SEND(19),{17,  0,0xE2, 0x02, 0x6C, 0x02, 0x8D, 0x02, 0xA5, 0x02, 0xC9, 0x02, 0xEA, 0x03, 0x19, 0x03, 0x45, 0x03, 0x7A}},
167 {LCM_SEND(7), {5, 0, 0xE3, 0x03, 0xB0, 0x03, 0xF4}},
168 {LCM_SEND(19),{17,  0, 0xE4, 0x00, 0x32, 0x00, 0x41, 0x00, 0x54, 0x00, 0x67, 0x00, 0x7A, 0x00, 0x98, 0x00, 0xB0, 0x00, 0xDB}},
169 {LCM_SEND(19),{17,  0,0xE5, 0x01, 0x01, 0x01, 0x3F, 0x01, 0x70, 0x01, 0xB4, 0x01, 0xEC, 0x01, 0xED, 0x02, 0x1E, 0x02, 0x51}},
170 {LCM_SEND(19),{17,  0, 0xE6, 0x02, 0x6C, 0x02, 0x8D, 0x02, 0xA5, 0x02, 0xC9, 0x02, 0xEA, 0x03, 0x19, 0x03, 0x45, 0x03, 0x7A}},
171 {LCM_SEND(7), {5, 0, 0xE7, 0x03, 0xB0, 0x03, 0xF4}},
172 {LCM_SEND(19),{17 , 0, 0xE8, 0x00, 0x32, 0x00, 0x41, 0x00, 0x54, 0x00, 0x67, 0x00, 0x7A, 0x00, 0x98, 0x00, 0xB0, 0x00, 0xDB}},
173 {LCM_SEND(19),{17,  0, 0xE9, 0x01, 0x01, 0x01, 0x3F, 0x01, 0x70, 0x01, 0xB4, 0x01, 0xEC, 0x01, 0xED, 0x02, 0x1E, 0x02, 0x51}},
174 {LCM_SEND(19),{17,  0, 0xEA, 0x02, 0x6C, 0x02, 0x8D, 0x02, 0xA5, 0x02, 0xC9, 0x02, 0xEA, 0x03, 0x19, 0x03, 0x45, 0x03, 0x7A}},
175 {LCM_SEND(7), {0x5, 0, 0xEB, 0x03, 0xB0, 0x03, 0xF4}},
176 {LCM_SEND(2), {0x3A, 0x77}},
177 {LCM_SEND(2), {0x35, 0x00}},
178 {LCM_SEND(2), {0x4C, 0x11}},
179
180 #endif
181 #if 0
182 {LCM_SEND(1), {0x11}},//0x11
183 {LCM_SLEEP(200),},
184 {LCM_SEND(1), {0x29}},//0x29
185 #endif
186 };
187
188 static LCM_Force_Cmd_Code rd_prep_code[]={
189         {0x39, {LCM_SEND(8), {0x6, 0, 0xF0, 0x55, 0xAA, 0x52, 0x08, 0x01}}},
190         {0x37, {LCM_SEND(2), {0x3, 0}}},
191 };
192
193 static LCM_Init_Code disp_on =  {LCM_SEND(1), {0x29}};
194
195 static LCM_Init_Code sleep_in =  {LCM_SEND(1), {0x10}};
196
197 static LCM_Init_Code sleep_out =  {LCM_SEND(1), {0x11}};
198
199 static int32_t nt35516_mipi_init(struct panel_spec *self)
200 {
201         int32_t i;
202         LCM_Init_Code *init = init_data;
203         unsigned int tag;
204
205         mipi_set_cmd_mode_t mipi_set_cmd_mode = self->info.mipi->ops->mipi_set_cmd_mode;
206         mipi_gen_write_t mipi_gen_write = self->info.mipi->ops->mipi_gen_write;
207
208         LCD_PRINT("lcd_nt35516_init\n");
209
210         mipi_set_cmd_mode();
211
212         for(i = 0; i < ARRAY_SIZE(init_data); i++){
213                 tag = (init->tag >>24);
214                 if(tag & LCM_TAG_SEND){
215                         mipi_gen_write(init->data, (init->tag & LCM_TAG_MASK));
216                         udelay(20);
217                 }else if(tag & LCM_TAG_SLEEP){
218                         mdelay((init->tag & LCM_TAG_MASK));
219                 }
220                 init++;
221         }
222         return 0;
223 }
224
225 static uint32_t nt35516_readid(struct panel_spec *self)
226 {
227         /*Jessica TODO: need read id*/
228         int32_t i = 0;
229         uint32 j =0;
230         LCM_Force_Cmd_Code * rd_prepare = rd_prep_code;
231         uint8_t read_data[3] = {0};
232         int32_t read_rtn = 0;
233         unsigned int tag = 0;
234         mipi_set_cmd_mode_t mipi_set_cmd_mode = self->info.mipi->ops->mipi_set_cmd_mode;
235         mipi_force_write_t mipi_force_write = self->info.mipi->ops->mipi_force_write;
236         mipi_force_read_t mipi_force_read = self->info.mipi->ops->mipi_force_read;
237         mipi_eotp_set_t mipi_eotp_set = self->info.mipi->ops->mipi_eotp_set;
238
239         LCD_PRINT("lcd_nt35516_mipi read id!\n");
240 //      return 0x16;    //debug
241 //#ifdef CONFIG_SC8830
242 //      return 0x16;    //debug
243 //#endif
244         mipi_set_cmd_mode();
245         mipi_eotp_set(0,1);
246         for(j = 0; j < 4; j++){
247                 rd_prepare = rd_prep_code;
248                 for(i = 0; i < ARRAY_SIZE(rd_prep_code); i++){
249                         tag = (rd_prepare->real_cmd_code.tag >> 24);
250                         if(tag & LCM_TAG_SEND){
251                                 mipi_force_write(rd_prepare->datatype, rd_prepare->real_cmd_code.data, (rd_prepare->real_cmd_code.tag & LCM_TAG_MASK));
252                         }else if(tag & LCM_TAG_SLEEP){
253                                 mdelay((rd_prepare->real_cmd_code.tag & LCM_TAG_MASK));
254                         }
255                         rd_prepare++;
256                 }
257                 read_rtn = mipi_force_read(0xc5, 3,(uint8_t *)read_data);
258                 LCD_PRINT("lcd_nt35516_mipi read id 0xc5 value is 0x%x, 0x%x, 0x%x!\n", read_data[0], read_data[1], read_data[2]);
259
260                 if((0x55 == read_data[0])&&(0x16 == read_data[1])){
261                         LCD_PRINT("lcd_nt35516_mipi read id success!\n");
262                         mipi_eotp_set(1,1);
263                         return 0x16;
264                 }
265         }
266         mipi_eotp_set(1,1);
267         return 0x0;
268 }
269
270 static struct panel_operations lcd_nt35516_mipi_operations = {
271         .panel_init = nt35516_mipi_init,
272         .panel_readid = nt35516_readid,
273 };
274
275 static struct timing_rgb lcd_nt35516_mipi_timing = {
276         .hfp = 20,  /* unit: pixel */
277         .hbp = 20,
278         .hsync = 20,//4,
279         .vfp = 10, /*unit: line*/
280         .vbp = 10,
281         .vsync = 6,
282 };
283
284 static struct info_mipi lcd_nt35516_mipi_info = {
285         .work_mode  = SPRDFB_MIPI_MODE_VIDEO,
286         .video_bus_width = 24, /*18,16*/
287         .lan_number = 3,
288         .phy_feq = 500*1000,
289         .h_sync_pol = SPRDFB_POLARITY_POS,
290         .v_sync_pol = SPRDFB_POLARITY_POS,
291         .de_pol = SPRDFB_POLARITY_POS,
292         .te_pol = SPRDFB_POLARITY_POS,
293         .color_mode_pol = SPRDFB_POLARITY_NEG,
294         .shut_down_pol = SPRDFB_POLARITY_NEG,
295         .timing = &lcd_nt35516_mipi_timing,
296         .ops = NULL,
297 };
298
299 struct panel_spec lcd_nt35516_mipi_spec = {
300         //.cap = PANEL_CAP_NOT_TEAR_SYNC,
301         .width = 540,
302         .height = 960,
303         .fps = 60,
304         .type = LCD_MODE_DSI,
305         .direction = LCD_DIRECT_NORMAL,
306         .info = {
307                 .mipi = &lcd_nt35516_mipi_info
308         },
309         .ops = &lcd_nt35516_mipi_operations,
310 };
311
312