先回忆一下关于tq2440 lcd的一些资料:
http://blog.sina.com.cn/s/blog_7090b8670101828y.html
参照tq2440出厂源代码。
1.
在mach-smdk2440.c/static struct s3c2410fb_display smdk2440_lcd_cfg __initdata中添加.setclkval =0x04,
static struct s3c2410fb_display smdk2440_lcd_cfg __initdata = {
.lcdcon5 = S3C2410_LCDCON5_FRM565 |
.type = S3C2410_LCDCON1_TFT,
.width = 480,
.height = 272,
.pixclock =40000,
.setclkval =0x04,//设置为0x04
.xres = 480,
.yres = 272,
.bpp = 16,
.left_margin = 19,
.right_margin = 10,
.hsync_len = 30,
.upper_margin = 4,
.lower_margin = 2,
.vsync_len = 8,
};
2.然后在s3c2410fb_display这个结构体的定义中添加unsigned setclkval;
struct s3c2410fb_display {
unsigned type;
unsigned short width;
unsigned short height;
unsigned short xres;
unsigned short yres;
unsigned short bpp;
unsigned pixclock;
unsigned setclkval;
unsigned short left_margin;
unsigned short right_margin;
unsigned short hsync_len;
unsigned short upper_margin;
unsigned short lower_margin;
unsigned short vsync_len;
unsigned long lcdcon5;
};
struct s3c2410fb_mach_info {
struct s3c2410fb_display *displays;
unsigned num_displays;
unsigned default_display;
unsigned long gpcup;
unsigned long gpcup_mask;
unsigned long gpccon;
unsigned long gpccon_mask;
unsigned long gpdup;
unsigned long gpdup_mask;
unsigned long gpdcon;
unsigned long gpdcon_mask;
unsigned long lpcsel;
};
3.在driver/video/s3c2410fb.c中的 s3c2410fb_activate_var(struct fb_info *info)中“"添加
struct s3c2410fb_mach_info *mach_info = fbi->dev->platform_data;
struct s3c2410fb_display *display = NULL;
struct s3c2410fb_display *default_display = mach_info->displays +
fbi->regs.lcdcon1 |=
S3C2410_LCDCON1_CLKVAL(default_display->setclkval);
LCD驱动内核配置选项如下:
Device Drivers->Graphics support->Support for frame buffer devices->Enable firmware EDID、Enable Video Mode Handling Helpers和S3C2410 LCD framebuffer support,同时在Graphics support选项中还要选择Console display driver support->Framebuffer Console support;