1. Configure the kernel
Graphics support --->
<*> Support for frame buffer devices --->
<M> pxa LCD framebuffer support
Consoledisplay driver support --->
<*> Framebuffer console support
2. Configure Resources
(1)
Static struct pxafb_mode_infonec_nl6448bc26_09c_mode = {
. Pixclock = 39722,
. Xres = 640,
. Yres = 480,
. Bpp = 16,
. Hsync_len = 56,
. Left_margin = 16,
. Right_margin = 88,
. Vsync_len = 2,
. Upper_margin = 12,
. Lower_margin = 31,
. Sync = 0,
};
Static struct pxafb_mode_infosharp_lq080v3dg01_mode = {
. Pixclock = 25000,
. Xres = 640,
. Yres = 480,
. Bpp = 16,
. Hsync_len = 64,
. Left_margin = 48,
. Right_margin = 16,
. Vsync_len = 1,
. Upper_margin = 34,
. Lower_margin = 7,
. Sync = 0,
};
Static struct pxafb_mach_infohepxa270_pxafb_info = {
. Modes = & nec_nl6448bc26_09c_mode,
. Num_modes = 1,
. LCD _conn = LCD _color_tft_16bpp | LCD _pclk_edge_fall,
};
(2)
Static struct resource pxafb_resources [] = {
[0] = {
. Start = 0x44000000,
. End = 0x4400ffff,
. Flags = ioresource_mem,
},
[1] = {
. Start = irq_ LCD,
. End = irq_ LCD,
. Flags = ioresource_irq,
},
};
Static u64 fb_dma_mask = ~ (U64) 0;
Struct platform_device pxa_device_fb = {
. Name = "pxa2xx-fb ",
. ID =-1,
. Dev = {
. Dma_mask = & fb_dma_mask,
. Coherent_dma_mask = 0 xffffffff,
},
. Num_resources = array_size (pxafb_resources ),
. Resource = pxafb_resources,
};
Call set_pxa_fb_info (& hepxa270_pxafb_info) to register platform devices and resources.
The source code of set_pxa_fb_info is as follows. In set_pxa_fb_info, pxa_register_device is called to register the platform device.
Void _ init set_pxa_fb_info (structpxafb_mach_info * info)
{
Pxa_register_device (& pxa_device_fb, Info );
}