一. ProjectConfig.mk 中的LCM是如何与驱动中的LCM连起来的?
a. ProjectConfig.mk在custgen时会生成JD9161这个宏定义
-
./mediatek/config/hqunited72_we_72_kk/ProjectConfig.mk
-
#To choose LK LCM driver name
-
CUSTOM_LK_LCM=jd9161
-
-
# To choose kernel LCM driver name
-
CUSTOM_KERNEL_LCM=jd9161
-
-
# To choose uboot LCM driver name
-
CUSTOM_UBOOT_LCM=jd9161
b. 按照JD9161这个定义mt65xx_lcm_list.c中添加项
在./mediatek/custom/common/kernel/lcm/mt65xx_lcm_list.c中
有一个lcm_driver_list的表,这个表根据JD9161的定义将jd9161_drv添加到表中
而jd9161_drv是结构体LCM_DRIVER
-
./mediatek/custom/common/kernel/lcm
-
mt65xx_lcm_list.c
-
jd9161/
-
-
extern LCM_DRIVER jd9161_drv;
-
LCM_DRIVER* lcm_driver_list[] =
-
{
-
#if defined(JD9161) //ProjectConfig.mk中有了JD9161这个宏定义
-
&jd9161_drv, //则jd9161_drv就是lcm_driver_list中的一项
-
#endif
-
};
c.从cmdline传入的lcm=jd9161字符串匹配lcm_driver_list中的jd9161这结构体的name
如果找到则根据jd9161的params->type决定是接口类型是DSI还是DPI?
4. 编译
修改mediatek/config/hqunited72_we_72_kk/ProjectConfig.mk
cong@msi:/work/6572$./mk c,r pl lk k //需要重新编译 preloader uboot kernel 三个模块
1.MTK LCM的框架
./mediatek/platform/common/kernel/drivers/video
mtkfb.c --> MTK linux kernel framebuffer driver
disp_drv.c --> Display common library
debug.c disp_assert_layer.c disp_mgr.c disp_sync.c fbconfig_kdebug.c mtkfb_console.c mtkfb_vsync.c
./mediatek/platform/mt6572/kernel/drivers/video
lcd_drv.c --> kernel LCD controller driver
dsi_drv.c --> kernel DSI controller driver
disp_drv_dsi.c --> DSI display library used for DSI type LCM
disp_hal.c disp_intr.c
2. 具体分析
./mediatek/platform/mt6572/kernel/drivers/video/disp_hal.c
start_kernel
setup_arch
mt_fixup
DISP_GetVRamSizeBoot --> 传入的参数是cmdline
disp_get_lcm_name_boot -->对cmdline解析出"lcm=jd9161"的字符串
DISP_SelectDeviceBoot --> 按照lcm的名字匹配lcm_driver_list中的每一项的name
disphal_get_lcm_driver
1. 在lk中会初始化
2. mtkfb的注册
./mediatek/platform/common/kernel/drivers/video/mtkfb.c
module_init(mtkfb_init);
--> platform_driver_register 注册MTKFB_DRIVER
--> mtkfb_probe
先判断lcm_params、disp_drv、lcm_drv是不是都初始化了,这些的初始化见上面1部分
然后注册framebuffer即register_framebuffer
DISP_Init
缩写:
DBI --> Display Bus Interface or CPU interface
DPI --> Display Pixel Interface or RGB interface
DSI --> MIPI Display Serial Interface
阅读(1000) | 评论(0) | 转发(0) |