Dingoo A320 ⇒ Dingux

移植S6D04M0X21驅動程式


有了移植ILI9340驅動程式的經驗之後,對於2.8吋 IPS S6D04M0X21就容易多了,一樣只須修改Dingux屏幕初始化的程式就可以,如下說明:

diff jz4740_slcd_orgi.h jz4740_slcd.h
33a34,318
> 
> #ifdef CONFIG_JZ_SLCD_A320_S6D04M0X21
> #define PIN_RS_N  (32*2+19)  /* Port 2 pin 19: RS# (register select, active low) */
> #define PIN_CS_N  (32*1+17)  /* Port 1 pin 17: CS# (chip select, active low) */
> #define PIN_RESET_N  (32*1+18)  /* Port 1 pin 18: RESET# (reset, active low) */
> 
> #define  __slcd_special_pin_init()  \
> do {          \
>   __gpio_as_output(PIN_RS_N);  \
>   __gpio_set_pin(PIN_RS_N);  \
>   __gpio_as_output(PIN_CS_N);  \
>   __gpio_set_pin(PIN_CS_N);  \
>   __gpio_as_output(PIN_RESET_N);  \
>   __gpio_clear_pin(PIN_RESET_N);  \
> } while(0)
> 
> #define __slcd_special_on()     \
> do {          \
>   /* RESET pulse */    \
>   __gpio_clear_pin(PIN_RESET_N);  \
>   mdelay(10);      \
>   __gpio_set_pin(PIN_RESET_N);  \
>   mdelay(50);      \
>           \
>   /* Enable chip select */  \
>   __gpio_clear_pin(PIN_CS_N);  \
>           \
>   /* Black magic */    \
>   mdelay(120); \
>   Mcupanel_Command(0x0001); \
>   mdelay(120); \
>   Mcupanel_Command(0x00f0); \
>   Mcupanel_Data(0x005a); \
>   Mcupanel_Data(0x005a); \
>   Mcupanel_Command(0x00f3); \
>   Mcupanel_Data(0x0000); \
>   Mcupanel_Command(0x00ff); \
>   Mcupanel_Data(0x0030); \
>   Mcupanel_Data(0x0000); \
>   Mcupanel_Data(0x0000); \
>   Mcupanel_Data(0x0040); \
>   Mcupanel_Command(0x0011); \
>   mdelay(120); \
>   Mcupanel_Command(0x00f3); \
>   Mcupanel_Data(0x0001); \
>   Mcupanel_Data(0x0026); \
>   Mcupanel_Data(0x0026); \
>   Mcupanel_Data(0x0007); \
>   Mcupanel_Data(0x0011); \
>   Mcupanel_Data(0x0057); \
>   Mcupanel_Data(0x0057); \
>   Mcupanel_Data(0x002c); \
>   Mcupanel_Command(0x00f4); \
>   Mcupanel_Data(0x0060); \
>   Mcupanel_Data(0x0060); \
>   Mcupanel_Data(0x006F); \
>   Mcupanel_Data(0x006F); \
>   Mcupanel_Data(0x0044); \
>   Mcupanel_Command(0x00f5); \
>   Mcupanel_Data(0x0012); \
>   Mcupanel_Data(0x0011); \
>   Mcupanel_Data(0x0003); \
>   Mcupanel_Data(0x00f0); \
>   Mcupanel_Data(0x0030); \
>   Mcupanel_Data(0x001f); \
>   mdelay(10); \
>   Mcupanel_Command(0x00f3); \
>   Mcupanel_Data(0x0003); \
>   mdelay(20); \
>   Mcupanel_Command(0x00ff); \
>   Mcupanel_Data(0x0030); \
>   Mcupanel_Data(0x0000); \
>   Mcupanel_Data(0x0000); \
>   Mcupanel_Data(0x0070); \
>   mdelay(20); \
>   Mcupanel_Command(0x00f3); \
>   Mcupanel_Data(0x000f); \
>   Mcupanel_Command(0x00ff); \
>   Mcupanel_Data(0x0030); \
>   Mcupanel_Data(0x0000); \
>   Mcupanel_Data(0x0000); \
>   Mcupanel_Data(0x0078); \
>   mdelay(20); \
>   Mcupanel_Command(0x00f3); \
>   Mcupanel_Data(0x001f); \
>   Mcupanel_Command(0x00ff); \
>   Mcupanel_Data(0x0000); \
>   Mcupanel_Data(0x0000); \
>   Mcupanel_Data(0x0000); \
>   Mcupanel_Data(0x0078); \
>   mdelay(20); \
>   Mcupanel_Command(0x00f3); \
>   Mcupanel_Data(0x001f); \
>   mdelay(40); \
>   Mcupanel_Command(0x00f3); \
>   Mcupanel_Data(0x00ff); \
>   Mcupanel_Data(0x0026); \
>   Mcupanel_Data(0x0026); \
>   Mcupanel_Data(0x0007); \
>   Mcupanel_Data(0x0055); \
>   Mcupanel_Data(0x0057); \
>   Mcupanel_Data(0x0057); \
>   Mcupanel_Data(0x002c); \
>   mdelay(50); \
>   Mcupanel_Command(0x0011); \
>   mdelay(100); \
>   Mcupanel_Command(0x00f2); \
>   Mcupanel_Data(0x0013); \
>   Mcupanel_Data(0x0013); \
>   Mcupanel_Data(0x0001); \
>   Mcupanel_Data(0x0008); \
>   Mcupanel_Data(0x0008); \
>   Mcupanel_Data(0x0008); \
>   Mcupanel_Data(0x0008); \
>   Mcupanel_Data(0x0010); \
>   Mcupanel_Data(0x0000); \
>   Mcupanel_Data(0x0010); \
>   Mcupanel_Data(0x0010); \
>   Mcupanel_Command(0x00fd); \
>   Mcupanel_Data(0x0055); \
>   Mcupanel_Command(0x0035); \
>   Mcupanel_Data(0x0000); \
>   Mcupanel_Command(0x0036); \
>   Mcupanel_Data(0x00e8); \
>   Mcupanel_Command(0x003a); \
>   Mcupanel_Data(0x0055); \
>   Mcupanel_Command(0x00fe); \
>   Mcupanel_Data(0x0016); \
>   Mcupanel_Data(0x0016); \
>   Mcupanel_Data(0x0028); \
>   Mcupanel_Data(0x0000); \
>   Mcupanel_Data(0x0000); \
>   Mcupanel_Data(0x0006); \
>   Mcupanel_Command(0x00f6); \
>   Mcupanel_Data(0x0010); \
>   Mcupanel_Data(0x0080); \
>   Mcupanel_Data(0x0000); \
>   Mcupanel_Data(0x0010); \
>   Mcupanel_Command(0x0051); \
>   Mcupanel_Data(0x00ff); \
>   Mcupanel_Command(0x0053); \
>   Mcupanel_Data(0x0000); \
>   Mcupanel_Command(0x0055); \
>   Mcupanel_Data(0x0000); \
>   Mcupanel_Command(0x005e); \
>   Mcupanel_Data(0x0000); \
>   Mcupanel_Command(0x00ca); \
>   Mcupanel_Data(0x0080); \
>   Mcupanel_Data(0x0080); \
>   Mcupanel_Data(0x0020); \
>   Mcupanel_Command(0x00cb); \
>   Mcupanel_Data(0x0001); \
>   Mcupanel_Command(0x00f7); \
>   Mcupanel_Data(0x0092); \
>   Mcupanel_Data(0x001a); \
>   Mcupanel_Data(0x001e); \
>   Mcupanel_Data(0x001a); \
>   Mcupanel_Data(0x001d); \
>   Mcupanel_Data(0x001d); \
>   Mcupanel_Data(0x001e); \
>   Mcupanel_Data(0x0026); \
>   Mcupanel_Data(0x001c); \
>   Mcupanel_Data(0x001c); \
>   Mcupanel_Data(0x0024); \
>   Mcupanel_Data(0x001b); \
>   Mcupanel_Data(0x0009); \
>   Mcupanel_Data(0x0011); \
>   Mcupanel_Data(0x0018); \
>   Mcupanel_Command(0x00f8); \
>   Mcupanel_Data(0x001a); \
>   Mcupanel_Data(0x0000); \
>   Mcupanel_Data(0x001e); \
>   Mcupanel_Data(0x001a); \
>   Mcupanel_Data(0x001d); \
>   Mcupanel_Data(0x001a); \
>   Mcupanel_Data(0x001d); \
>   Mcupanel_Data(0x0024); \
>   Mcupanel_Data(0x001e); \
>   Mcupanel_Data(0x001f); \
>   Mcupanel_Data(0x0027); \
>   Mcupanel_Data(0x001e); \
>   Mcupanel_Data(0x000a); \
>   Mcupanel_Data(0x0011); \
>   Mcupanel_Data(0x0011); \
>   Mcupanel_Command(0x00f9); \
>   Mcupanel_Data(0x0086); \
>   Mcupanel_Data(0x001a); \
>   Mcupanel_Data(0x0010); \
>   Mcupanel_Data(0x0010); \
>   Mcupanel_Data(0x001d); \
>   Mcupanel_Data(0x001b); \
>   Mcupanel_Data(0x001f); \
>   Mcupanel_Data(0x0027); \
>   Mcupanel_Data(0x001b); \
>   Mcupanel_Data(0x001f); \
>   Mcupanel_Data(0x0027); \
>   Mcupanel_Data(0x001e); \
>   Mcupanel_Data(0x000a); \
>   Mcupanel_Data(0x0011); \
>   Mcupanel_Data(0x0018); \
>   Mcupanel_Command(0x00fa); \
>   Mcupanel_Data(0x001a); \
>   Mcupanel_Data(0x0000); \
>   Mcupanel_Data(0x001e); \
>   Mcupanel_Data(0x001a); \
>   Mcupanel_Data(0x001d); \
>   Mcupanel_Data(0x001a); \
>   Mcupanel_Data(0x001d); \
>   Mcupanel_Data(0x0024); \
>   Mcupanel_Data(0x001e); \
>   Mcupanel_Data(0x001f); \
>   Mcupanel_Data(0x0027); \
>   Mcupanel_Data(0x001e); \
>   Mcupanel_Data(0x000a); \
>   Mcupanel_Data(0x0011); \
>   Mcupanel_Data(0x0011); \
>   Mcupanel_Command(0x00fb); \
>   Mcupanel_Data(0x0080); \
>   Mcupanel_Data(0x001a); \
>   Mcupanel_Data(0x001e); \
>   Mcupanel_Data(0x001a); \
>   Mcupanel_Data(0x001d); \
>   Mcupanel_Data(0x001b); \
>   Mcupanel_Data(0x001e); \
>   Mcupanel_Data(0x0026); \
>   Mcupanel_Data(0x0017); \
>   Mcupanel_Data(0x001a); \
>   Mcupanel_Data(0x001d); \
>   Mcupanel_Data(0x0014); \
>   Mcupanel_Data(0x0000); \
>   Mcupanel_Data(0x0011); \
>   Mcupanel_Data(0x0018); \
>   Mcupanel_Command(0x00fc); \
>   Mcupanel_Data(0x001a); \
>   Mcupanel_Data(0x0000); \
>   Mcupanel_Data(0x001e); \
>   Mcupanel_Data(0x001a); \
>   Mcupanel_Data(0x001d); \
>   Mcupanel_Data(0x001a); \
>   Mcupanel_Data(0x001d); \
>   Mcupanel_Data(0x0024); \
>   Mcupanel_Data(0x001e); \
>   Mcupanel_Data(0x001f); \
>   Mcupanel_Data(0x0027); \
>   Mcupanel_Data(0x001e); \
>   Mcupanel_Data(0x000a); \
>   Mcupanel_Data(0x0011); \
>   Mcupanel_Data(0x0011); \
>   Mcupanel_Command(0x002a); \
>   Mcupanel_Data(0x0000); \
>   Mcupanel_Data(0x0000); \
>   Mcupanel_Data(0x0001); \
>   Mcupanel_Data(0x003f); \
>   Mcupanel_Command(0x002b); \
>   Mcupanel_Data(0x0000); \
>   Mcupanel_Data(0x0000); \
>   Mcupanel_Data(0x0000); \
>   Mcupanel_Data(0x00ef); \
>   Mcupanel_Command(0x0029); \
>   Mcupanel_Command(0x002c); \
> } while (0)
> 
> /* TODO(IGP): make sure LCD power consumption is low in these conditions */
> 
> #define __slcd_special_off()    \
> do {          \
>   /* Keep chip select disabled */  \
>   __gpio_set_pin(PIN_CS_N);  \
>   /* Keep RESET active */    \
>   __gpio_clear_pin(PIN_RESET_N);  \
> } while (0)
> 
> #define __slcd_special_rs_enable()  \
> do {          \
>   __gpio_clear_pin(PIN_RS_N);  \
> } while (0)
> 
> #define __slcd_special_rs_disable()  \
> do {          \
>   __gpio_set_pin(PIN_RS_N);  \
> } while(0)
> 
> #endif /* CONFIG_JZ_SLCD_A320_S6D04M0X21 */

diff Kconfig_orgi Kconfig
250a251,255
> config JZ_SLCD_A320_S6D04M0X21
>   bool "Dingoo A320 S6D04M0X21 smart LCD panel"
>   ---help---
>   Driver for S6D04M0X21 smart IPS panel as connected in Dingoo A320.

$ make menuconfig

Device Drivers ⇒ Graphics support ⇒ Support for frame buffer devices ⇒ SLCD panel ⇒ Dingoo A320 S6D04M0X21 smart LCD panel

$ make

完成


返回上一頁