linux-2.6.30.24 移植lcd

本文介绍如何为S3C2410 LCD显示器配置内核驱动,包括修改源代码以适配特定的显示参数,并启用内核配置选项来支持帧缓冲设备。此外还提供了一个添加开机Logo的具体方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

先回忆一下关于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 |
 S3C2410_LCDCON5_INVVLINE |
 S3C2410_LCDCON5_INVVFRAME |
 S3C2410_LCDCON5_PWREN |
 S3C2410_LCDCON5_HWSWP,

.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 +
   mach_info->default_display;
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;        
 5)添加开机Logo。具体Logo图片可以自行选择,我用的是Linux内核自带的
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值