首先下載內(nèi)核源碼,我這里用的是linux-2.6.26.5的內(nèi)核源碼,。
(1) 在arch/arm/mach-s3c2410/mach-smdk2410.c里添加頭文件:
#include
(2) 在arch/arm/ plat-s3c24xx / commON-smdk.c文件中添加如下信息:
#include
然后添加如下代碼:
STatic struct s3c2410fb_display qt2410_LCD_cfg[] __initdata = {
{
.LCDcon5 = S3C2410_LCDCON5_FRM565 |
S3C2410_LCDCON5_INVVCLK|
S3C2410_LCDCON5_INVVLINE |
S3C2410_LCDCON5_INVVframe.|
S3C2410_LCDCON5_PWREN |
S3C2410_LCDCON5_HWSWP,
.type = S3C2410_LCDCON1_TFT,
.width = 320,
.height = 240,
.pixclock = 100000, /* HCLK/10 */
.xres = 320,
.yres = 240,
.bpp = 16,
.left_margin = 13,
.right_margin = 8,
.hsync_len = 4,
.upper_margin = 2,
.lower_margin = 7,
.vsync_len = 4,
}
};
static struct s3c2410fb_mach_info qt2410_fb_info __initdata = {
.displays = qt2410_lcd_cfg,
.num_displays = ARRAY_SIZE(qt2410_lcd_cfg),
.default_display = 0,
.lpcsel = ((0xCE6) & ~7) | 1<<4,
};
在smdk_machine_init函數(shù)里添加:
s3c24xx_fb_set_platdata(&qt2410_fb_info);
(3) 重新配置內(nèi)核
# make menuconfig
Device Drivers
Graphics support→
Support for frAME. buffer devices→
(4) 重新編譯內(nèi)核
#make zImage
這樣你新編譯的內(nèi)核就支持LCD驅(qū)動了,。