热门内容

公众号"MAKE1"

获取行业最新资讯

请扫码添加

专业客服企业微信

高通平台Android 驱动层LCD显示屏驱动移植说明和相关工具

简介

高通平台Android 驱动层LCD显示屏驱动移植说明和相关工具

高通LCD移植有许多的参数,为了移植过程中避免人为的错误,可以使用perl工具利用.xml来生成所需要的LCD配置参数.dtsi和.h文件。

例如执行以下命令后:

src/LINUX/android/device/qcom/common/display/tools$ perl parser.pl panel_r61318a_720p_video.xml panel

 

可以生成dsi-panel-r61318a-720p-video.dtsi和panel_r61318a_720p_video.h文件。

 

LCD移植中的参数及其意义:

mipi传输有3种方式

 

kernel中表现为

长包29模式:

qcom,mdss-dsi-on-command = [

29 01 00 00 00 00 02 B0 00 //其中02表示要传输2个数据,B0是LCD的寄存器,00是要传输的数据

 

长包39模式:

qcom,mdss-dsi-on-command = [

39 01 00 00 00 00 02 B0 00 //其中02表示要传输2个数据,B0是LCD的寄存器,00是要传输的数据

 

短包模式:

qcom,mdss-dsi-on-command = [

05 01 00 00 32 00 02 B0 00 //其中02表示要传输2个数据,B0是LCD的寄存器,00是要传输的数据 32是延时

 

Lk中表现为

长包29模式:

static char r61318a_720p_video_on_cmd0[] = {//其中02表示要传输2个数据,B0是LCD的寄存器,00是要传输的数据

0x02, 0x00, 0x29, 0xC0, //必须对齐,不够的后面用0xFF来填充补齐。

0xB0, 0x00, 0xFF, 0xFF,

};

 

长包39模式:

static char r61318a_720p_video_on_cmd0[] = {

0x02, 0x00, 0x39, 0xC0,

0xB0, 0x00, 0xFF, 0xFF,

};

 

短包模式:

static char r61318a_720p_video_on_cmd0[] = {

0xB0, 0x00, 0x05, 0x80

};

 

mipi中还有个特别的命令(都是16进制):

LCD复位命令:11 29

qcom,mdss-dsi-on-command = [29 01 00 00 96 00 02 11 00 //96是延时

29 01 00 00 78 00 02 29 00];

 

LCD关闭mipi命令:28 10

qcom,mdss-dsi-off-command = [05 01 00 00 32 00 02 28 00 //32是延时

05 01 00 00 78 00 02 10 00];

 

某些LCD IC在写一些寄存器的时候会使用mipi不同的读写方式。例如r61318a,B0以上的寄存器只能使用29的方式来写,

B0一下的寄存器使用39方式来写,然而11 29这样的LCD复位命令只能通过短包方式发送。

 

mipi 命令介绍

• DCS (DisplayCommandSet):DCS是一个标准化的命令集,用于命令模式的显示模组。

• DSI, CSI (DisplaySerialInterface, CameraSerialInterface

• DSI 定义了一个位于处理器和显示模组之间的高速串行接口。

• CSI 定义了一个位于处理器和摄像模组之间的高速串行接口。

 

  1. /* dcs read/write */
  2. #define DTYPE_DCS_WRITE 0x05 /* short write, 0 parameter */
  3. #define DTYPE_DCS_WRITE1 0x15 /* short write, 1 parameter */
  4. #define DTYPE_DCS_READ 0x06 /* read */
  5. #define DTYPE_DCS_LWRITE 0x39 /* long write */
  6.  
  7. /* generic read/write */
  8. #define DTYPE_GEN_WRITE 0x03 /* short write, 0 parameter */
  9. #define DTYPE_GEN_WRITE1 0x13 /* short write, 1 parameter */
  10. #define DTYPE_GEN_WRITE2 0x23 /* short write, 2 parameter */
  11. #define DTYPE_GEN_LWRITE 0x29 /* long write */
  12. #define DTYPE_GEN_READ 0x04 /* long read, 0 parameter */
  13. #define DTYPE_GEN_READ1 0x14 /* long read, 1 parameter */
  14. #define DTYPE_GEN_READ2 0x24 /* long read, 2 parameter */
  15.  
  16. #define DTYPE_TEAR_ON 0x35 /* set tear on */
  17. #define DTYPE_MAX_PKTSIZE 0x37 /* set max packet size */
  18. #define DTYPE_NULL_PKT 0x09 /* null packet, no data */
  19. #define DTYPE_BLANK_PKT 0x19 /* blankiing packet, no data */
  20.  
  21. #define DTYPE_CM_ON 0x02 /* color mode off */
  22. #define DTYPE_CM_OFF 0x12 /* color mode on */
  23. #define DTYPE_PERIPHERAL_OFF 0x22
  24. #define DTYPE_PERIPHERAL_ON 0x32
  25.  
  26. /*
  27. * dcs response
  28. */
  29. #define DTYPE_ACK_ERR_RESP 0x02
  30. #define DTYPE_EOT_RESP 0x08 /* end of tx */
  31. #define DTYPE_GEN_READ1_RESP 0x11 /* 1 parameter, short */
  32. #define DTYPE_GEN_READ2_RESP 0x12 /* 2 parameter, short */
  33. #define DTYPE_GEN_LREAD_RESP 0x1a
  34. #define DTYPE_DCS_LREAD_RESP 0x1c
  35. #define DTYPE_DCS_READ1_RESP 0x21 /* 1 parameter, short */
  36. #define DTYPE_DCS_READ2_RESP 0x22 /* 2 parameter, short */
22
 条评论
相关内容推荐