本文主要是介绍am335x 内核源码分析2 LCD移植,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1、/arch/arm/mach-omap2/board-am335xevm.c/lcdc_init(){得到LCD硬件参数struct da8xx_lcdc_platform_data} -> am33xx_register_lcdc() -> omap_device_build() -> omap_device_build_ss() -> platform_device_add_data(){pdev->dev.platform_data = d}
2、platform_device端注册过程:
omap_device_build_ss(){pdev = platform_device_alloc(pdev_name, pdev_id);} -> omap_device_register() -> platform_device_add()
3、platform_device设备名确定过程:
am33xx_register_lcdc(){char *dev_name = “da8xx_lcdc”;} -> omap_device_build() -> omap_device_build_ss(){pdev = platform_device_alloc(pdev_name, pdev_id);}
4、通过设备名搜索找到设备驱动文件: drivers/video/da8xx-fb.c
5、board-am335xevm.c记录的屏的类型有:
.type = “ TFC_S9700RTWV35TR_01B“,
.type = “NHD-4.3-ATXI#-T-1”,
da8xx-fb.c记录的屏的类型有:
.name = “Sharp_LCD035Q3DG01”,
.name = “Sharp_LK043T1DG01”,
.name = “ TFC_S9700RTWV35TR_01B“,
.name = “NHD-4.3-ATXI#-T-1”,
6、配置驱动程序进入fb_probe()获取LCD硬件参数用于配置struct da8xx_lcdc_platform_data:
struct da8xx_lcdc_platform_data *fb_pdata = device->dev.platform_data;
7、匹配合适的屏,并输出屏的类型(通过dmesg查看匹配信息是否正确),否则退出驱动:
{
}
8、fb_probe()接下来复位LCD并配置硬件参数,最后申请fb_info注册framebuffer设备
9、硬件资源设置:
am33xx_register_lcdc(){oh = omap_hwmod_lookup(oh_name);} -> omap_device_build(…struct omap_hwmod *oh,…){struct omap_hwmod *ohs[] = { oh };} -> omap_device_build_ss(…struct omap_hwmod **ohs,…) -> omap_device_alloc(…struct omap_hwmod **ohs,…){od->hwmods = hwmods(来至于参数ohs);} -> omap_device_fill_resources(od, res){omap_hwmod_fill_resources(od->hwmods[i], res){填充 struct resource}} -> platform_device_add_resources(){pdev->resource = r;}
10、资源来源omap_hwmod:
omap_hwmod_lookup(oh_name) -> _lookup(name) -> 遍历链表omap_hwmod_list并返回struct omap_hwmod
11、被返回的返回struct omap_hwmod来至于:
MACHINE_START -> am33xx_init_early() -> am33xx_hwmod_init() -> omap_hwmod_register(){将am33xx_lcdc_hwmod添加到omap_hwmod_list链表当中}
static struct omap_hwmod am33xx_lcdc_hwmod = {
12、总结:两个数据结构共同决定LCD控制寄存器的配置参数:
static struct lcd_ctrl_config lcd_cfg = {
};
static struct da8xx_panel known_lcd_panels[] = {
}
这篇关于am335x 内核源码分析2 LCD移植的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!