cpt_clap070wp03xg_wxga_lvds.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591
  1. /* Copyright Statement:
  2. *
  3. * This software/firmware and related documentation ("MediaTek Software") are
  4. * protected under relevant copyright laws. The information contained herein
  5. * is confidential and proprietary to MediaTek Inc. and/or its licensors.
  6. * Without the prior written permission of MediaTek inc. and/or its licensors,
  7. * any reproduction, modification, use or disclosure of MediaTek Software,
  8. * and information contained herein, in whole or in part, shall be strictly prohibited.
  9. */
  10. /* MediaTek Inc. (C) 2015. All rights reserved.
  11. *
  12. * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  13. * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  14. * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
  15. * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
  16. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  17. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
  18. * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
  19. * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
  20. * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
  21. * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
  22. * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
  23. * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
  24. * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
  25. * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
  26. * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
  27. * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
  28. * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
  29. * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
  30. *
  31. * The following software/firmware and/or related documentation ("MediaTek Software")
  32. * have been modified by MediaTek Inc. All revisions are subject to any receiver\'s
  33. * applicable license agreements with MediaTek Inc.
  34. */
  35. #ifndef BUILD_LK
  36. #include <linux/string.h>
  37. #else
  38. #include <string.h>
  39. #endif
  40. #ifdef BUILD_LK
  41. #include <platform/mt_gpio.h>
  42. #include <platform/mt_i2c.h>
  43. #include <platform/mt_pmic.h>
  44. #elif (defined BUILD_UBOOT)
  45. #include <asm/arch/mt6577_gpio.h>
  46. #else
  47. #include <mach/mt_gpio.h>
  48. #include <mach/mt_pm_ldo.h>
  49. #include "sn65dsi83_i2c.h"
  50. #endif
  51. #include "lcm_drv.h"
  52. #define LVDS_PANEL_8BITS_SUPPORT
  53. #define SN65DSI83_PATTERN
  54. /* --------------------------------------------------------------------------- */
  55. /* Local Constants */
  56. /* --------------------------------------------------------------------------- */
  57. #define FRAME_WIDTH (800)
  58. #define FRAME_HEIGHT (1280)
  59. /* GPIO119 VDD33_LCD */
  60. #ifdef GPIO_LCM_PWR_EN
  61. #define GPIO_LCD_PWR_EN GPIO_LCM_PWR_EN
  62. #else
  63. #define GPIO_LCD_PWR_EN 0xFFFFFFFF
  64. #endif
  65. /* GPIO113 VDD18_LVDS for SN65DSI83 power */
  66. #ifdef GPIO_LCM_PWR2_EN
  67. #define GPIO_LCD_PWR2_EN GPIO_LCM_PWR2_EN
  68. #else
  69. #define GPIO_LCD_PWR2_EN 0xFFFFFFFF
  70. #endif
  71. /* GPIO118 AVDDVGH/VGL/VCOM for panel power */
  72. #ifdef GPIO_LCM_PWR
  73. #define GPIO_LCD_PWR GPIO_LCM_PWR
  74. #else
  75. #define GPIO_LCD_PWR 0xFFFFFFFF
  76. #endif
  77. /* GPIO112 LVDS_EN_R for SN65DSI83 */
  78. #ifdef GPIO_LCM_BRIDGE_EN
  79. #define GPIO_LCD_BRIDGE_EN GPIO_LCM_BRIDGE_EN
  80. #else
  81. #define GPIO_LCD_BRIDGE_EN 0xFFFFFFFF
  82. #endif
  83. #define SN65DSI_DEBUG //for check system(bb dsi and ti chip) status
  84. /* --------------------------------------------------------------------------- */
  85. /* Local Variables */
  86. /* --------------------------------------------------------------------------- */
  87. static LCM_UTIL_FUNCS lcm_util = {
  88. .set_reset_pin = NULL,
  89. .udelay = NULL,
  90. .mdelay = NULL,
  91. };
  92. #define SET_RESET_PIN(v) (mt_set_reset_pin((v)))
  93. #define UDELAY(n) (lcm_util.udelay(n))
  94. #define MDELAY(n) (lcm_util.mdelay(n))
  95. #define REGFLAG_DELAY 0xAB
  96. typedef unsigned char kal_uint8;
  97. typedef struct {
  98. unsigned char cmd;
  99. unsigned char data;
  100. } sn65dsi8x_setting_table;
  101. /* --------------------------------------------------------------------------- */
  102. /* Local Functions */
  103. /* --------------------------------------------------------------------------- */
  104. extern void DSI_clk_HS_mode(bool enter);
  105. #ifdef BUILD_LK
  106. #define sn65dsi83_SLAVE_ADDR_WRITE 0x58
  107. #define SN65DSI83_I2C_ID I2C0
  108. static struct mt_i2c_t sn65dsi83_i2c;
  109. /**********************************************************
  110. *
  111. * [I2C Function For Read/Write fan5405]
  112. *
  113. *********************************************************/
  114. kal_uint32 sn65dsi83_write_byte(kal_uint8 addr, kal_uint8 value)
  115. {
  116. kal_uint32 ret_code = I2C_OK;
  117. kal_uint8 write_data[2];
  118. kal_uint16 len;
  119. write_data[0]= addr;
  120. write_data[1] = value;
  121. sn65dsi83_i2c.id = SN65DSI83_I2C_ID;
  122. /* Since i2c will left shift 1 bit, we need to set SN65DSI83 I2C address to >>1 */
  123. sn65dsi83_i2c.addr = (sn65dsi83_SLAVE_ADDR_WRITE >> 1);
  124. sn65dsi83_i2c.mode = ST_MODE;
  125. sn65dsi83_i2c.speed = 100;
  126. len = 2;
  127. ret_code = i2c_write(&sn65dsi83_i2c, write_data, len);
  128. return ret_code;
  129. }
  130. kal_uint32 sn65dsi83_read_byte (kal_uint8 addr, kal_uint8 *dataBuffer)
  131. {
  132. kal_uint32 ret_code = I2C_OK;
  133. kal_uint16 len;
  134. *dataBuffer = addr;
  135. sn65dsi83_i2c.id = SN65DSI83_I2C_ID;
  136. /* Since i2c will left shift 1 bit, we need to set SN65DSI83 I2C address to >>1 */
  137. sn65dsi83_i2c.addr = (sn65dsi83_SLAVE_ADDR_WRITE >> 1);
  138. sn65dsi83_i2c.mode = ST_MODE;
  139. sn65dsi83_i2c.speed = 100;
  140. len = 1;
  141. ret_code = i2c_write_read(&sn65dsi83_i2c, dataBuffer, len, len);
  142. return ret_code;
  143. }
  144. /******************************************************************************
  145. *IIC drvier,:protocol type 2 add by chenguangjian end
  146. ******************************************************************************/
  147. #else
  148. extern int sn65dsi83_read_byte(kal_uint8 cmd, kal_uint8 *returnData);
  149. extern int sn65dsi83_write_byte(kal_uint8 cmd, kal_uint8 Data);
  150. #endif
  151. /* sn65dis83 chip init table */
  152. static sn65dsi8x_setting_table sn65dis83_init_table[] = {
  153. #if defined(LVDS_PANEL_8BITS_SUPPORT)
  154. #if 0
  155. {0x09, 0x00},
  156. {0x0A, 0x05},
  157. {0x0B, 0x10},
  158. {0x0D, 0x00},
  159. {0x10, 0x26},
  160. {0x11, 0x00},
  161. {0x12, 0x2c},
  162. {0x13, 0x00},
  163. {0x18, 0x78},
  164. {0x19, 0x00},
  165. {0x1A, 0x03},
  166. {0x1B, 0x00},
  167. {0x20, 0x20},
  168. {0x21, 0x03},
  169. {0x22, 0x00},
  170. {0x23, 0x00},
  171. {0x24, 0x00},
  172. {0x25, 0x05}, // 0x00
  173. {0x26, 0x00},
  174. {0x27, 0x00},
  175. {0x28, 0x21},
  176. {0x29, 0x00},
  177. {0x2A, 0x00},
  178. {0x2B, 0x00},
  179. {0x2C, 0x0a},
  180. {0x2D, 0x00},
  181. {0x2E, 0x00},
  182. {0x2F, 0x00},
  183. {0x30, 0x02},
  184. {0x31, 0x00},
  185. {0x32, 0x00},
  186. {0x33, 0x00},
  187. {0x34, 0x18},
  188. {0x35, 0x00},
  189. {0x36, 0x02}, // 0x00
  190. {0x37, 0x00},
  191. {0x38, 0x1e}, // 0x00
  192. {0x39, 0x00},
  193. {0x3A, 0x04}, // 0x00
  194. {0x3B, 0x00},
  195. {0x3C, 0x10}, // 0x00
  196. {0x3D, 0x00},
  197. {0x3E, 0x00},
  198. {0x0D, 0x01},
  199. {REGFLAG_DELAY, 0x0a},
  200. {0x09, 0x01},
  201. {0xFF, 0x00},
  202. #else
  203. {0x09, 0x00},
  204. {0x0A, 0x05},
  205. {0x0B, 0x10},
  206. {0x0D, 0x00},
  207. {0x10, 0x26},
  208. {0x11, 0x00},
  209. {0x12, 0x2c},
  210. {0x13, 0x00},
  211. {0x18, 0x78},
  212. {0x19, 0x00},
  213. {0x1A, 0x03},
  214. {0x1B, 0x00},
  215. {0x20, 0x20},
  216. {0x21, 0x03},
  217. {0x22, 0x00},
  218. {0x23, 0x00},
  219. {0x24, 0x00},
  220. {0x25, 0x00}, // 0x00
  221. {0x26, 0x00},
  222. {0x27, 0x00},
  223. {0x28, 0x21},
  224. {0x29, 0x00},
  225. {0x2A, 0x00},
  226. {0x2B, 0x00},
  227. {0x2C, 0x0a},
  228. {0x2D, 0x00},
  229. {0x2E, 0x00},
  230. {0x2F, 0x00},
  231. {0x30, 0x02},
  232. {0x31, 0x00},
  233. {0x32, 0x00},
  234. {0x33, 0x00},
  235. {0x34, 0x18},
  236. {0x35, 0x00},
  237. {0x36, 0x00}, // 0x00
  238. {0x37, 0x00},
  239. {0x38, 0x00}, // 0x00
  240. {0x39, 0x00},
  241. {0x3A, 0x00}, // 0x00
  242. {0x3B, 0x00},
  243. {0x3C, 0x00}, // 0x00
  244. {0x3D, 0x00},
  245. {0x3E, 0x00},
  246. {0x0D, 0x01},
  247. {REGFLAG_DELAY, 0x0a},
  248. {0x09, 0x01},
  249. {0xFF, 0x00},
  250. #endif
  251. #endif
  252. };
  253. static void push_table(sn65dsi8x_setting_table *table, unsigned int count)
  254. {
  255. unsigned int i;
  256. for (i = 0; i < count; i++) {
  257. unsigned cmd;
  258. cmd = table[i].cmd;
  259. switch (cmd) {
  260. case REGFLAG_DELAY:
  261. MDELAY(table[i].data);
  262. break;
  263. case 0xFF:
  264. break;
  265. default:
  266. #ifdef BUILD_LK
  267. sn65dsi83_write_byte(cmd, table[i].data);
  268. #else
  269. sn65dsi83_write_byte(cmd, table[i].data);
  270. #endif
  271. }
  272. }
  273. }
  274. #ifdef SN65DSI_DEBUG
  275. static void dump_reg_table(sn65dsi8x_setting_table *table, unsigned int count)
  276. {
  277. unsigned int i;
  278. unsigned char data;
  279. for (i = 0; i < count; i++) {
  280. unsigned cmd;
  281. cmd = table[i].cmd;
  282. switch (cmd) {
  283. case REGFLAG_DELAY:
  284. MDELAY(table[i].data);
  285. break;
  286. case 0xFF:
  287. break;
  288. default:
  289. #ifdef BUILD_LK
  290. sn65dsi83_read_byte(cmd,&data);
  291. printf("dump cmd=0x%x data=0x%x \n",cmd,data);
  292. #else
  293. sn65dsi83_read_byte(cmd,&data);
  294. printk("dump cmd=0x%x data=0x%x \n",cmd,data);
  295. #endif
  296. }
  297. }
  298. }
  299. #endif
  300. void init_sn65dsi8x(void)
  301. {
  302. #ifdef SN65DSI_DEBUG
  303. unsigned char data;
  304. #endif
  305. push_table(sn65dis83_init_table,
  306. sizeof(sn65dis83_init_table) / sizeof(sn65dsi8x_setting_table));
  307. #ifdef SN65DSI_DEBUG
  308. sn65dsi83_write_byte(0xe0,1);
  309. sn65dsi83_write_byte(0xe1,0xff);
  310. MDELAY(5);
  311. sn65dsi83_read_byte(0xe5, &data);
  312. #ifdef BUILD_LK
  313. printf("dump cmd=0xe5 data=0x%x \n",data);
  314. #else
  315. printk("dump cmd=0xe5 data=0x%x \n",data);
  316. #endif
  317. dump_reg_table(sn65dis83_init_table,
  318. sizeof(sn65dis83_init_table) / sizeof(sn65dsi8x_setting_table));
  319. #endif
  320. }
  321. /* --------------------------------------------------------------------------- */
  322. /* LCM Driver Implementations */
  323. /* --------------------------------------------------------------------------- */
  324. static void lcm_set_util_funcs(const LCM_UTIL_FUNCS *util)
  325. {
  326. memcpy(&lcm_util, util, sizeof(LCM_UTIL_FUNCS));
  327. }
  328. static void lcm_get_params(LCM_PARAMS *params)
  329. {
  330. memset(params, 0, sizeof(LCM_PARAMS));
  331. params->type = LCM_TYPE_DSI;
  332. params->width = FRAME_WIDTH;
  333. params->height = FRAME_HEIGHT;
  334. params->dsi.mode = SYNC_EVENT_VDO_MODE;
  335. /* DSI */
  336. /* Command mode setting */
  337. params->dsi.LANE_NUM = LCM_FOUR_LANE;
  338. /* The following defined the fomat for data coming from LCD engine. */
  339. #if defined(LVDS_PANEL_8BITS_SUPPORT)
  340. //params->dsi.data_format.format = LCM_DSI_FORMAT_RGB888;
  341. params->dsi.data_format.format = LCM_DSI_FORMAT_RGB666;
  342. #else
  343. params->dsi.data_format.format = LCM_DSI_FORMAT_RGB666;
  344. #endif
  345. params->dsi.word_count=FRAME_WIDTH*3;
  346. params->dsi.vertical_sync_active = 2;
  347. params->dsi.vertical_backporch = 2;
  348. params->dsi.vertical_frontporch = 4;
  349. params->dsi.vertical_active_line = FRAME_HEIGHT;
  350. params->dsi.horizontal_sync_active =10;
  351. params->dsi.horizontal_backporch = 24;
  352. params->dsi.horizontal_frontporch = 30;
  353. params->dsi.horizontal_active_pixel = FRAME_WIDTH;
  354. #if defined(LVDS_PANEL_8BITS_SUPPORT)
  355. //params->dsi.PS=LCM_PACKED_PS_24BIT_RGB888;
  356. params->dsi.PS = LCM_PACKED_PS_18BIT_RGB666;
  357. #else
  358. params->dsi.PS=LCM_PACKED_PS_18BIT_RGB666;
  359. #endif
  360. params->dsi.pll_select = 0; /* 0: MIPI_PLL; 1: LVDS_PLL */
  361. params->dsi.PLL_CLOCK = 224;
  362. params->dsi.cont_clock = 1;
  363. }
  364. static void lcm_set_gpio_output(unsigned int GPIO, unsigned int output)
  365. {
  366. if (GPIO == 0xFFFFFFFF) {
  367. #ifdef BUILD_LK
  368. printf("[LK/LCM] GPIO_LCD_PWR_EN = 0x%x\n",GPIO_LCD_PWR_EN);
  369. printf("[LK/LCM] GPIO_LCD_PWR2_EN = 0x%x \n",GPIO_LCD_PWR2_EN);
  370. printf("[LK/LCM] GPIO_LCD_PWR = 0x%x \n",GPIO_LCD_PWR);
  371. printf("[LK/LCM] GPIO_LCD_BRIDGE_EN = 0x%x \n",GPIO_LCD_BRIDGE_EN);
  372. #elif (defined BUILD_UBOOT) /* do nothing in uboot */
  373. #else
  374. #endif
  375. return;
  376. }
  377. mt_set_gpio_mode(GPIO, GPIO_MODE_00);
  378. mt_set_gpio_dir(GPIO, GPIO_DIR_OUT);
  379. mt_set_gpio_out(GPIO, (output>0)? GPIO_OUT_ONE: GPIO_OUT_ZERO);
  380. }
  381. static void lcm_init(void)
  382. {
  383. #ifdef BUILD_LK
  384. printf("[LK/LCM]lcm_init \n");
  385. /* step1: sn65dsi8x enbable and init */
  386. /* GPIO42 VDD18_LVDS for SN65DSI83 power */
  387. lcm_set_gpio_output(GPIO_LCD_PWR2_EN, GPIO_OUT_ONE);
  388. MDELAY(20);
  389. /* GPIO127 LVDS_EN_R for SN65DSI83 */
  390. lcm_set_gpio_output(GPIO_LCD_BRIDGE_EN, GPIO_OUT_ONE);
  391. MDELAY(5);
  392. lcm_set_gpio_output(GPIO_LCD_BRIDGE_EN, GPIO_OUT_ZERO);
  393. MDELAY(20);
  394. lcm_set_gpio_output(GPIO_LCD_BRIDGE_EN, GPIO_OUT_ONE);
  395. MDELAY(50);
  396. DSI_clk_HS_mode(1);
  397. MDELAY(5);
  398. init_sn65dsi8x();
  399. MDELAY(10);
  400. /* step 2 :lvds lcd init */
  401. /* GPIO119 VDD33_LCD */
  402. lcm_set_gpio_output(GPIO_LCD_PWR_EN, GPIO_OUT_ONE);
  403. MDELAY(50);
  404. /* GPIO118 AVDDVGH/VGL/VCOM for panel power */
  405. lcm_set_gpio_output(GPIO_LCD_PWR, GPIO_OUT_ONE);
  406. MDELAY(50);
  407. #elif (defined BUILD_UBOOT)
  408. #else
  409. printk("[Kernel/LCM]lcm_init \n");
  410. DSI_clk_HS_mode(1);
  411. #endif
  412. }
  413. static void lcm_suspend(void)
  414. {
  415. #ifdef BUILD_LK
  416. printf("[LK/LCM]lcm_suspend enter \n");
  417. #else
  418. unsigned char temp;
  419. printk("[Kernel/LCM]lcm_suspend enter \n");
  420. lcm_set_gpio_output(GPIO_LCD_PWR2_EN, GPIO_OUT_ZERO);
  421. MDELAY(30); /* avoid LCD resume transint */
  422. /* step 1 power down lvds lcd */
  423. lcm_set_gpio_output(GPIO_LCD_BRIDGE_EN, GPIO_OUT_ZERO);
  424. MDELAY(10);
  425. lcm_set_gpio_output(GPIO_LCD_PWR_EN, GPIO_OUT_ZERO); /* LCMBIASON :VGH VHL */
  426. MDELAY(20);
  427. lcm_set_gpio_output(GPIO_LCD_PWR, GPIO_OUT_ZERO); /* LCM VCC :enable LCD VCC */
  428. MDELAY(20);
  429. /* step 2 suspend sn65dsi8x */
  430. sn65dsi83_read_byte(0x0a, &temp); /* for test wether ti lock the pll clok */
  431. printk("lcm_suspend 0x0a value=0x%x \n",temp);
  432. sn65dsi83_read_byte(0x0d,&temp);
  433. printk("lcm_suspend 0x0d value=0x%x \n",temp);
  434. sn65dsi83_write_byte(0x0d, (temp & 0xfe)); /* set bit0: 0 */
  435. /* step 3 set dsi LP mode */
  436. DSI_clk_HS_mode(0);
  437. #endif
  438. }
  439. static void lcm_resume(void)
  440. {
  441. #ifdef BUILD_LK
  442. printf("[LK/LCM]lcm_resume enter\n");
  443. #else
  444. #ifdef SN65DSI_DEBUG
  445. unsigned char temp;
  446. #endif
  447. printk("[Kernel/LCM]lcm_resume enter \n");
  448. DSI_clk_HS_mode(1);
  449. MDELAY(50);
  450. /* step 1 resume sn65dsi8x */
  451. lcm_set_gpio_output(GPIO_LCD_PWR2_EN, GPIO_OUT_ONE);
  452. MDELAY(10);
  453. lcm_set_gpio_output(GPIO_LCD_BRIDGE_EN, GPIO_OUT_ONE);
  454. MDELAY(5);
  455. lcm_set_gpio_output(GPIO_LCD_BRIDGE_EN, GPIO_OUT_ZERO);
  456. MDELAY(20);
  457. lcm_set_gpio_output(GPIO_LCD_BRIDGE_EN, GPIO_OUT_ONE);
  458. MDELAY(10);
  459. init_sn65dsi8x();
  460. MDELAY(10);
  461. #ifdef SN65DSI_DEBUG
  462. sn65dsi83_read_byte(0x0a,&temp);
  463. printk("lcm_resume cmd-- 0x0a=0x%x \n",temp);
  464. sn65dsi83_read_byte(0x0d,&temp);
  465. printk("lcm_resume cmd-- 0x0d=0x%x \n",temp);
  466. sn65dsi83_read_byte(0x09,&temp);
  467. printk("lcm_resume cmd-- 0x09=0x%x \n",temp);
  468. #endif
  469. /* step 2 :lvds lcd init */
  470. /* GPIO119 VDD33_LCD */
  471. lcm_set_gpio_output(GPIO_LCD_PWR_EN, GPIO_OUT_ONE);
  472. MDELAY(50);
  473. /* GPIO118 AVDDVGH/VGL/VCOM for panel power */
  474. lcm_set_gpio_output(GPIO_LCD_PWR, GPIO_OUT_ONE);
  475. MDELAY(50);
  476. #endif
  477. }
  478. static unsigned int lcm_compare_id(void)
  479. {
  480. #if defined(BUILD_LK)
  481. printf("Sn65dsi83 lcm_compare_id enter \n");
  482. #endif
  483. return 1;
  484. }
  485. LCM_DRIVER cpt_clap070wp03xg_wxga_lvds_lcm_drv = {
  486. .name = "cpt_clap070wp03xg_wxga_lvds",
  487. .set_util_funcs = lcm_set_util_funcs,
  488. .get_params = lcm_get_params,
  489. .init = lcm_init,
  490. .suspend = lcm_suspend,
  491. .resume = lcm_resume,
  492. .compare_id = lcm_compare_id,
  493. };