百问网技术交流群,百万嵌入式工程师聚集地:
https://www.100ask.net/page/2248041
资料下载
coding无法使用浏览器打开,必须用git工具下载:
git clone https://e.coding.net/weidongshan/linux/doc_and_source_for_drivers.git
视频观看
编程_LCD驱动程序框架_使用设备树
参考资料,GIT仓库里:
-
基于这个程序修改:
IMX6ULL\source\03_LCD\03_lcd_drv_qemu_ok
STM32MP157\source\A7\03_LCD\03_lcd_drv_qemu_ok
-
参考:内核自带的示例驱动程序
- Linux驱动源码:
drivers/video/fbdev/simplefb.c
- 设备树:
arch/arm/boot/dts/sun4i-a10.dtsi
- Linux驱动源码:
-
本节视频编写好的代码
IMX6ULL\source\03_LCD\06_lcd_drv_framework_use_devicetree
STM32MP157\source\A7\03_LCD\06_lcd_drv_framework_use_devicetree
1. 说明
Linux驱动程序 = 驱动程序框架 + 硬件编程。
在前面已经基于QEMU编写了LCD驱动程序,对LCD驱动程序的框架已经分析清楚。
核心就是:
- 分配fb_info
- 设置fb_info
- 注册fb_info
- 硬件相关的设置
本节课程我们基于设备树来编写驱动程序。
2. 入口函数注册platform_driver
3. 设备树有对应节点
framebuffer-mylcd {
compatible = "100ask,lcd_drv";
};
4. 编写probe函数
- 分配fb_info
- 设置fb_info
- 注册fb_info
- 硬件相关的设置
- 引脚设置
- 时钟设置
- LCD控制器设置
百问网技术交流群,百万嵌入式工程师聚集地:
https://www.100ask.net/page/2248041
百问网技术论坛:
http://bbs.100ask.net/
百问网嵌入式视频官网:
https://www.100ask.net/index
百问网开发板:
淘宝:https://100ask.taobao.com/
天猫:https://weidongshan.tmall.com/