Advertisement
Serg398

Untitled

Apr 5th, 2016
916
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.49 KB | None | 0 0
  1. #ifndef __LCM_DRV_H__
  2. #define __LCM_DRV_H__
  3.  
  4.  
  5. // ---------------------------------------------------------------------------
  6.  
  7. #ifndef ARY_SIZE
  8. #define ARY_SIZE(x) (sizeof((x)) / sizeof((x[0])))
  9. #endif
  10.  
  11. // ---------------------------------------------------------------------------
  12.  
  13. /* common enumerations */
  14.  
  15. typedef enum
  16. {
  17. LCM_TYPE_DBI = 0,
  18. LCM_TYPE_DPI,
  19. LCM_TYPE_DSI
  20. } LCM_TYPE;
  21.  
  22.  
  23. typedef enum
  24. {
  25. LCM_CTRL_NONE = 0,
  26. LCM_CTRL_SERIAL_DBI,
  27. LCM_CTRL_PARALLEL_DBI,
  28. LCM_CTRL_GPIO
  29. } LCM_CTRL;
  30.  
  31.  
  32. typedef enum
  33. {
  34. LCM_POLARITY_RISING = 0,
  35. LCM_POLARITY_FALLING = 1
  36. } LCM_POLARITY;
  37.  
  38.  
  39. typedef enum
  40. {
  41. LCM_CLOCK_PHASE_0 = 0,
  42. LCM_CLOCK_PHASE_90 = 1
  43. } LCM_CLOCK_PHASE;
  44.  
  45.  
  46. typedef enum
  47. {
  48. LCM_COLOR_ORDER_RGB = 0,
  49. LCM_COLOR_ORDER_BGR = 1
  50. } LCM_COLOR_ORDER;
  51.  
  52.  
  53. typedef enum
  54. {
  55. LCM_DRIVING_CURRENT_8MA = (1 << 0),
  56. LCM_DRIVING_CURRENT_4MA = (1 << 1),
  57. LCM_DRIVING_CURRENT_2MA = (1 << 2),
  58. LCM_DRIVING_CURRENT_SLEW_CNTL = (1 << 3),
  59. LCM_DRIVING_CURRENT_6575_4MA = (1 << 4),
  60. LCM_DRIVING_CURRENT_6575_8MA = (3 << 4),
  61. LCM_DRIVING_CURRENT_6575_12MA = (2 << 4),
  62. LCM_DRIVING_CURRENT_6575_16MA = (4 << 4)
  63. } LCM_DRIVING_CURRENT;
  64.  
  65. typedef enum{
  66. LCM_INTERFACE_NOTDEFINED = 0,
  67. LCM_INTERFACE_DSI0,
  68. LCM_INTERFACE_DSI1,
  69. LCM_INTERFACE_DSI_DUAL,
  70. LCM_INTERFACE_DPI0,
  71. LCM_INTERFACE_DPI1,
  72. LCM_INTERFACE_DBI0
  73. }LCM_INTERFACE_ID;
  74.  
  75. typedef enum{
  76. LCM_IOCTL_NULL = 0,
  77. }LCM_IOCTL;
  78.  
  79. /* DBI related enumerations */
  80.  
  81. typedef enum
  82. {
  83. LCM_DBI_CLOCK_FREQ_104M = 0,
  84. LCM_DBI_CLOCK_FREQ_52M,
  85. LCM_DBI_CLOCK_FREQ_26M,
  86. LCM_DBI_CLOCK_FREQ_13M,
  87. LCM_DBI_CLOCK_FREQ_7M
  88. } LCM_DBI_CLOCK_FREQ;
  89.  
  90.  
  91. typedef enum
  92. {
  93. LCM_DBI_DATA_WIDTH_8BITS = 0,
  94. LCM_DBI_DATA_WIDTH_9BITS = 1,
  95. LCM_DBI_DATA_WIDTH_16BITS = 2,
  96. LCM_DBI_DATA_WIDTH_18BITS = 3,
  97. LCM_DBI_DATA_WIDTH_24BITS = 4,
  98. LCM_DBI_DATA_WIDTH_32BITS = 5
  99. } LCM_DBI_DATA_WIDTH;
  100.  
  101.  
  102. typedef enum
  103. {
  104. LCM_DBI_CPU_WRITE_8_BITS = 8,
  105. LCM_DBI_CPU_WRITE_16_BITS = 16,
  106. LCM_DBI_CPU_WRITE_32_BITS = 32,
  107. } LCM_DBI_CPU_WRITE_BITS;
  108.  
  109.  
  110. typedef enum
  111. {
  112. LCM_DBI_FORMAT_RGB332 = 0,
  113. LCM_DBI_FORMAT_RGB444 = 1,
  114. LCM_DBI_FORMAT_RGB565 = 2,
  115. LCM_DBI_FORMAT_RGB666 = 3,
  116. LCM_DBI_FORMAT_RGB888 = 4
  117. } LCM_DBI_FORMAT;
  118.  
  119.  
  120. typedef enum
  121. {
  122. LCM_DBI_TRANS_SEQ_MSB_FIRST = 0,
  123. LCM_DBI_TRANS_SEQ_LSB_FIRST = 1
  124. } LCM_DBI_TRANS_SEQ;
  125.  
  126.  
  127. typedef enum
  128. {
  129. LCM_DBI_PADDING_ON_LSB = 0,
  130. LCM_DBI_PADDING_ON_MSB = 1
  131. } LCM_DBI_PADDING;
  132.  
  133.  
  134. typedef enum
  135. {
  136. LCM_DBI_TE_MODE_DISABLED = 0,
  137. LCM_DBI_TE_MODE_VSYNC_ONLY = 1,
  138. LCM_DBI_TE_MODE_VSYNC_OR_HSYNC = 2,
  139. } LCM_DBI_TE_MODE;
  140.  
  141.  
  142. typedef enum
  143. {
  144. LCM_DBI_TE_VS_WIDTH_CNT_DIV_8 = 0,
  145. LCM_DBI_TE_VS_WIDTH_CNT_DIV_16 = 1,
  146. LCM_DBI_TE_VS_WIDTH_CNT_DIV_32 = 2,
  147. LCM_DBI_TE_VS_WIDTH_CNT_DIV_64 = 3,
  148. } LCM_DBI_TE_VS_WIDTH_CNT_DIV;
  149.  
  150.  
  151. /* DPI related enumerations */
  152.  
  153. typedef enum
  154. {
  155. LCM_DPI_FORMAT_RGB565 = 0,
  156. LCM_DPI_FORMAT_RGB666 = 1,
  157. LCM_DPI_FORMAT_RGB888 = 2
  158. } LCM_DPI_FORMAT;
  159.  
  160. typedef enum
  161. {
  162. LCM_SERIAL_CLOCK_FREQ_104M = 0,
  163. LCM_SERIAL_CLOCK_FREQ_26M,
  164. LCM_SERIAL_CLOCK_FREQ_52M
  165. } LCM_SERIAL_CLOCK_FREQ;
  166.  
  167. typedef enum
  168. {
  169. LCM_SERIAL_CLOCK_DIV_2 = 0,
  170. LCM_SERIAL_CLOCK_DIV_4 = 1,
  171. LCM_SERIAL_CLOCK_DIV_8 = 2,
  172. LCM_SERIAL_CLOCK_DIV_16 = 3,
  173. } LCM_SERIAL_CLOCK_DIV;
  174.  
  175.  
  176. /* DSI related enumerations */
  177.  
  178. typedef enum
  179. {
  180. CMD_MODE = 0,
  181. SYNC_PULSE_VDO_MODE = 1,
  182. SYNC_EVENT_VDO_MODE = 2,
  183. BURST_VDO_MODE = 3
  184. } LCM_DSI_MODE_CON;
  185.  
  186.  
  187. typedef enum
  188. {
  189. LCM_ONE_LANE = 1,
  190. LCM_TWO_LANE = 2,
  191. LCM_THREE_LANE = 3,
  192. LCM_FOUR_LANE = 4,
  193. } LCM_LANE_NUM;
  194.  
  195.  
  196. typedef enum
  197. {
  198. LCM_DSI_FORMAT_RGB565 = 0,
  199. LCM_DSI_FORMAT_RGB666 = 1,
  200. LCM_DSI_FORMAT_RGB888 = 2
  201. } LCM_DSI_FORMAT;
  202.  
  203.  
  204. typedef enum
  205. {
  206. LCM_DSI_TRANS_SEQ_MSB_FIRST = 0,
  207. LCM_DSI_TRANS_SEQ_LSB_FIRST = 1
  208. } LCM_DSI_TRANS_SEQ;
  209.  
  210.  
  211. typedef enum
  212. {
  213. LCM_DSI_PADDING_ON_LSB = 0,
  214. LCM_DSI_PADDING_ON_MSB = 1
  215. } LCM_DSI_PADDING;
  216.  
  217.  
  218. typedef enum
  219. {
  220. LCM_PACKED_PS_16BIT_RGB565=0,
  221. LCM_LOOSELY_PS_18BIT_RGB666=1,
  222. LCM_PACKED_PS_24BIT_RGB888=2,
  223. LCM_PACKED_PS_18BIT_RGB666=3
  224. } LCM_PS_TYPE;
  225.  
  226. typedef enum
  227. {
  228. LCM_DSI_6589_PLL_CLOCK_NULL = 0,
  229. LCM_DSI_6589_PLL_CLOCK_201_5 = 1,
  230. LCM_DSI_6589_PLL_CLOCK_208 = 2,
  231. LCM_DSI_6589_PLL_CLOCK_214_5 = 3,
  232. LCM_DSI_6589_PLL_CLOCK_221 = 4,
  233. LCM_DSI_6589_PLL_CLOCK_227_5 = 5,
  234. LCM_DSI_6589_PLL_CLOCK_234 = 6,
  235. LCM_DSI_6589_PLL_CLOCK_240_5 = 7,
  236. LCM_DSI_6589_PLL_CLOCK_247 = 8,
  237. LCM_DSI_6589_PLL_CLOCK_253_5 = 9,
  238. LCM_DSI_6589_PLL_CLOCK_260 = 10,
  239. LCM_DSI_6589_PLL_CLOCK_266_5 = 11,
  240. LCM_DSI_6589_PLL_CLOCK_273 = 12,
  241. LCM_DSI_6589_PLL_CLOCK_279_5 = 13,
  242. LCM_DSI_6589_PLL_CLOCK_286 = 14,
  243. LCM_DSI_6589_PLL_CLOCK_292_5 = 15,
  244. LCM_DSI_6589_PLL_CLOCK_299 = 16,
  245. LCM_DSI_6589_PLL_CLOCK_305_5 = 17,
  246. LCM_DSI_6589_PLL_CLOCK_312 = 18,
  247. LCM_DSI_6589_PLL_CLOCK_318_5 = 19,
  248. LCM_DSI_6589_PLL_CLOCK_325 = 20,
  249. LCM_DSI_6589_PLL_CLOCK_331_5 = 21,
  250. LCM_DSI_6589_PLL_CLOCK_338 = 22,
  251. LCM_DSI_6589_PLL_CLOCK_344_5 = 23,
  252. LCM_DSI_6589_PLL_CLOCK_351 = 24,
  253. LCM_DSI_6589_PLL_CLOCK_357_5 = 25,
  254. LCM_DSI_6589_PLL_CLOCK_364 = 26,
  255. LCM_DSI_6589_PLL_CLOCK_370_5 = 27,
  256. LCM_DSI_6589_PLL_CLOCK_377 = 28,
  257. LCM_DSI_6589_PLL_CLOCK_383_5 = 29,
  258. LCM_DSI_6589_PLL_CLOCK_390 = 30,
  259. LCM_DSI_6589_PLL_CLOCK_396_5 = 31,
  260. LCM_DSI_6589_PLL_CLOCK_403 = 32,
  261. LCM_DSI_6589_PLL_CLOCK_409_5 = 33,
  262. LCM_DSI_6589_PLL_CLOCK_416 = 34,
  263. LCM_DSI_6589_PLL_CLOCK_422_5 = 35,
  264. LCM_DSI_6589_PLL_CLOCK_429 = 36,
  265. LCM_DSI_6589_PLL_CLOCK_435_5 = 37,
  266. LCM_DSI_6589_PLL_CLOCK_442 = 38,
  267. LCM_DSI_6589_PLL_CLOCK_448_5 = 39,
  268. LCM_DSI_6589_PLL_CLOCK_455 = 40,
  269. LCM_DSI_6589_PLL_CLOCK_461_5 = 41,
  270. LCM_DSI_6589_PLL_CLOCK_468 = 42,
  271. LCM_DSI_6589_PLL_CLOCK_474_5 = 43,
  272. LCM_DSI_6589_PLL_CLOCK_481 = 44,
  273. LCM_DSI_6589_PLL_CLOCK_487_5 = 45,
  274. LCM_DSI_6589_PLL_CLOCK_494 = 46,
  275. LCM_DSI_6589_PLL_CLOCK_500_5 = 47,
  276. LCM_DSI_6589_PLL_CLOCK_507 = 48,
  277. LCM_DSI_6589_PLL_CLOCK_513_5 = 49,
  278. LCM_DSI_6589_PLL_CLOCK_520 = 50,
  279. } LCM_DSI_PLL_CLOCK;
  280.  
  281. // ---------------------------------------------------------------------------
  282.  
  283. typedef struct
  284. {
  285. LCM_COLOR_ORDER color_order;
  286. LCM_DBI_TRANS_SEQ trans_seq;
  287. LCM_DBI_PADDING padding;
  288. LCM_DBI_FORMAT format;
  289. LCM_DBI_DATA_WIDTH width;
  290. } LCM_DBI_DATA_FORMAT;
  291.  
  292.  
  293. typedef struct
  294. {
  295. LCM_POLARITY cs_polarity;
  296. LCM_POLARITY clk_polarity;
  297. LCM_CLOCK_PHASE clk_phase;
  298. unsigned int is_non_dbi_mode;
  299.  
  300. LCM_SERIAL_CLOCK_FREQ clock_base;
  301. LCM_SERIAL_CLOCK_DIV clock_div;
  302. ////////////////////////////////////MT6575 added params, and if lcm driver is for 6575, only care these below params
  303. unsigned int css;
  304. unsigned int csh;
  305. unsigned int rd_1st;
  306. unsigned int rd_2nd;
  307. unsigned int wr_1st;
  308. unsigned int wr_2nd;
  309.  
  310. unsigned int sif_3wire;
  311. unsigned int sif_sdi;
  312. LCM_POLARITY sif_1st_pol;
  313. LCM_POLARITY sif_sck_def;
  314. unsigned int sif_div2;
  315. unsigned int sif_hw_cs;
  316. ////////////////////////////////////
  317. } LCM_DBI_SERIAL_PARAMS;
  318.  
  319.  
  320. typedef struct
  321. {
  322. /* timing parameters */
  323. unsigned int write_setup;
  324. unsigned int write_hold;
  325. unsigned int write_wait;
  326. unsigned int read_setup;
  327. unsigned int read_hold;
  328. unsigned int read_latency;
  329. unsigned int wait_period;
  330. /*only for 6575*/
  331. unsigned int cs_high_width;
  332. } LCM_DBI_PARALLEL_PARAMS;
  333.  
  334.  
  335. typedef struct
  336. {
  337. LCM_COLOR_ORDER color_order;
  338. LCM_DSI_TRANS_SEQ trans_seq;
  339. LCM_DSI_PADDING padding;
  340. LCM_DSI_FORMAT format;
  341. } LCM_DSI_DATA_FORMAT;
  342.  
  343.  
  344. // ---------------------------------------------------------------------------
  345.  
  346. typedef struct
  347. {
  348. /* common parameters for serial & parallel interface */
  349. unsigned int port;
  350. LCM_DBI_CLOCK_FREQ clock_freq;
  351. LCM_DBI_DATA_WIDTH data_width;
  352. LCM_DBI_DATA_FORMAT data_format;
  353. LCM_DBI_CPU_WRITE_BITS cpu_write_bits;
  354. LCM_DRIVING_CURRENT io_driving_current;
  355.  
  356. /* tearing control */
  357. LCM_DBI_TE_MODE te_mode;
  358. LCM_POLARITY te_edge_polarity;
  359. unsigned int te_hs_delay_cnt;
  360. unsigned int te_vs_width_cnt;
  361. LCM_DBI_TE_VS_WIDTH_CNT_DIV te_vs_width_cnt_div;
  362.  
  363. /* particular parameters for serial & parallel interface */
  364. LCM_DBI_SERIAL_PARAMS serial;
  365. LCM_DBI_PARALLEL_PARAMS parallel;
  366. } LCM_DBI_PARAMS;
  367.  
  368.  
  369. typedef struct
  370. {
  371. /*
  372. Pixel Clock Frequency = 26MHz * mipi_pll_clk_div1
  373. / (mipi_pll_clk_ref + 1)
  374. / (2 * mipi_pll_clk_div2)
  375. / dpi_clk_div
  376. */
  377. unsigned int mipi_pll_clk_ref; // 0..1
  378. unsigned int mipi_pll_clk_div1; // 0..63
  379. unsigned int mipi_pll_clk_div2; // 0..15
  380. unsigned int mipi_pll_clk_fbk_div; //PCLK=> 8: 26MHz, 10: 35MHz, 12: 40MHz
  381. unsigned int dpi_clk_div; // 2..32
  382. unsigned int dpi_clk_duty; // (dpi_clk_div - 1) .. 31
  383. unsigned int PLL_CLOCK;
  384. unsigned int dpi_clock;
  385. unsigned int ssc_disable;
  386. unsigned int ssc_range;
  387.  
  388. /* polarity parameters */
  389. LCM_POLARITY clk_pol;
  390. LCM_POLARITY de_pol;
  391. LCM_POLARITY vsync_pol;
  392. LCM_POLARITY hsync_pol;
  393.  
  394. /* timing parameters */
  395. unsigned int hsync_pulse_width;
  396. unsigned int hsync_back_porch;
  397. unsigned int hsync_front_porch;
  398. unsigned int vsync_pulse_width;
  399. unsigned int vsync_back_porch;
  400. unsigned int vsync_front_porch;
  401.  
  402. /* output format parameters */
  403. LCM_DPI_FORMAT format;
  404. LCM_COLOR_ORDER rgb_order;
  405. unsigned int is_serial_output;
  406. unsigned int i2x_en;
  407. unsigned int i2x_edge;
  408. unsigned int embsync;
  409. unsigned int lvds_tx_en;
  410. /* intermediate buffers parameters */
  411. unsigned int intermediat_buffer_num; // 2..3
  412.  
  413. /* iopad parameters */
  414. LCM_DRIVING_CURRENT io_driving_current;
  415.  
  416. } LCM_DPI_PARAMS;
  417.  
  418.  
  419. // ---------------------------------------------------------------------------
  420. ////lenovo add begin by jixu@lenovo.com
  421. typedef struct
  422. {
  423. /* common parameters */
  424. unsigned char cmd;
  425. unsigned char data;
  426.  
  427. }lcm_reg ;
  428. typedef struct
  429. {
  430. /* common parameters */
  431. int min;
  432. int def;
  433. int max;
  434.  
  435. }LCM_BL_LEVELS;
  436.  
  437. #ifdef LENOVO_BACKLIGHT_LIMIT
  438. #define APP_BL_MIN 1
  439. #define APP_BL_DEFAULT 102
  440. #define APP_BL_MAX 255
  441. #endif
  442.  
  443. ////lenovo add end by jixu@lenovo.com
  444.  
  445. typedef struct
  446. {
  447. LCM_DSI_MODE_CON mode;
  448. unsigned int DSI_WMEM_CONTI;
  449. unsigned int DSI_RMEM_CONTI;
  450. unsigned int VC_NUM;
  451.  
  452. LCM_LANE_NUM LANE_NUM;
  453. LCM_DSI_DATA_FORMAT data_format;
  454.  
  455. /* intermediate buffers parameters */
  456. unsigned int intermediat_buffer_num; // 2..3
  457.  
  458. LCM_PS_TYPE PS;
  459. unsigned int word_count;
  460.  
  461. unsigned int packet_size;
  462.  
  463. unsigned int vertical_sync_active;
  464. unsigned int vertical_backporch;
  465. unsigned int vertical_frontporch;
  466. unsigned int vertical_active_line;
  467.  
  468. unsigned int horizontal_sync_active;
  469. unsigned int horizontal_backporch;
  470. unsigned int horizontal_frontporch;
  471. unsigned int horizontal_blanking_pixel;
  472. unsigned int horizontal_active_pixel;
  473. unsigned int horizontal_bllp;
  474.  
  475. unsigned int line_byte;
  476. unsigned int horizontal_sync_active_byte;
  477. unsigned int horizontal_backporch_byte;
  478. unsigned int horizontal_frontporch_byte;
  479. unsigned int rgb_byte;
  480.  
  481. unsigned int horizontal_sync_active_word_count;
  482. unsigned int horizontal_backporch_word_count;
  483. unsigned int horizontal_frontporch_word_count;
  484.  
  485. unsigned char HS_TRAIL;
  486. unsigned char HS_ZERO;
  487. unsigned char HS_PRPR;
  488. unsigned char LPX;
  489.  
  490. unsigned char TA_SACK;
  491. unsigned char TA_GET;
  492. unsigned char TA_SURE;
  493. unsigned char TA_GO;
  494.  
  495. unsigned char CLK_TRAIL;
  496. unsigned char CLK_ZERO;
  497. unsigned char LPX_WAIT;
  498. unsigned char CONT_DET;
  499.  
  500. unsigned char CLK_HS_PRPR;
  501. unsigned char CLK_HS_POST;
  502. unsigned char DA_HS_EXIT;
  503. unsigned char CLK_HS_EXIT;
  504.  
  505. unsigned int pll_select;
  506. unsigned int pll_div1;
  507. unsigned int pll_div2;
  508. unsigned int fbk_div;
  509. unsigned int fbk_sel;
  510. unsigned int rg_bir;
  511. unsigned int rg_bic;
  512. unsigned int rg_bp;
  513. unsigned int PLL_CLOCK;
  514. unsigned int dsi_clock;
  515. unsigned int ssc_disable;
  516. unsigned int ssc_range;
  517. unsigned int compatibility_for_nvk;
  518. unsigned int cont_clock;
  519. unsigned int ufoe_enable;
  520.  
  521. unsigned int lcm_int_te_monitor;
  522. unsigned int lcm_int_te_period;
  523.  
  524. unsigned int lcm_ext_te_monitor;
  525. unsigned int lcm_ext_te_enable;
  526.  
  527. unsigned int noncont_clock;
  528. unsigned int noncont_clock_period;
  529.  
  530. unsigned int hs_read;//lenovo add by jixu@lenovo.com
  531. } LCM_DSI_PARAMS;
  532.  
  533. // ---------------------------------------------------------------------------
  534.  
  535. typedef struct
  536. {
  537. LCM_TYPE type;
  538. LCM_CTRL ctrl; //! how to control LCM registers
  539. LCM_INTERFACE_ID lcm_if;
  540.  
  541. /* common parameters */
  542. unsigned int width;
  543. unsigned int height;
  544. unsigned int io_select_mode; //DBI or DPI should select IO mode according to chip spec
  545.  
  546. /* particular parameters */
  547. LCM_DBI_PARAMS dbi;
  548. LCM_DPI_PARAMS dpi;
  549. LCM_DSI_PARAMS dsi;
  550. unsigned int physical_width;
  551. unsigned int physical_height;
  552. ////lenovo add begin by jixu@lenovo.com
  553. LCM_BL_LEVELS bl_app;
  554. LCM_BL_LEVELS bl_bsp;
  555. ////lenovo add end by jixu@lenovo.com
  556. } LCM_PARAMS;
  557.  
  558.  
  559. // ---------------------------------------------------------------------------
  560.  
  561. #define REGFLAG_ESCAPE_ID (0x00)
  562. #define REGFLAG_DELAY_MS_V3 (0xFF)
  563.  
  564. typedef struct {
  565. unsigned char id;
  566. unsigned char cmd;
  567. unsigned char count;
  568. unsigned char para_list[128];
  569. } LCM_setting_table_V3;
  570.  
  571. typedef struct
  572. {
  573. void (*set_reset_pin)(unsigned int value);
  574. void (*set_chip_select)(unsigned int value);
  575. int (*set_gpio_out)(unsigned int gpio, unsigned int value);
  576.  
  577. void (*udelay)(unsigned int us);
  578. void (*mdelay)(unsigned int ms);
  579.  
  580. void (*send_cmd)(unsigned int cmd);
  581. void (*send_data)(unsigned int data);
  582. unsigned int (*read_data)(void);
  583.  
  584. void (*dsi_set_cmdq_V3)(LCM_setting_table_V3 *para_list, unsigned int size, unsigned char force_update);
  585. void (*dsi_set_cmdq_V2)(unsigned cmd, unsigned char count, unsigned char *para_list, unsigned char force_update);
  586. void (*dsi_set_cmdq)(unsigned int *pdata, unsigned int queue_size, unsigned char force_update);
  587. void (*dsi_write_cmd)(unsigned int cmd);
  588. void (*dsi_write_regs)(unsigned int addr, unsigned int *para, unsigned int nums);
  589. unsigned int (*dsi_read_reg)(void);
  590. unsigned int (*dsi_dcs_read_lcm_reg)(unsigned char cmd);
  591. unsigned int (*dsi_dcs_read_lcm_reg_v2)(unsigned char cmd, unsigned char *buffer, unsigned char buffer_size);
  592. void (*wait_transfer_done)(void);
  593.  
  594. /** FIXME: GPIO mode should not be configured in lcm driver
  595. REMOVE ME after GPIO customization is done
  596. */
  597. int (*set_gpio_mode)(unsigned int pin, unsigned int mode);
  598. int (*set_gpio_dir)(unsigned int pin, unsigned int dir);
  599. int (*set_gpio_pull_enable)(unsigned int pin, unsigned char pull_en);
  600. void (*dsi_set_cmdq_V4)(unsigned int *pdata, unsigned int queue_size, unsigned char force_update);//lenovo add by jixu@lenovo.com
  601.  
  602. } LCM_UTIL_FUNCS;
  603.  
  604.  
  605. typedef struct
  606. {
  607. const char* name;
  608. void (*set_util_funcs)(const LCM_UTIL_FUNCS *util);
  609. void (*get_params)(LCM_PARAMS *params);
  610.  
  611. void (*init)(void);
  612. void (*suspend)(void);
  613. void (*resume)(void);
  614.  
  615. // for power-on sequence refinement
  616. void (*init_power)(void);
  617. void (*suspend_power)(void);
  618. void (*resume_power)(void);
  619.  
  620. void (*update)(unsigned int x, unsigned int y, unsigned int width, unsigned int height);
  621. unsigned int (*compare_id)(void);
  622.  
  623. ///////////////////////////CABC backlight related function
  624. void (*set_backlight)(unsigned int level);
  625. void (*set_pwm)(unsigned int divider);
  626. unsigned int (*get_pwm)(unsigned int divider);
  627. void (*set_backlight_mode)(unsigned int mode);
  628. ///////////////////////////
  629.  
  630. /////////////ESD_RECOVERY//////////////////////
  631. unsigned int (*esd_check)(void);
  632. unsigned int (*esd_recover)(void);
  633. unsigned int (*check_status)(void);
  634. unsigned int (*ata_check)(unsigned char *buffer);
  635. void (*read_fb)(unsigned char *buffer);
  636. /////////////////////////////////////////////////
  637. ////lenovo add begin by jixu@lenovo.com
  638. void (*set_cabcmode)(unsigned int mode);
  639. void (*get_cabcmode)(unsigned int * mode);
  640. void (*set_inversemode)(unsigned int mode);
  641. void (*get_inversemode)(unsigned int * mode);
  642.  
  643. void (*set_lcm_reg)(lcm_reg *regs);
  644. void (*get_lcm_reg)(lcm_reg *regs);
  645. const char* version;//lenovo jixu add
  646. unsigned int (*get_lcm_version)(void);
  647. unsigned int (*detect_backlight)(void);
  648. ////lenovo add end by jixu@lenovo.com
  649.  
  650. } LCM_DRIVER;
  651.  
  652.  
  653. // ---------------------------------------------------------------------------
  654. // LCM Driver Functions
  655. // ---------------------------------------------------------------------------
  656.  
  657. const LCM_DRIVER* LCM_GetDriver(void);
  658. unsigned char which_lcd_module_triple(void);
  659.  
  660. #endif // __LCM_DRV_H__
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement