|
文件: |
lcd.rar |
大小: |
1730KB |
下载: |
下载 | |
针对4.3寸液晶屏LQ043T3DX02
一,由于Linux 2.6.13内核已经包含了该驱动,所以只要在平台初始化文件中对LCD进行设置、初始化即可。
#vi $KERNEL/arch/arm/mach-s3c2410/mach-smdk2410.c
添加头文件:
#include
#include
添加LCD初始化代码:
static struct s3c2410fb_mach_info s3c2410_lcd_info __initdata = {
.fixed_syncs = 0,
.regs = {
//对于寄存器的设置是关键,可参考S3C2410X的手册
//和LCD技术手册中对于LCD技术指标的描述来进行设置。
//其中,寄存器值的宏定义在regs-lcd.h文件中。
.lcdcon1 = S3C2410_LCDCON1_TFT16BPP
| S3C2410_LCDCON1_TFT | S3C2410_LCDCON1_CLKVAL(5),
.lcdcon2 = S3C2410_LCDCON2_VBPD(2)
| S3C2410_LCDCON2_VFPD(2) | S3C2410_LCDCON2_VSPW(10),
.lcdcon3 = S3C2410_LCDCON3_HBPD(2)
| S3C2410_LCDCON3_HFPD(2),
.lcdcon4 = S3C2410_LCDCON4_MVAL(0)
| S3C2410_LCDCON4_HSPW(41),
.lcdcon5 = S3C2410_LCDCON5_FRM565
| S3C2410_LCDCON5_INVVLINE | S3C2410_LCDCON5_HWSWP
| S3C2410_LCDCON5_PWREN | S3C2410_LCDCON5_INVVFRAME,
},
.lpcsel = 0x0,
.gpccon = 0xaaaaaaaa,
.gpccon_mask = 0xffffffff,
.gpcup = 0xffffffff,
.gpcup_mask = 0xffffffff,
.gpdcon = 0xaaaaaaaa,
.gpdcon_mask = 0x0,
.gpdup = 0xffffffff,
.gpdup_mask = 0xffffffff,
.width = 480,
.height = 272,
.xres = {480,480,480},
.yres = {272,272,272},
.bpp = {16,16,16},
};
static void __init smdk2410_lcd_init(void)
{
set_s3c2410fb_info(&s3c2410_lcd_info);
}
最后在MACHINE_START与MACHINE_END中添加如下代码:
.init_machine = smdk2410_lcd_init,
二 在/driver/video/s3c2410fb.h中s3c2410fb_init_registers函数中
添加 LCD--VM信号相关消息
s3c2410_gpio_cfgpin(S3C2410_GPC4,S3C2410_GPC4_OUTP);
s3c2410_gpio_setpin(S3C2410_GPC4,0);
msleep(10);
s3c2410_gpio_setpin(S3C2410_GPC4,1);
,
阅读(1607) | 评论(0) | 转发(0) |