3 #include <linux/string.h>
4 #if defined(BUILD_UBOOT)
5 #include <asm/arch/mt6577_gpio.h>
7 #include <mach/mt6577_gpio.h>
12 // ---------------------------------------------------------------------------
14 // ---------------------------------------------------------------------------
16 #define FRAME_WIDTH (480)
17 #define FRAME_HEIGHT (800)
19 #define REGFLAG_DELAY 0XAA
20 #define REGFLAG_END_OF_TABLE 0xAB // END OF REGISTERS MARKER
22 #define LCM_DSI_CMD_MODE 0
34 #define LCM_ID1 (0x90)
35 #define LCM_ID2 (0x69)
37 // ---------------------------------------------------------------------------
39 // ---------------------------------------------------------------------------
41 static LCM_UTIL_FUNCS lcm_util
= {0};
43 #define SET_RESET_PIN(v) (lcm_util.set_reset_pin((v)))
45 #define UDELAY(n) (lcm_util.udelay(n))
46 #define MDELAY(n) (lcm_util.mdelay(n))
49 // ---------------------------------------------------------------------------
51 // ---------------------------------------------------------------------------
53 #define dsi_set_cmdq_V3(ppara, size, force_update) lcm_util.dsi_set_cmdq_V3(ppara, size, force_update)
54 #define dsi_set_cmdq_V2(cmd, count, ppara, force_update) lcm_util.dsi_set_cmdq_V2(cmd, count, ppara, force_update)
55 #define dsi_set_cmdq(pdata, queue_size, force_update) lcm_util.dsi_set_cmdq(pdata, queue_size, force_update)
56 #define wrtie_cmd(cmd) lcm_util.dsi_write_cmd(cmd)
57 #define write_regs(addr, pdata, byte_nums) lcm_util.dsi_write_regs(addr, pdata, byte_nums)
58 #define read_reg(cmd) lcm_util.dsi_dcs_read_lcm_reg(cmd)
59 #define read_reg_v2(cmd, buffer, buffer_size) lcm_util.dsi_dcs_read_lcm_reg_v2(cmd, buffer, buffer_size)
61 static struct LCM_setting_table
{
64 unsigned char para_list
[128];
67 #if defined(LCM_TABLE_V3)
69 static LCM_setting_table_V3 lcm_initialization_setting_V3
[] = {
76 {Data_ID, DCS command, count of parameters, {parameter list}},
78 {REGFLAG_ESCAPE_ID, REGFLAG_DELAY_MS_V3, milliseconds of time, {}},
84 {0x39, 0xB9, 3, {0xFF, 0x83, 0x69}},
86 {0x39, 0xB1, 10, {0x12, 0x83, 0x77, 0x00,
87 0x8F, 0x0F, 0x1A, 0x1A,
90 {0x39, 0xB2, 3, {0x00, 0x10, 0x02}},
92 {0x39, 0xB3, 4, {0x83, 0x00, 0x31, 0x03}},
94 {0x15, 0xB4, 1, {0x42}},
96 {0x39, 0xB6, 2, {0x7F, 0x7F}},
98 {0x39, 0xE3, 4, {0x01, 0x01, 0x01, 0x01}},
100 {0x39, 0xC0, 6, {0x73, 0x50, 0x00, 0x3C,
103 {0x15, 0xCC, 1, {0x00}},
106 {0x39, 0xD5, 92, {0x00, 0x00, 0x10, 0x00,
107 0x00, 0x00, 0x00, 0x12,
108 0x30, 0x00, 0x00, 0x00,
109 0x01, 0x70, 0x33, 0x00,
110 0x00, 0x12, 0x20, 0x60,
111 0x37, 0x00, 0x00, 0x03,
112 0x00, 0x00, 0x00, 0x00,
113 0x00, 0x03, 0x00, 0x00,
114 0x03, 0x00, 0x00, 0x0B,
115 0x00, 0x00, 0x00, 0x00,
116 0x00, 0x00, 0x00, 0x00,
117 0x00, 0x88, 0x88, 0x88,
118 0x88, 0x55, 0x77, 0x11,
119 0x33, 0x32, 0x00, 0x00,
120 0x00, 0x00, 0x00, 0x00,
121 0x00, 0x00, 0x00, 0x88,
122 0x88, 0x88, 0x88, 0x44,
123 0x66, 0x00, 0x22, 0x10,
124 0x00, 0x00, 0x00, 0x01,
125 0x00, 0x00, 0x00, 0x03,
126 0xAA, 0xFF, 0xFF, 0xFF,
127 0x03, 0xAA, 0xFF, 0xFF,
128 0xFF, 0x00, 0x01, 0x5A}},
130 {0x39, 0xD5, 59, {0x00, 0x00, 0x10, 0x00,
131 0x00, 0x00, 0x00, 0x12,
132 0x30, 0x00, 0x00, 0x00,
133 0x01, 0x70, 0x33, 0x00,
134 0x00, 0x12, 0x20, 0x60,
135 0x37, 0x00, 0x00, 0x03,
136 0x00, 0x00, 0x00, 0x00,
137 0x00, 0x03, 0x00, 0x00,
138 0x03, 0x00, 0x00, 0x0B,
139 0x00, 0x00, 0x00, 0x00,
140 0x00, 0x00, 0x00, 0x00,
141 0x00, 0x88, 0x88, 0x88,
142 0x88, 0x55, 0x77, 0x11,
143 0x33, 0x32, 0x00, 0x00,
148 0x00, 0x00, 0x00, 0x88,
149 0x88, 0x88, 0x88, 0x44,
150 0x66, 0x00, 0x22, 0x10,
151 0x00, 0x00, 0x00, 0x01,
152 0x00, 0x00, 0x00, 0x03,
153 0xAA, 0xFF, 0xFF, 0xFF,
154 0x03, 0xAA, 0xFF, 0xFF,
155 0xFF, 0x00, 0x01, 0x5A}},
158 {0x39, 0xE0, 35, {0x00, 0x0C, 0x00, 0x10,
159 0x14, 0x3C, 0x27, 0x34,
160 0x0C, 0x10, 0x11, 0x15,
161 0x18, 0x16, 0x16, 0x13,
162 0x18, 0x0C, 0x00, 0x0C,
163 0x10, 0x14, 0x3C, 0x27,
164 0x34, 0x0C, 0x10, 0x11,
165 0x15, 0x18, 0x16, 0x16,
168 {0x15, 0xEA, 1, {0x62}},
170 {0x15, 0x3A, 1, {0x77}},
172 {0x39, 0xBA, 15, {0x11, 0x00, 0x16, 0xC6,
173 0x00, 0x0A, 0x00, 0x10,
174 0x24, 0x02, 0x21, 0x21,
179 static LCM_setting_table_V3 lcm_sleep_out_setting_V3
[] = {
181 {0x15, 0x11, 1, {0x00}},
182 {REGFLAG_ESCAPE_ID
, REGFLAG_DELAY_MS_V3
, 150, {}},
185 {0x15, 0x29, 1, {0x00}},
186 {REGFLAG_ESCAPE_ID
, REGFLAG_DELAY_MS_V3
, 10, {}}
191 static LCM_setting_table_V3 lcm_deep_sleep_mode_in_setting_V3
[] = {
192 // Display off sequence
193 {0x15, 0x28, 1, {0x00}},
196 {0x15, 0x10, 1, {0x00}}
200 static LCM_setting_table_V3 lcm_compare_id_setting_V3
[] = {
201 // Display off sequence
202 {0x39, 0xB9, 3, {0xFF, 0x83, 0x69}},
203 {REGFLAG_ESCAPE_ID
, REGFLAG_DELAY_MS_V3
, 10, {}}
207 static LCM_setting_table_V3 lcm_backlight_level_setting_V3
[] = {
208 {0x15, 0x51, 1, {0xFF}}
214 static struct LCM_setting_table lcm_initialization_setting
[] = {
219 Data ID will depends on the following rule.
221 count of parameters > 1 => Data ID = 0x39
222 count of parameters = 1 => Data ID = 0x15
223 count of parameters = 0 => Data ID = 0x05
227 {DCS command, count of parameters, {parameter list}}
228 {REGFLAG_DELAY, milliseconds of time, {}},
232 Setting ending by predefined flag
234 {REGFLAG_END_OF_TABLE, 0x00, {}}
237 {0xB9, 3, {0xFF, 0x83, 0x69}},
239 {0xB1, 10, {0x12, 0x83, 0x77, 0x00,
240 0x8F, 0x0F, 0x1A, 0x1A,
243 {0xB2, 3, {0x00, 0x10, 0x02}},
245 {0xB3, 4, {0x83, 0x00, 0x31, 0x03}},
249 {0xB6, 2, {0x7F, 0x7F}},
251 {0xE3, 4, {0x01, 0x01, 0x01, 0x01}},
253 {0xC0, 6, {0x73, 0x50, 0x00, 0x3C,
259 {0xD5, 92, {0x00, 0x00, 0x10, 0x00,
260 0x00, 0x00, 0x00, 0x12,
261 0x30, 0x00, 0x00, 0x00,
262 0x01, 0x70, 0x33, 0x00,
263 0x00, 0x12, 0x20, 0x60,
264 0x37, 0x00, 0x00, 0x03,
265 0x00, 0x00, 0x00, 0x00,
266 0x00, 0x03, 0x00, 0x00,
267 0x03, 0x00, 0x00, 0x0B,
268 0x00, 0x00, 0x00, 0x00,
269 0x00, 0x00, 0x00, 0x00,
270 0x00, 0x88, 0x88, 0x88,
271 0x88, 0x55, 0x77, 0x11,
272 0x33, 0x32, 0x00, 0x00,
273 0x00, 0x00, 0x00, 0x00,
274 0x00, 0x00, 0x00, 0x88,
275 0x88, 0x88, 0x88, 0x44,
276 0x66, 0x00, 0x22, 0x10,
277 0x00, 0x00, 0x00, 0x01,
278 0x00, 0x00, 0x00, 0x03,
279 0xAA, 0xFF, 0xFF, 0xFF,
280 0x03, 0xAA, 0xFF, 0xFF,
281 0xFF, 0x00, 0x01, 0x5A}},
283 {0xD5, 59, {0x00, 0x00, 0x10, 0x00,
284 0x00, 0x00, 0x00, 0x12,
285 0x30, 0x00, 0x00, 0x00,
286 0x01, 0x70, 0x33, 0x00,
287 0x00, 0x12, 0x20, 0x60,
288 0x37, 0x00, 0x00, 0x03,
289 0x00, 0x00, 0x00, 0x00,
290 0x00, 0x03, 0x00, 0x00,
291 0x03, 0x00, 0x00, 0x0B,
292 0x00, 0x00, 0x00, 0x00,
293 0x00, 0x00, 0x00, 0x00,
294 0x00, 0x88, 0x88, 0x88,
295 0x88, 0x55, 0x77, 0x11,
296 0x33, 0x32, 0x00, 0x00,
301 0x00, 0x00, 0x00, 0x88,
302 0x88, 0x88, 0x88, 0x44,
303 0x66, 0x00, 0x22, 0x10,
304 0x00, 0x00, 0x00, 0x01,
305 0x00, 0x00, 0x00, 0x03,
306 0xAA, 0xFF, 0xFF, 0xFF,
307 0x03, 0xAA, 0xFF, 0xFF,
308 0xFF, 0x00, 0x01, 0x5A}},
312 {0xD5, 56, {0x00, 0x00, 0x10, 0x00,
313 0x00, 0x00, 0x00, 0x12,
314 0x30, 0x00, 0x00, 0x00,
315 0x01, 0x70, 0x33, 0x00,
316 0x00, 0x12, 0x20, 0x60,
317 0x37, 0x00, 0x00, 0x03,
318 0x00, 0x00, 0x00, 0x00,
319 0x00, 0x03, 0x00, 0x00,
320 0x03, 0x00, 0x00, 0x0B,
321 0x00, 0x00, 0x00, 0x00,
322 0x00, 0x00, 0x00, 0x00,
323 0x00, 0x88, 0x88, 0x88,
324 0x88, 0x55, 0x77, 0x11,
325 0x33, 0x32, 0x00, 0x00}},
327 {0xFD, 38, {0xAA, 0xAA,
328 0x00, 0x00, 0x00, 0x00,
329 0x00, 0x00, 0x00, 0x88,
330 0x88, 0x88, 0x88, 0x44,
331 0x66, 0x00, 0x22, 0x10,
332 0x00, 0x00, 0x00, 0x01,
333 0x00, 0x00, 0x00, 0x03,
334 0xAA, 0xFF, 0xFF, 0xFF,
335 0x03, 0xAA, 0xFF, 0xFF,
336 0xFF, 0x00, 0x01, 0x5A}},
339 {0xE0, 35, {0x00, 0x0C, 0x00, 0x10,
340 0x14, 0x3C, 0x27, 0x34,
341 0x0C, 0x10, 0x11, 0x15,
342 0x18, 0x16, 0x16, 0x13,
343 0x18, 0x0C, 0x00, 0x0C,
344 0x10, 0x14, 0x3C, 0x27,
345 0x34, 0x0C, 0x10, 0x11,
346 0x15, 0x18, 0x16, 0x16,
353 {0xBA, 15, {0x11, 0x00, 0x16, 0xC6,
354 0x00, 0x0A, 0x00, 0x10,
355 0x24, 0x02, 0x21, 0x21,
359 // Strongly recommend not to set Sleep out / Display On here. That will cause messed frame to be shown as later the backlight is on.
362 // Setting ending by predefined flag
363 {REGFLAG_END_OF_TABLE
, 0x00, {}}
367 static struct LCM_setting_table lcm_set_window
[] = {
368 {0x2A, 4, {0x00, 0x00, (FRAME_WIDTH
>>8), (FRAME_WIDTH
&0xFF)}},
369 {0x2B, 4, {0x00, 0x00, (FRAME_HEIGHT
>>8), (FRAME_HEIGHT
&0xFF)}},
370 {REGFLAG_END_OF_TABLE
, 0x00, {}}
374 static struct LCM_setting_table lcm_sleep_out_setting
[] = {
377 {REGFLAG_DELAY
, 150, {}},
381 {REGFLAG_DELAY
, 10, {}},
382 {REGFLAG_END_OF_TABLE
, 0x00, {}}
386 static struct LCM_setting_table lcm_deep_sleep_mode_in_setting
[] = {
387 // Display off sequence
393 {REGFLAG_END_OF_TABLE
, 0x00, {}}
397 static struct LCM_setting_table lcm_compare_id_setting
[] = {
398 // Display off sequence
399 {0xB9, 3, {0xFF, 0x83, 0x69}},
400 {REGFLAG_DELAY
, 10, {}},
403 // {0xC3, 1, {0xFF}},
405 {REGFLAG_END_OF_TABLE
, 0x00, {}}
409 static struct LCM_setting_table lcm_backlight_level_setting
[] = {
411 {REGFLAG_END_OF_TABLE
, 0x00, {}}
416 static void push_table(struct LCM_setting_table
*table
, unsigned int count
, unsigned char force_update
)
418 unsigned int i
, j
, k
;
419 unsigned int para_int
, read_int
;
420 unsigned char buffer
[256];
422 for(i
= 0; i
< count
; i
++) {
430 MDELAY(table
[i
].count
);
433 case REGFLAG_END_OF_TABLE
:
437 dsi_set_cmdq_V2(cmd
, table
[i
].count
, table
[i
].para_list
, force_update
);
440 read_int
= read_reg(cmd
);
441 para_int
= *((unsigned int *)table
[i
].para_list
);
442 printf("%s, compare = {%04x, %04x} \n", __func__
, read_int
, para_int
);
443 } while(read_int
!= para_int
);
448 #if 0//defined(BUILD_UBOOT)
451 unsigned int array
[16];
453 for(i
= 0; i
< count
; i
++) {
454 if(table
[i
].cmd
!= REGFLAG_DELAY
&& table
[i
].cmd
!= REGFLAG_END_OF_TABLE
)
456 remain_bytes
= table
[i
].count
;
460 //printf("Read 0x%02x round %d. Remain %d bytes \n", table[i].cmd, j, remain_bytes);
461 r_byte_count
= (remain_bytes
> 8) ? 8 : remain_bytes
;
463 array
[0] = 0x00003700 | (r_byte_count
<<16);// read id return two byte,version and id
464 dsi_set_cmdq(array
, 1, 1);
467 read_reg_v2(0xFD, (buffer
+ j
*8), r_byte_count
);
469 read_reg_v2(table
[i
].cmd
, buffer
, r_byte_count
);
473 } while(remain_bytes
>0);
475 printf("0x%02X[%02d] => { ", table
[i
].cmd
, table
[i
].count
);
476 for(k
= 0; k
< table
[i
].count
; k
++)
478 if((k
% 4 ) == 0 && k
> 0)
479 printf("\n ", buffer
[k
]);
480 printf("0x%02X ", buffer
[k
]);
491 // ---------------------------------------------------------------------------
492 // LCM Driver Implementations
493 // ---------------------------------------------------------------------------
495 static void lcm_set_util_funcs(const LCM_UTIL_FUNCS
*util
)
497 memcpy(&lcm_util
, util
, sizeof(LCM_UTIL_FUNCS
));
501 static void lcm_get_params(LCM_PARAMS
*params
)
503 memset(params
, 0, sizeof(LCM_PARAMS
));
505 params
->type
= LCM_TYPE_DSI
;
507 params
->width
= FRAME_WIDTH
;
508 params
->height
= FRAME_HEIGHT
;
510 // enable tearing-free
511 params
->dbi
.te_mode
= LCM_DBI_TE_MODE_DISABLED
;
512 params
->dbi
.te_edge_polarity
= LCM_POLARITY_RISING
;
514 #if (LCM_DSI_CMD_MODE)
515 params
->dsi
.mode
= CMD_MODE
;
517 params
->dsi
.mode
= SYNC_PULSE_VDO_MODE
;
521 /* Command mode setting */
522 params
->dsi
.LANE_NUM
= LCM_TWO_LANE
;
523 //The following defined the fomat for data coming from LCD engine.
524 params
->dsi
.data_format
.color_order
= LCM_COLOR_ORDER_RGB
;
525 params
->dsi
.data_format
.trans_seq
= LCM_DSI_TRANS_SEQ_MSB_FIRST
;
526 params
->dsi
.data_format
.padding
= LCM_DSI_PADDING_ON_LSB
;
527 params
->dsi
.data_format
.format
= LCM_DSI_FORMAT_RGB888
;
529 // Highly depends on LCD driver capability.
530 // Not support in MT6573
531 params
->dsi
.packet_size
=256;
533 // Video mode setting
534 params
->dsi
.intermediat_buffer_num
= 2;
536 params
->dsi
.PS
=LCM_PACKED_PS_24BIT_RGB888
;
537 params
->dsi
.word_count
=480*3;
539 params
->dsi
.vertical_sync_active
= 10;
540 params
->dsi
.vertical_backporch
= 10;
541 params
->dsi
.vertical_frontporch
= 10; // 2
542 params
->dsi
.vertical_active_line
= FRAME_HEIGHT
;
544 params
->dsi
.horizontal_sync_active
= 50;
545 params
->dsi
.horizontal_backporch
= 50;
546 params
->dsi
.horizontal_frontporch
= 50;
547 params
->dsi
.horizontal_active_pixel
= FRAME_WIDTH
;
549 params
->dsi
.vertical_sync_active
= 4;
550 params
->dsi
.vertical_backporch
= 17;
551 params
->dsi
.vertical_frontporch
= 17; // 2
552 params
->dsi
.vertical_active_line
= FRAME_HEIGHT
;
554 params
->dsi
.horizontal_sync_active
= 17;
555 params
->dsi
.horizontal_backporch
= 49;
556 params
->dsi
.horizontal_frontporch
= 57;
557 params
->dsi
.horizontal_active_pixel
= FRAME_WIDTH
;
559 // Bit rate calculation
560 params
->dsi
.pll_div1
=28; // fref=26MHz, fvco=fref*(div1+1) (div1=0~63, fvco=500MHZ~1GHz)
561 params
->dsi
.pll_div2
=1; // div2=0~15: fout=fvo/(2*div2)
563 /* ESD or noise interference recovery For video mode LCM only. */
564 // Send TE packet to LCM in a period of n frames and check the response.
565 params
->dsi
.lcm_int_te_monitor
= FALSE
;
566 params
->dsi
.lcm_int_te_period
= 1; // Unit : frames
568 // Need longer FP for more opportunity to do int. TE monitor applicably.
569 if(params
->dsi
.lcm_int_te_monitor
)
570 params
->dsi
.vertical_frontporch
*= 2;
572 // Monitor external TE (or named VSYNC) from LCM once per 2 sec. (LCM VSYNC must be wired to baseband TE pin.)
573 params
->dsi
.lcm_ext_te_monitor
= FALSE
;
574 // Non-continuous clock
575 params
->dsi
.noncont_clock
= TRUE
;
576 params
->dsi
.noncont_clock_period
= 2; // Unit : frames
581 static void lcm_init(void)
583 unsigned char buffer
[10];
584 unsigned int array
[16];
592 #if defined(LCM_TABLE_V3)
593 dsi_set_cmdq_V3(lcm_initialization_setting_V3
, sizeof(lcm_initialization_setting_V3
) / sizeof(LCM_setting_table_V3
), 1);
595 push_table(lcm_initialization_setting
, sizeof(lcm_initialization_setting
) / sizeof(struct LCM_setting_table
), 1);
600 static void lcm_suspend(void)
602 #if defined(LCM_TABLE_V3)
603 dsi_set_cmdq_V3(lcm_deep_sleep_mode_in_setting_V3
, sizeof(lcm_deep_sleep_mode_in_setting_V3
) / sizeof(LCM_setting_table_V3
), 1);
605 push_table(lcm_deep_sleep_mode_in_setting
, sizeof(lcm_deep_sleep_mode_in_setting
) / sizeof(struct LCM_setting_table
), 1);
613 static void lcm_resume(void)
617 #if defined(LCM_TABLE_V3)
618 dsi_set_cmdq_V3(lcm_sleep_out_setting_V3
, sizeof(lcm_sleep_out_setting_V3
) / sizeof(LCM_setting_table_V3
), 1);
620 push_table(lcm_sleep_out_setting
, sizeof(lcm_sleep_out_setting
) / sizeof(struct LCM_setting_table
), 1);
625 static void lcm_update(unsigned int x
, unsigned int y
,
626 unsigned int width
, unsigned int height
)
630 unsigned int x1
= x0
+ width
- 1;
631 unsigned int y1
= y0
+ height
- 1;
633 unsigned char x0_MSB
= ((x0
>>8)&0xFF);
634 unsigned char x0_LSB
= (x0
&0xFF);
635 unsigned char x1_MSB
= ((x1
>>8)&0xFF);
636 unsigned char x1_LSB
= (x1
&0xFF);
637 unsigned char y0_MSB
= ((y0
>>8)&0xFF);
638 unsigned char y0_LSB
= (y0
&0xFF);
639 unsigned char y1_MSB
= ((y1
>>8)&0xFF);
640 unsigned char y1_LSB
= (y1
&0xFF);
642 unsigned int data_array
[16];
644 data_array
[0]= 0x00053902;
645 data_array
[1]= (x1_MSB
<<24)|(x0_LSB
<<16)|(x0_MSB
<<8)|0x2a;
646 data_array
[2]= (x1_LSB
);
647 data_array
[3]= 0x00053902;
648 data_array
[4]= (y1_MSB
<<24)|(y0_LSB
<<16)|(y0_MSB
<<8)|0x2b;
649 data_array
[5]= (y1_LSB
);
650 data_array
[6]= 0x002c3909;
652 dsi_set_cmdq(&data_array
, 7, 0);
657 static void lcm_setbacklight(unsigned int level
)
659 unsigned int default_level
= 145;
660 unsigned int mapped_level
= 0;
662 //for LGE backlight IC mapping table
667 mapped_level
= default_level
+(level
)*(255-default_level
)/(255);
671 // Refresh value of backlight level.
672 lcm_backlight_level_setting
[0].para_list
[0] = mapped_level
;
674 push_table(lcm_backlight_level_setting
, sizeof(lcm_backlight_level_setting
) / sizeof(struct LCM_setting_table
), 1);
678 static void lcm_setpwm(unsigned int divider
)
684 static unsigned int lcm_getpwm(unsigned int divider
)
686 // ref freq = 15MHz, B0h setting 0x80, so 80.6% * freq is pwm_clk;
687 // pwm_clk / 255 / 2(lcm_setpwm() 6th params) = pwm_duration = 23706
688 unsigned int pwm_clk
= 23706 / (1<<divider
);
692 static unsigned int lcm_compare_id(void)
694 unsigned int id1
, id2
;
695 unsigned char buffer
[2];
696 unsigned int array
[16];
698 //push_table(lcm_compare_id_setting, sizeof(lcm_compare_id_setting) / sizeof(struct LCM_setting_table), 1);
701 array
[0] = 0x00013700;// read id return two byte,version and id
702 dsi_set_cmdq(array
, 1, 1);
703 id1
= read_reg(0xDA);
704 id2
= read_reg(0xDB);
706 #if defined(BUILD_UBOOT)
707 printf("%s, id1 = 0x%02x, id2 = 0x%02x \n", __func__
, id1
, id2
);
710 return (LCM_ID1
== id1
&& LCM_ID2
== id2
) ? 1 : 0;
713 LCM_DRIVER hx8369b_dsi_vdo_lcm_drv
=
715 .name
= "hx8369b_dsi_vdo",
716 .set_util_funcs
= lcm_set_util_funcs
,
717 .get_params
= lcm_get_params
,
719 .suspend
= lcm_suspend
,
720 .resume
= lcm_resume
,
721 .compare_id
= lcm_compare_id
,
722 #if (LCM_DSI_CMD_MODE)
723 .update
= lcm_update
,