歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> Linux編程 >> Linux 2.6.36.2 S3C6410 觸摸屏驅動移植

Linux 2.6.36.2 S3C6410 觸摸屏驅動移植

日期:2017/3/1 10:21:56   编辑:Linux編程

硬件環境: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 () 結構體中

  1. //s3c24xx_ts_set_platdata(&s3c_ts_platform); // cancel by acanoe
  2. s3c_ts_set_platdata(&s3c_ts_platform); // add by acanoe

4、在s3c_ts_platform 結構體中添加

  1. static struct s3c_ts_mach_info s3c_ts_platform __initdata = { // fix by canoe
  2. .delay = 10000,
  3. .presc = 49,
  4. .oversampling_shift = 2,
  5. .resol_bit = 12, //add by acanoe
  6. .s3c_adc_con = ADC_TYPE_2, //add by acanoe
  7. };

5、修改 drivers/input/touchscreen/Makefile
添加 obj-$(CONFIG_TOUCHSCREEN_S3C) += s3c-ts.o
6、修改 drivers/input/tourch/screen/Kconfig
添加 config TOUCHSCREEN_S3C

  1. config TOUCHSCREEN_S3C
  2. tristate "S3C touchscreen driver"
  3. depends on ARCH_S3C2410 || ARCH_S3C64XX || ARCH_S5P64XX || ARCH_S5PC1XX
  4. default y
  5. help
  6. Say Y here to enable the driver for the touchscreen on the
  7. S3C SMDK board.
  8. If unsure, say N.
  9. To compile this driver as a module, choose M here: the
  10. 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

Copyright © Linux教程網 All Rights Reserved