全部博文(92)
分类: 嵌入式
2010-05-14 20:44:57
触摸屏驱动移植
内核里没有完善的触摸屏驱动,可以用我们提供的触摸屏驱动
有三个文件:s3c2410_ts.c, s3c2440_adc.c, s3c2440adc.h
(在光盘资料/源码包/驱动源码/触摸屏驱动)
将s3c2410_ts.c拷贝到drivers/input/touchscreen目录下,修改该目录下Kconfig文件,在第14行加入:
config TOUCHSCREEN_S3C2410
tristate "Samsung S3C2410 touchscreen input driver"
depends on INPUT && S3C2440_ADC
help
Say Y here if you have the s3c2410 touchscreen.
If unsure, say N.
To compile this driver as a module, choose M here: the
module will be called s3c2410_ts.
修改同目录下Makefile文件,在第9行加入:
obj-$(CONFIG_TOUCHSCREEN_S3C2410) += s3c2410_ts.o
将s3c2440_adc.c, s3c2440adc.h拷贝到drivers/char目录下,修改同目录下
Kconfig文件,在第7行加入:
config S3C2440_ADC
bool "ADC driver for S3C2440 development boards"
help
this is ADC driver for S3C2440 development boards
Notes: the touch-screen-driver required this option
修改同目录下Makefile文件,在第12行加入:
obj-$(CONFIG_S3C2440_ADC) += s3c2440_adc.o
配置内核,支持触摸屏:
Device Drivers --->
Character devices --->
[*] ADC driver for S3C2440 development boards
Input devices support --->
<*> Event interface
[*] Touchscreens --->
<*> Samsung S3C2410 touchscreen input driver
出现问题:
[root@localhost linux-2.6.31]# make zImage
CHK include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.
CHK include/linux/utsrelease.h
SYMLINK include/asm -> include/asm-arm
CALL scripts/checksyscalls.sh
CHK include/linux/compile.h
AS .tmp_kallsyms1.o
LD .tmp_vmlinux2
KSYM .tmp_kallsyms2.S
/bin/sh: line 1: arm-linux-nm: command not found
No valid symbol.
make: *** [.tmp_kallsyms2.S] Error 1
解决办法:
#Vim /etc/profile
(将其他编辑链也加进来)
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC
export PATH=/usr/local/arm/3.3.2/bin:$PATH
export PATH=/usr/local/arm/2.95.3/bin:$PATH
export PATH=/usr/local/arm/4.3.2/bin:$PATH
export PATH=/opt/toolchains/arm920t-eabi/bin:$PATH
成功启动输出:
s3c2410 TouchScreen successfully loaded
input: s3c2410 TouchScreen as /class/input/input0