Chinaunix首页 | 论坛 | 博客
  • 博客访问: 161746
  • 博文数量: 21
  • 博客积分: 2227
  • 博客等级: 大尉
  • 技术积分: 215
  • 用 户 组: 普通用户
  • 注册时间: 2009-10-07 19:51
文章分类
文章存档

2012年(1)

2011年(1)

2009年(19)

分类: LINUX

2009-11-11 11:34:18

移植LCD:
# gedit arch/arm/mach-s3c2440/mach-smdk2440.c
把相应的替换成以下的:

/* 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 = 174757,
    .xres = 240,
    .yres = 320,
    .bpp = 16,

    .left_margin = 2,
    .right_margin = 37,
    .hsync_len = 6,
    .upper_margin = 2,
    .lower_margin = 6,
    .vsync_len = 2,
};



static struct s3c2410fb_mach_info smdk2440_fb_info __initdata = {
    .displays = &smdk2440_lcd_cfg,
    .num_displays = 1,
    .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,
};



加入LCD背光:
# gedit arch/arm/mach-s3c2440/mach-smdk2440.c
因为mini2440的3.5英寸液晶显示屏的背光是由 S3C2440 的 GPG4 引脚来控制的,故下面的改动将开启背光:

static void __init smdk2440_machine_init(void)
{
    s3c24xx_fb_set_platdata(&smdk2440_fb_info);
    s3c_i2c0_set_platdata(NULL);

    platform_add_devices(smdk2440_devices, ARRAY_SIZE(smdk2440_devices));
    smdk_machine_init();


   //加入以下两句
   s3c2410_gpio_cfgpin(S3C2410_GPG4,S3C2410_GPG4_OUTP);
   s3c2410_gpio_setpin(S3C2410_GPG4,1);

}



加入RTC:
# gedit arch/arm/mach-s3c2440/mach-smdk2440.c

static struct platform_device *smdk2440_devices[] __initdata = {
    &s3c_device_usb,
    &s3c_device_lcd,
    &s3c_device_wdt,
    &s3c_device_i2c0,
    &s3c_device_iis,
    &s3c_device_rtc, //加入这一句
};


在开发板上测试:

[root@jjx /]# date -s 2009.11.11-10:58:00  //设置时期和日期
Wed Nov 11 10:58:00 UTC 2009
[root@jjx /]# date                         //查看
时期和日期
Wed Nov 11 11:12:09 UTC 2009
[root@jjx /]# hwclock -w                   //保存
时期和日期      


阅读(2578) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~