Linux 2.6.36.2 S3C6410 触摸屏驱动移植
Linux 2.6.36.2 S3C6410 触摸屏驱动移植
硬件环境:OK6410 A板,4.3 寸TFT 屏。 移植内核:Linux2.6.36.2 。 参考内核: 飞凌提供Linux2.6.36.2。
操作记录:
一、ts 驱动移植
以下copy 是指需要飞凌提供的内核里的驱动源码, dev-ts.c ts 板载初始化和platform 资源初始化 文件。
arch/arm/mach-s3c64xx/mach-smdk6410.c
1、注销掉头文件 #include<plat/ts.h>
2、添加头文件 #include<mach/ts.h>
2.1 copy arch/arm/mach-s3c64xx/include/mach/ts.h 到目标内核目录
2.2 copy arch/arm/mach-s3c64xx/dev-ts.c 到目标内核目录
2.3 在 arch/arm/mach-s3c64xx/Makefile 中添加
obj-$(CONFIG_TOUCHSCREEN_S3C) += dev-ts.o
注销掉原有的
#obj-$(CONFIG_TOUCHSCREEN_TS) += dev-ts.o
3、添加 ts 设备初始化 ,在smdk6410_machine_init () 结构体中
- //s3c24xx_ts_set_platdata(&s3c_ts_platform); // cancel by acanoe
- s3c_ts_set_platdata(&s3c_ts_platform); // add by acanoe
4、在s3c_ts_platform 结构体中添加
- static struct s3c_ts_mach_info s3c_ts_platform __initdata = { // fix by canoe
- .delay = 10000,
- .presc = 49,
- .oversampling_shift = 2,
- .resol_bit = 12, //add by acanoe
- .s3c_adc_con = ADC_TYPE_2, //add by acanoe
- };
5、修改 drivers/input/touchscreen/Makefile
添加 obj-$(CONFIG_TOUCHSCREEN_S3C) += s3c-ts.o
6、修改 drivers/input/tourch/screen/Kconfig
添加 config TOUCHSCREEN_S3C
- config TOUCHSCREEN_S3C
- tristate "S3C touchscreen driver"
- depends on ARCH_S3C2410 || ARCH_S3C64XX || ARCH_S5P64XX || ARCH_S5PC1XX
- default y
- help
- Say Y here to enable the driver for the touchscreen on the
- S3C SMDK board.
- If unsure, say N.
- To compile this driver as a module, choose M here: the
- module will be called s3c_ts.
7、配置内核 make menuconfig
Device Drivers--> Input Device support-->[ * ]Touchscreens -->[ * ]S3C Touchscreen driver
8、编译内核 make zImage
9、下载启动内核的正确打印信息为:
SB Serial support registered for pl2303
usbcore: registered new interface driver pl2303
pl2303: Prolific PL2303 USB to serial adaptor driver
mice: PS/2 mouse device common for all mice
S3C Touchscreen driver, (c) 2008 Samsung Electronics // touchscreen 驱动启动正常。
S3C TouchScreen got loaded successfully : 12 bits
input: S3C TouchScreen as /class/input/input0
S3C24XX RTC, (c) 2004,2006 Simtec Electronics
s3c-rtc s3c64xx-rtc: rtc disabled, re-enabling
s3c-rtc s3c64xx-rtc: rtc core: registered s3c as rtc0
i2c /dev entries driver
lirc_dev: IR Remote Control driver registered, major 253
|
评论暂时关闭