新聞中心

        EEPW首頁 > 嵌入式系統 > 設計應用 > 觸摸屏的移植(s3c2410)

        觸摸屏的移植(s3c2410)

        作者: 時間:2016-11-21 來源:網絡 收藏
        觸摸屏驅動的名稱:

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

        本文引用地址:http://www.104case.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: 596 s3c-ext eth0
        60: 1 s3c-ext s3c-mci
        70: 28 s3c-uart0 s3c2410-uart
        71: 832 s3c-uart0 s3c2410-uart
        79: 16 s3c-adc s3c2410_action
        80: 7892 s3c-adc s3c2410_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 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


        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

        評論


        技術專區

        關閉
        主站蜘蛛池模板: 廉江市| 吐鲁番市| 新乡市| 大厂| 策勒县| 太康县| 绍兴市| 绥德县| 鹤壁市| 德保县| 泉州市| 舞阳县| 海南省| 河东区| 安泽县| 海盐县| 滨海县| 榆树市| 高阳县| 陇西县| 邯郸市| 台南县| 镇原县| 荔浦县| 响水县| 连山| 齐河县| 山东| 蓬莱市| 中宁县| 淮阳县| 高碑店市| 北海市| 瑞丽市| 手游| 柳州市| 南溪县| 府谷县| 奇台县| 鹿泉市| 长乐市|