分类: 嵌入式
2012-04-26 13:43:53
嵌入式Linux-2.6.32移植-触摸屏
主机:RHEL6.0(2.6.32-220.2.1.el6.i686)
开发板:FL2440
编译器:arm-unknown-linux-gnueabi-gcc-4.4.6
1.拷贝s3c2410_ts.c到linux-2.6.32.59/drivers/input/touchscreen
2.修改drivers/input/touchscreen/Makefile文件,添加如下:
obj-$(CONFIG_TOUCHSCREEN_S3C2410) += s3c2410_ts.o
3. 修改drivers/input/touchscreen/Kconfig文件,添加如下:
config TOUCHSCREEN_S3C2410
tristate "Samsung S3C2410 touchscreen input driver"
depends on ARCH_S3C2440 && INPUT && INPUT_TOUCHSCREEN
select SERIO
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.
config TOUCHSCREEN_S3C2410_DEBUG
boolean "Samsung S3C2410 touchscreen debug messages"
depends on TOUCHSCREEN_S3C2410
help
Select this if you want debug messages
4.注册ts设备
@@@arch/arm/mach-s3c2440/mach-smdk2440.c
##添加头文件
#include
##添加设备信息
/*Config for TouchScreen*/
static struct s3c2410_ts_mach_info smdk2410_ts_cfg __initdata = {
.delay = 20000,
.presc = 49,
.oversampling_shift = 2,
};
##注册设备
&s3c_device_iis,
+ &s3c_device_ts,
##添加到初始化
s3c24xx_fb_set_platdata(&smdk2440_fb_info);
+ set_s3c2410ts_info(&smdk2410_ts_cfg);
#增加平台信息
@@@arch/arm/plat-s3c24xx/devs.c
##增加头文件
#include
##增加函数
/* Touchscreen */
struct platform_device s3c_device_ts = {
.name = "s3c2410-ts",
.id = -1,
};
EXPORT_SYMBOL(s3c_device_ts);
static struct s3c2410_ts_mach_info s3c2410ts_info;
void set_s3c2410ts_info(struct s3c2410_ts_mach_info *hard_s3c2410ts_info)
{
memcpy(&s3c2410ts_info,hard_s3c2410ts_info,sizeof(struct s3c2410_ts_mach_info));
s3c_device_ts.dev.platform_data = &s3c2410ts_info;
}
EXPORT_SYMBOL(set_s3c2410ts_info);
##在头文件声明
@@@ arch/arm/plat-s3c/include/plat/devs.h
extern struct platform_device s3c_device_usb_hsotg;
+extern struct platform_device s3c_device_ts;
##注册设备名
@@@arch/arm/plat-s3c24xx/s3c244x.c
s3c_device_nand.name = "s3c2440-nand";
+ s3c_device_ts.name = "s3c2440-ts";
s3c_device_usbgadget.name = "s3c2440-usbgadget";
至此,触摸屏设备ts移植成功