基于3c2410的Linux2.6.22移植(6)

2.  LCD驱动移植:
继续在mach-smdk2410.c中添加如下内容:
………….
#include <asm/arch/fb.h>
#include <asm/arch/regs-gpio.h>
#include <asm/arch/regs-lcd.h>
………….
………….
static struct s3c2410fb_mach_info smdk2410_lcdcfg __initdata={
.type=S3C2410_LCDCON1_TFT,
.fixed_syncs= 0,
.regs={
.lcdcon1=       S3C2410_LCDCON1_TFT16BPP|
S3C2410_LCDCON1_TFT |
S3C2410_LCDCON1_CLKVAL(0X01),
.lcdcon2=       S3C2410_LCDCON2_VBPD(18)|
S3C2410_LCDCON2_LINEVAL(479)|
S3C2410_LCDCON2_VFPD(10)|
S3C2410_LCDCON2_VSPW(14),
.lcdcon3=       S3C2410_LCDCON3_HBPD(43)|
S3C2410_LCDCON3_HOZVAL(639)|
S3C2410_LCDCON3_HFPD(115),
.lcdcon4=       S3C2410_LCDCON4_MVAL(0)  |
S3C2410_LCDCON4_HSPW(95),
.lcdcon5=       S3C2410_LCDCON5_FRM565   |
S3C2410_LCDCON5_INVVLINE|
S3C2410_LCDCON5_INVVFRAME|
S3C2410_LCDCON5_PWREN|
S3C2410_LCDCON5_HWSWP,
},
.lpcsel=   ((0XCE6)&~7)|1<<4,//0x0,
.gpccon= 0xAA8002A8,//0xaaaaaaaa,
.gpccon_mask=     0xFFC003FC,//0xffffffff,
.gpcup=         0xF81E,//0xffffffff,
.gpcup_mask=      0xF81E,//0xffffffff,
.gpdcon= 0xAA80AAA0,//0xaaaaaaaa,
.gpdcon_mask=    0xFFC0FFF0,//0x0,
.gpcup=         0xF8FC,//0xffffffff,
.gpcup_mask=      0xF8FC,//0xffffffff,
.width=          640,//240,
.height= 480,//320,
.xres=            {640,640,640},//{240,240,240}, .min .max .defval
.yres=            {480,480,480},//{320,320,320},
.bpp=             {16,16,16},   //{16,16,16},
};
……………
……………
static void __init smdk2410_init(void)
{
s3c24xx_fb_set_platdata(&smdk2410_lcdcfg);
platform_add_devices(smdk2410_devices, ARRAY_SIZE(smdk2410_devices));
smdk_machine_init();
}
………………..
注:注释掉drivers\char\vt.c的blank_screen_t(unsigned long dummy)的函数内容,否则lcd会在10分钟左右关掉显示。“
最后在内核编译时需要选中对LCD的支持,具体见内核配置和编译。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wzygyp.html