Touch screen driver transplantation based on s3c2410

Publisher:chaochenLatest update time:2016-11-27 Source: eefocusKeywords:s3c2410 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Create a new file s3c2410_ts.c in the linux2.6.14/drivers/input/touchscreen directory. We can refer to similar touch screen drivers for driver files. For specific content, please refer to the source code provided on the website or CD.

   First: modify the makefile file in the linux2.6.14/drivers/input/touchscreen directory and add the following to the end of the file:

obj-$(CONFIG_TOUCHSCREEN_S3C2410) += hfrk_s3c2410_ts.o

Second: Add in linux2.6.14/ drivers/input/touchscreen/Kconfig:

     config TOUCHSCREEN_S

     tristate "Samsung S3C2410 touchscreen input driver"

     depends on ARCH_SMDK2410 && 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

Configure the kernel and select these configurations

Device drivers - to

          Input device support at

                     Touchscreens at

                      <*>Samsung S3C2410 touchscreen input driver

                      []Samsung s3c2410 touchscreen debug message

Third: Add the following content to /linux-2.6.14/arch/arm/mach-s3c2410/mach-smdk2410.c:

     static struct s3c2410_ts_mach_info sbc2410_ts_cfg __initdata = {

     .delay = 10000,

     .almost = 49,

     .oversampling_shift = 2,

     };

     In the smdk2410_devices structure, add:

     &s3c_device_ts,

     Add in smdk2410_map_io function:

     set_s3c2410ts_info(&sbc2410_ts_cfg);

Fourth: Add in the /linux-2.6.14/arch/arm/mach-s3c2410/devs.h file:

     extern struct platform_device s3c_device_ts;

Fifth: Add the following lines to the arch/arm/mach-s3c2410/devs.c file:

    /* Touchscreen */

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

}

EXPORT_SYMBOL(set_s3c2410ts_info);

struct platform_device s3c_device_ts = {

.name = "s3c2410-ts",

.id = -1,

.dev = {

.platform_data = &s3c2410ts_info,

}

};

EXPORT_SYMBOL(s3c_device_ts);

Compile the touch screen driver and register it in the kernel as /dev/input/mouse0


Keywords:s3c2410 Reference address:Touch screen driver transplantation based on s3c2410

Previous article:2.6.26.5 kernel porting based on s3c2410 development board
Next article:The whole process of porting Linux2.4.18 core to s3c2410

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号