Chinaunix首页 | 论坛 | 博客
  • 博客访问: 32431
  • 博文数量: 12
  • 博客积分: 1400
  • 博客等级: 上尉
  • 技术积分: 130
  • 用 户 组: 普通用户
  • 注册时间: 2009-12-22 20:05
文章分类
文章存档

2010年(4)

2009年(8)

我的朋友

分类: 嵌入式

2009-12-23 13:02:32

一、开发平台

 

·   机:VMWare--Fedora 8

·  开发板:utu2440--64MB Nand

·  编译器:arm-linux-gcc-4.3.2

 

二、移植步骤

 

1 准备驱动源码。因为linux-2.6.29.1内核中没有提供合适的ADC驱动和触摸屏驱动,所以这里就直接用友善提供的驱动s3c2410_ts.c / mini2440_adc.c / s3c24xx-adc.h

2 将驱动源码拷到内核驱动相应目录中

# cp s3c2410_ts.c linux-2.6.29.1/drivers/input/touchscreen/

# cp mini2440_adc.c  s3c24xx-adc.h  /linux-2.6.29.1/drivers/char/

3. 修改驱动目录KconfigMakefile

#vim linux-2.6.29.1/drivers/char/Kconfig  //添加如下内容

config UTU2440_ADC

    bool "ADC device for utu2440"

default y

 

#vim linux-2.6.29.1/drivers/char/Makefile  //添加如下内容

obj-$(CONFIG_UTU2440_ADC)  += mini2440_adc.o

 

#vim linux-2.6.29.1/drivers/input/touchscreen/Kconfig  //添加如下内容

config TOUCHSCREEN_UTU2440

    tristate "UTU2440 touchscreens input driver"

    default y

 

config TOUCHSCREEN_UTU2440_DEBUG

    boolean "UTU2440 touchscreens input driver debug messages"

    depends on TOUCHSCREEN_UTU2440

    help

        Select this if you want debug messages

 

#vim linux-2.6.29.1/drivers/input/touchscreen/Makefile  //添加如下内容

obj-$(CONFIG_TOUCHSCREEN_UTU2440) += s3c2410_ts.o

 

4. 配置内核

System Type --->

       [*] ADC common driver support

 

Device Drivers  --->

       Character devices  --->

              [*] ADC device for utu2440

       Input device support  --->

(240)         Horizontal screen resolution

(320)         Vertical screen resolution

<*>   Event interface

<*>   Event debugging

[*]   Touchscreens  --->

       <*>   UTU2440 touchscreens input driver

       [*]     UTU2440 touchscreens input driver debug messages

 

5. 编译内核并下载到开发板上,从启动信息可以看到触摸屏驱动加载成功

 

6. 创建触摸屏设备节点并测试。由启动信息得知触摸屏设备为输入类设备,如下图操作可以得知输入类设备的主设备号为13,又查看总线的具体输入设备可得知该设备的详细信息,根据这些信息我们建立好设备节点,设置内核调试级别为8,然后打开触摸屏设备,点击触摸屏,此时可以看到打印的坐标信息,即触摸屏可正常使用了

    

参考资料:

[1] http://blog.chinaunix.net/u3/101649/showart_2085414.html

 

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