一.关于硬件设备节点的描述
内核平台代码路径linux-3.10.x\arch\arm\mach-nuc970下dev.c
内核设备节点如下
struct platform_device nuc970fb_device_lcd = {
.name = "nuc970-lcd",
.id = -1,
.num_resources = ARRAY_SIZE(nuc970fb_lcd_resource),
.resource = nuc970fb_lcd_resource,
.dev = {
.dma_mask = &nuc970fb_device_lcd_dmamask,
.coherent_dma_mask = -1,
.platform_data = &nuc970fb_fb_info,
}
};
nuc970fb_lcd_resource中定义了两个资源 lcd基地址和中断
static struct resource nuc970fb_lcd_resource[] = {
[0] = {
.start = NUC970_PA_LCD,
.end = NUC970_PA_LCD + NUC970_SZ_LCD - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_LCD,
.end = IRQ_LCD,
.flags = IORESOURCE_IRQ,
}
};
自定义的lcd描述硬件设备结构体
static struct nuc970fb_mach_info nuc970fb_fb_info = {
.displays = &nuc970fb_lcd_info[0],
.num_displays = ARRAY_SIZE(nuc970fb_lcd_info),
.default_display = 0,
.gpio_blen = NUC970_PG3,
.gpio_lcs = NUC970_PG2,
};
其中的nuc970fb_lcd_info添加了屏幕的详细信息
static struct nuc970fb_display nuc970fb_lcd_info[] = {
#ifdef CONFIG_A025DL02_320X240
/* AUO A035QN02V0 320x240 TFT Panel , 18bits*/
[0] = {
.type = LCM_DCCS_VA_SRC_RGB565,
.width = 320,
.height = 240,
.xres = 320,
.yres = 240,
.bpp = 16,
.pixclock = 4000000,
.left_margin