The following shows the steps to add a new LCM driver:?
(1)? Create LCM driver folder $LCM in alps/mediatek/custom/common/kernel/lcm/
(2)? Create LCM driver source file $LCM.c in alps/mediatek/custom/common/kernel/lcm/$LCM
(3)? Implement LCM driver and export lcm_driver_list/lcm_count variables.?
????????????????????
Adaptive LCM Support? At first you should add you new lcm driver as listed in the previous section, and then add the? adaptive support:? 1.? Modify the adaptive lcm driver common file:?? alps/mediatek/custom/common/kernel/lcm/mt65xx_lcm_list.c
2.? Add the new LCM driver global variables as shown in the figure below:?
????????????????
3.? [VERY IMPORTANT] Please delete the unused LCM driver folder in the customization folder,? such as shown in the figure below:?
??????????????
4. But what if I didn’t delete the folders un-usable? The code size will increase, because the? other LCM drivers will be compiled into codebase too; And if your project doesn’t define? GPIO usage for serial interface, there will be build error.
5.? Modify the project makefile alps/mediate/config/(project)/ProjetConfig.mk? Modify CUSTOM_KERNEL_LCM=mt65xx? Modify CUSTOM_UBOOT_LCM=mt65xx
Case Study – DBI Interface LCM Driver Porting?
In this chapter, we’ll go through a real case study of DBI LCM driver porting.?
LCM specifications:? ?? LCM Drive IC: hx8369? ?? Interface: 24-bit 80 system bus interface? ?? LCD size: 480*800? ?? 1.? Create LCM driver folder and LCM driver source file? alps/mediatek/custom/common/kernel/lcm/hx8369/lcm_dr.c?
3.? Fill the LCM parameters? A.? Configure the basic information according to the HW connection, LCM type and LCM size:?
?????????????????
MT6575 LCD IO selection is as shown in following table. LCD data pin can share between DPI and NAND data pin?
????????????
For example, we use 24bits DBI interface LCM, and connect LCM data pin to MT6575 baseband? Pin DPIR[7:0], DPIG[7:0], DPIB[7:0]. So we must set io_select_mode to be 1; if connect LCM data? pin to Nand IF, we must set io_select_mode to be 0
B.? Configure data format according to the RGB data pin assignment of the LCM datasheet?
????????????
C.? Configure LCM waveform timing according to the requirement specified in the LCM datasheet
??????????????
Note: MT6575 LCD controller clock frequency is 130MHz, so clock cycle time is 1/130MHz = 7.69ns
4.? Implement LCM init function?
According the init process specified in LCM datasheet, pull down/up the reset pin, delay and set? LCM init register settings.?
5.? Implement LCM update function? Send the block update commands to LCM?
6.? Implement LCM suspend/resume functions? Send suspend/resume commands to LCM
7. Rebuild uboot and kernel? In the root directory:? ./mk $(project) gen_cust? ./mk $(project) remake uboot/kernel? ./mk $(project) bootimage?