/*
bindingfly
*/
Disp_lcm.c文件中通过disp_lcm_probe函数来调用lcm_driver_list数组,
Primary_display.c文件中通过primary_display_init函数调用
disp_lcm_probe(lcm_name, LCM_INTERFACE_NOTDEFINED)
在mtkfb.c文件中通过mtkfb_probe函数调用
primary_display_init(mtkfb_find_lcm_driver(), lcd_fps);
通过数据结构platform_driver挂接的到platform总线上
通过此结构体,调用其中的函数来对LCD实现控制。Mtkfb.c中定义并
实现了fb_ops类型的mtkfb_ops。
在mtkfb_probe函数中注册到系统/* Register to system */r = mtkfb_fbinfo_init(fbi);
bindingfly
*/
如果自己没有研究,那就不要往下看了,肯定不知所云。
lcm驱动流程:
lcm模组驱动,ili9881c_dsi_hd_vdo_dj_sp603_drvLCM_DRIVER ili9881c_dsi_hd_vdo_dj_sp603_drv =
{
.name = "ili9881c_dsi_hd_vdo_dj_sp603",
.set_util_funcs = lcm_set_util_funcs,
.get_params = lcm_get_params,
.init = lcm_init,
.suspend = lcm_suspend,
.resume = lcm_resume,
.compare_id = lcm_compare_id,
#if defined(LCM_DSI_CMD_MODE)
.update = lcm_update,
#endif
};
Mt65xx_lcm_list.c 函数中通过lcm_driver_list调用到lcm模组驱动函数。
Disp_lcm.c文件中通过disp_lcm_probe函数来调用lcm_driver_list数组,
Primary_display.c文件中通过primary_display_init函数调用
disp_lcm_probe(lcm_name, LCM_INTERFACE_NOTDEFINED)
在mtkfb.c文件中通过mtkfb_probe函数调用
primary_display_init(mtkfb_find_lcm_driver(), lcd_fps);
通过数据结构platform_driver挂接的到platform总线上
static struct platform_driver mtkfb_driver = {
.driver = {
.name = MTKFB_DRIVER,
#ifdef CONFIG_PM
.pm = &mtkfb_pm_ops,
#endif
.bus = &platform_bus_type,
.probe = mtkfb_probe,
.remove = mtkfb_remove,
.suspend = mtkfb_suspend,
.resume = mtkfb_resume,
.shutdown = mtkfb_shutdown,
.of_match_table = mtkfb_of_ids,
},
};
framebuffer设备驱动程序的核心数据结构是fb_ops;用户空间就是
通过此结构体,调用其中的函数来对LCD实现控制。Mtkfb.c中定义并
实现了fb_ops类型的mtkfb_ops。
static struct fb_ops mtkfb_ops = {
.owner = THIS_MODULE,
.fb_open = mtkfb_open,
.fb_release = mtkfb_release,
.fb_setcolreg = mtkfb_setcolreg, //批量配置颜色参数
.fb_pan_display = mtkfb_pan_display_proxy, //虚拟屏幕内容显示
.fb_fillrect = cfb_fillrect, //填充区域显示
.fb_copyarea = cfb_copyarea, //复制区域显示
.fb_imageblit = cfb_imageblit, //显示图象
.fb_cursor = mtkfb_soft_cursor, //光标显示
.fb_check_var = mtkfb_check_var, //检查并配置fb_var_screeninfo参数
.fb_set_par = mtkfb_set_par, //change display mode and set parameter
.fb_ioctl = mtkfb_ioctl, //特定ioctl配置LCD屏幕特性
#ifdef CONFIG_COMPAT
.fb_compat_ioctl = mtkfb_compat_ioctl,
#endif
#if defined(CONFIG_PM_AUTOSLEEP)
.fb_blank = mtkfb_blank,
#endif
};
对结构体的调用关系 在函数中mtkfb_fbinfo_init,info->fbops = &mtkfb_ops;
在mtkfb_probe函数中注册到系统/* Register to system */r = mtkfb_fbinfo_init(fbi);