LCD驱动移植
2012-04-07 12:48
253 查看
LCD驱动移植
做这个驱动移植花了我一个晚上和一个早上,太他吗蛋痛了,但做出来后就很高兴啦!!!学习本身就是烦恼与快乐并存的过程。。。。。。
好了,不多说了,下面说说我的移植过程:
我的开发板是Mini2440的,LCD是宽屏的,上面标注W35
(1)gedit arch/arm/mach-s3c2440/mach-smdk2440.c,先删除之前的 LCD 设备平台代码,如
下:
/* LCD driver info */
static struct s3c2410fb_display smdk2440_lcd_cfg __initdata = {
.lcdcon5 = S3C2410_LCDCON5_FRM565 |
S3C2410_LCDCON5_INVVLINE |
S3C2410_LCDCON5_INVVFRAME |
S3C2410_LCDCON5_PWREN |
S3C2410_LCDCON5_HWSWP,
.type = S3C2410_LCDCON1_TFT,
.width = 240,
.height = 320,
.pixclock = 166667, /* HCLK 60 MHz, divisor 10 */
.xres = 240,
.yres = 320,
.bpp = 16,
.left_margin = 20,
.right_margin = 8,
.hsync_len = 4,
.upper_margin = 8,
.lower_margin = 7,
.vsync_len = 4,
};
static struct s3c2410fb_mach_info smdk2440_fb_info __initdata = {
.displays = &smdk2440_lcd_cfg,
.num_displays = 1,
.default_display = 0,
#if 0
/* currently setup by downloader */
.gpccon = 0xaa940659,
.gpccon_mask = 0xffffffff,
.gpcup = 0x0000ffff,
.gpcup_mask = 0xffffffff,
.gpdcon = 0xaa84aaa0,
.gpdcon_mask = 0xffffffff,
.gpdup = 0x0000faff,
.gpdup_mask = 0xffffffff,
#endif
.lpcsel = ((0xCE6) & ~7) | 1<<4,
再把囯嵌移植好的代码加入,如下:
/* LCD driver info */
//W 3.5”LCD 的配置和参数设置
#if defined(CONFIG_FB_S3C2410_T240320) //注:下面的宏定义的参数十分重要,一定要根据你的屏类型设置,否则会出现显示不满屏等许多现象。
#define LCD_WIDTH 320
#define LCD_HEIGHT 240
#define LCD_PIXCLOCK 170000
#define LCD_RIGHT_MARGIN 0x44
#define LCD_LEFT_MARGIN 0x04
#define LCD_HSYNC_LEN 0x01
#define LCD_UPPER_MARGIN 10
#define LCD_LOWER_MARGIN 4
#define LCD_VSYNC_LEN 1
#endif
#if defined (LCD_WIDTH)
#endif
static struct s3c2410fb_display smdk2440_lcd_cfg __initdata = {
#if !defined (LCD_CON5)
.lcdcon5 = S3C2410_LCDCON5_FRM565 |
S3C2410_LCDCON5_INVVLINE |
S3C2410_LCDCON5_INVVFRAME |
S3C2410_LCDCON5_PWREN |
S3C2410_LCDCON5_HWSWP,
#else
.lcdcon5 = LCD_CON5,
#endif
.type = S3C2410_LCDCON1_TFT,
.width = LCD_WIDTH,
.height = LCD_HEIGHT,
.pixclock = LCD_PIXCLOCK,
.xres = LCD_WIDTH,
.yres = LCD_HEIGHT,
.bpp = 16,
.left_margin = LCD_LEFT_MARGIN + 1,
.right_margin = LCD_RIGHT_MARGIN + 1,
.hsync_len = LCD_HSYNC_LEN + 1,
.upper_margin = LCD_UPPER_MARGIN + 1,
.lower_margin = LCD_LOWER_MARGIN + 1,
.vsync_len = LCD_VSYNC_LEN + 1,
};
static struct s3c2410fb_mach_info smdk2440_fb_info __initdata = {
.displays = &smdk2440_lcd_cfg,
.num_displays = 1,
.default_display = 0,
default_display = 0,
.gpccon = 0xaa955699,
.gpccon_mask = 0xffc003cc,
.gpcup = 0x0000ffff,
.gpcup_mask = 0xffffffff,
.gpdcon = 0xaa95aaa1,
.gpdcon_mask = 0xffc0fff0,
.gpdup = 0x0000faff,
.gpdup_mask = 0xffffffff,
.lpcsel = 0xf82,
};
(2) 然后打开drivers/video/Kconfig,在大概 1935 行加入以下配置信息:
config FB_S3C2410_DEBUG
bool "S3C2410 lcd debug messages"
depends on FB_S3C2410
help
Turn on debugging messages. Note that you can set/unset at run time
through sysfs
choice
prompt "LCD select"
depends on FB_S3C2410
help
S3C24x0 LCD size select
config FB_S3C2410_T240320
boolean "3.5 inch 240X320 Toppoly LCD"
depends on FB_S3C2410
help
3.5 inch 240X320 Toppoly LCD
endchoice
(3)配置使支持LCD
到你的内核源代码顶层目录 make menuconfig
Device Drivers --->
Graphics support --->
<*> Support for frame buffer devices --->
LCD select (3.5 inch 240X320 Toppoly LCD) --->
如图选上
再次提醒大家一定要注意屏的参数设置!!!
配置完保存退出,再编译内核。
做这个驱动移植花了我一个晚上和一个早上,太他吗蛋痛了,但做出来后就很高兴啦!!!学习本身就是烦恼与快乐并存的过程。。。。。。
好了,不多说了,下面说说我的移植过程:
我的开发板是Mini2440的,LCD是宽屏的,上面标注W35
(1)gedit arch/arm/mach-s3c2440/mach-smdk2440.c,先删除之前的 LCD 设备平台代码,如
下:
/* LCD driver info */
static struct s3c2410fb_display smdk2440_lcd_cfg __initdata = {
.lcdcon5 = S3C2410_LCDCON5_FRM565 |
S3C2410_LCDCON5_INVVLINE |
S3C2410_LCDCON5_INVVFRAME |
S3C2410_LCDCON5_PWREN |
S3C2410_LCDCON5_HWSWP,
.type = S3C2410_LCDCON1_TFT,
.width = 240,
.height = 320,
.pixclock = 166667, /* HCLK 60 MHz, divisor 10 */
.xres = 240,
.yres = 320,
.bpp = 16,
.left_margin = 20,
.right_margin = 8,
.hsync_len = 4,
.upper_margin = 8,
.lower_margin = 7,
.vsync_len = 4,
};
static struct s3c2410fb_mach_info smdk2440_fb_info __initdata = {
.displays = &smdk2440_lcd_cfg,
.num_displays = 1,
.default_display = 0,
#if 0
/* currently setup by downloader */
.gpccon = 0xaa940659,
.gpccon_mask = 0xffffffff,
.gpcup = 0x0000ffff,
.gpcup_mask = 0xffffffff,
.gpdcon = 0xaa84aaa0,
.gpdcon_mask = 0xffffffff,
.gpdup = 0x0000faff,
.gpdup_mask = 0xffffffff,
#endif
.lpcsel = ((0xCE6) & ~7) | 1<<4,
再把囯嵌移植好的代码加入,如下:
/* LCD driver info */
//W 3.5”LCD 的配置和参数设置
#if defined(CONFIG_FB_S3C2410_T240320) //注:下面的宏定义的参数十分重要,一定要根据你的屏类型设置,否则会出现显示不满屏等许多现象。
#define LCD_WIDTH 320
#define LCD_HEIGHT 240
#define LCD_PIXCLOCK 170000
#define LCD_RIGHT_MARGIN 0x44
#define LCD_LEFT_MARGIN 0x04
#define LCD_HSYNC_LEN 0x01
#define LCD_UPPER_MARGIN 10
#define LCD_LOWER_MARGIN 4
#define LCD_VSYNC_LEN 1
#endif
#if defined (LCD_WIDTH)
#endif
static struct s3c2410fb_display smdk2440_lcd_cfg __initdata = {
#if !defined (LCD_CON5)
.lcdcon5 = S3C2410_LCDCON5_FRM565 |
S3C2410_LCDCON5_INVVLINE |
S3C2410_LCDCON5_INVVFRAME |
S3C2410_LCDCON5_PWREN |
S3C2410_LCDCON5_HWSWP,
#else
.lcdcon5 = LCD_CON5,
#endif
.type = S3C2410_LCDCON1_TFT,
.width = LCD_WIDTH,
.height = LCD_HEIGHT,
.pixclock = LCD_PIXCLOCK,
.xres = LCD_WIDTH,
.yres = LCD_HEIGHT,
.bpp = 16,
.left_margin = LCD_LEFT_MARGIN + 1,
.right_margin = LCD_RIGHT_MARGIN + 1,
.hsync_len = LCD_HSYNC_LEN + 1,
.upper_margin = LCD_UPPER_MARGIN + 1,
.lower_margin = LCD_LOWER_MARGIN + 1,
.vsync_len = LCD_VSYNC_LEN + 1,
};
static struct s3c2410fb_mach_info smdk2440_fb_info __initdata = {
.displays = &smdk2440_lcd_cfg,
.num_displays = 1,
.default_display = 0,
default_display = 0,
.gpccon = 0xaa955699,
.gpccon_mask = 0xffc003cc,
.gpcup = 0x0000ffff,
.gpcup_mask = 0xffffffff,
.gpdcon = 0xaa95aaa1,
.gpdcon_mask = 0xffc0fff0,
.gpdup = 0x0000faff,
.gpdup_mask = 0xffffffff,
.lpcsel = 0xf82,
};
(2) 然后打开drivers/video/Kconfig,在大概 1935 行加入以下配置信息:
config FB_S3C2410_DEBUG
bool "S3C2410 lcd debug messages"
depends on FB_S3C2410
help
Turn on debugging messages. Note that you can set/unset at run time
through sysfs
choice
prompt "LCD select"
depends on FB_S3C2410
help
S3C24x0 LCD size select
config FB_S3C2410_T240320
boolean "3.5 inch 240X320 Toppoly LCD"
depends on FB_S3C2410
help
3.5 inch 240X320 Toppoly LCD
endchoice
(3)配置使支持LCD
到你的内核源代码顶层目录 make menuconfig
Device Drivers --->
Graphics support --->
<*> Support for frame buffer devices --->
LCD select (3.5 inch 240X320 Toppoly LCD) --->
如图选上
再次提醒大家一定要注意屏的参数设置!!!
配置完保存退出,再编译内核。
相关文章推荐
- linux-3.6.6重新移植lcd及触摸屏驱动
- PART1 linux-2.6.26.5内核的 lcd驱动移植 lcd 触摸屏移植 tslib-1.4移植 (转)
- linux-2.6.35内核移植—LCD驱动的添加
- Linux2.6.24移植:LCD驱动
- linux下 s3c2440 lcd驱动移植详解
- SylixOS的LCD驱动移植
- Linux-2.6.32.2内核在mini2440上的移植(七)---LCD驱动移植
- (引用)LCD驱动移植及测试
- linux系统移植之LCD驱动移植
- lcd驱动移植的分析linux3.2内核,chipsee为例,液晶屏AT070TN92
- LCD驱动移植 Linux 2.6.22.19移植到S3C2410(GEC2410)
- linux-2.6.32在mini2440开发板上移植 ---W35型LCD驱动移植
- 【引用】Linux-2.6.32.2内核在mini2440上的移植(七)---LCD驱动移植
- linux自学之旅_LCD液晶驱动移植
- RT-Thread 学习笔记(十一)--- 开启基于RTGUI的LCD显示功能(1)<LCD驱动接口移植>
- AM335x(TQ335x)学习笔记——LCD驱动移植
- LCD驱动移植
- Linux-2.6.32.67内核裁剪与移植之LCD驱动的移植(2)
- mini6410_lcd驱动移植,字体模糊重影问题
- 【引用】Linux-2.6.32.2内核在mini2440上的移植(六)---添加LCD背光驱动