新闻中心

EEPW首页>嵌入式系统>设计应用> 触摸屏的移植(s3c2410)

触摸屏的移植(s3c2410)

作者: 时间:2016-11-21 来源:网络 收藏
触摸屏驱动的名称:

dev/mounse0我们看一下/proc/devices

本文引用地址://m.amcfsurvey.com/article/201611/319122.htm

# cat /proc/devices
Character devices:
……

6 lp
7 vcs
10 misc
13 input
29 fb
90 mtd
……

查看触摸屏:

cat /proc/interrupts

……

53:596s3c-exteth0
60:1s3c-exts3c-mci
70:28s3c-uart0s3c2410-uart
71:832s3c-uart0s3c2410-uart
79:16s3c-adcs3c2410_action
80:7892s3c-adcs3c2410_action

具体的移植过程:

1:安放驱动文件

把s3c2410_ts.c放到drivers/input/touchscreen下。

把ts.h放到include/asm-arm/arch-s3c2410


2:修改drivers/input/touchscreen/Kconfig

添加下列信息

config TOUCHSCREEN_S3C2410

tristate "Samsung S3C2410 touchscreen input driver"

depends on ARCH_S3C2410 && 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 calleds3c2410_ts.

config TOUCHSCREEN_S3C2410_DEBUG

boolean "Samsung S3C2410 touchscreen debug messages"

depends on TOUCHSCREEN_S3C2410

help

Select this if you want debug messages


3:修改drivers/input/touchscreen/Makefile

添加下列信息

obj-$(CONFIG_TOUCHSCREEN_S3C2410)
+= s3c2410_ts.o

4:把s3c2410_ts.c里的
#include
改成
#include

5:修改arch/arm/plat-s3c24xx/devs.c文件

添加头文件

#include

添加

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 __init 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);


6:修改include/asm-arm/plat-s3c24xx/devs.h

在include/asm-arm/plat-s3c24xx/devs.h下添加:

extern struct platform_device s3c_device_ts;


7:修改arch/arm/mach-s3c2410/mach-s3c2410.c文件

添加头文件

#include

添加

static struct s3c2410_ts_mach_info s3c2410_ts_cfg __initdata = {

.delay = 10000,

.presc = 49,

.oversampling_shift = 2,

};

在static struct platform_device *smdk2410_devices[] __initdata结构体中添加

&s3c_device_ts,

在static void __init smdk2410_init(void)函数中添加

set_s3c2410ts_info(&s3c2410_ts_cfg);

这样就OK了,然后记得配置内核.make zImage



关键词:触摸屏移植s3c241

评论


技术专区

关闭