###LCD驱动程序
假设 app: open(“/dev/fb0”, …) 主设备号:29,次设备号:0
kernel:
fb_open
int fbidx = iminor(inode);
struct fb_info *info = registered_fb[0];
app: read()
kernel:
fb_read
int fbidx = iminor(inode);
struct fb_info *info = registered_fb[fbidx];
if (info->fbops->fb_read)
return info->fbops->fb_read(info, buf, count, ppos);
src = (u32 __iomem *) (info->screen_base + p);
dst = buffer;
*dst++ = fb_readl(src++);
copy_to_user(buf, buffer, c)
问1 : registered_fb在哪里被设置?
答1 . register_framebuffer
###怎么写LCD驱动程序?
- 分配一个fb_info结构体:framebuffer_alloc
- 设置
- 注册:register_framebuffer
- 硬件相关的操作
####2440芯片手册,只关心TFT类型的LCD类型,STN是另一款
-
make menuconfig 去掉原来的驱动程序
``` -> Device Drivers -> Graphics support