linux驱动 lcd分辨率,嵌入式Linux的LCD驱动(FB @ s3c2410)

CPU : ARM9 s3c2410

LCD : 规格不明(这个很无奈,但是我所知道的只有一个分辨率)

源码修改:

/linux-2.6.30.4/arch/arm/mach-s3c2410/mach-smdk2410.c

在这个文件中加入framebuffer的初始化数据结构(具体数据参照LCD技术手册)如下:

#include // added by B.Zhou for the LCD driver

/* The info of LCD driver start */

static struct s3c2410fb_display smdk2410_lcd_cfg __initdata = {

.lcdcon5    = S3C2410_LCDCON5_FRM565 |

S3C2410_LCDCON5_INVVLINE |

S3C2410_LCDCON5_INVVFRAME |

S3C2410_LCDCON5_PWREN |

S3C2410_LCDCON5_HWSWP,

.type        = S3C2410_LCDCON1_TFT,

.width        = 800,

.height        = 480,

.pixclock    = 174757, //40000, /* HCLK/4 */

.xres        = 800,

.yres        = 480,

.bpp        = 16,

.left_margin    = 7,

.right_margin    = 3,

.hsync_len    = 5,

.upper_margin    = 1,

.lower_margin    = 3,

.vsync_len    = 1,

};

static struct s3c2410fb_mach_info smdk2410_fb_info __initdata = {

.displays        = &smdk2410_lcd_cfg,

.num_displays        = 1,

.default_display    = 0,

.lpcsel        = 0x0,

};

找到这个文件中的设备初始化函数,并在其中添加对于LCD设备初始化:

static void __init smdk2410_init(void)

{

#if 1 //added by B.Zhou for theLCD framebuffer

s3c24xx_fb_set_platdata(&smdk2410_fb_info);

#endif

s3c_i2c0_set_platdata(NULL);

platform_add_devices(smdk2410_devices, ARRAY_SIZE(smdk2410_devices));

smdk_machine_init();

}

源码修改就这么多,我所做过的最简单的设备移植。(当然要把资料不足排除在外)

配置内核:

make menuconfig

Device Drivers  --->

Graphics support  --->

Support for frame buffer devices --->

S3C2410 LCD framebuffer support

Display device support  --->

Display panel/monitor support

Console display driver support  --->

Framebuffer Console support

[*]   Framebuffer Console Rotation

[*] Select compiled-in fonts

[*]   VGA 8x8 font

[*]   VGA 8x16 font

[*]   Mini 4x6 font

[*] Sparc console 8x16 font

[*] Bootup logo  --->

--- Bootup logo

[*]   Standard 224-color Linux logo

至此,LCD驱动添加结束。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值