硬件平台:IMX6Q+GT928(10.1寸) 操作系统:Android 4.2.2
GT928接口原理图
触摸屏接口用到的硬件外设 I2C => I2C3 RST => GPIO2_27 INT => GPIO6_8
注册GT928 i2c设备
static struct i2c_board_info mxc_i2c2_board_info[] __initdata = { { I2C_BOARD_INFO("sgtl5000", 0x0a), }, { I2C_BOARD_INFO("ov564x", 0x3c), .platform_data = (void *)&camera_data, }, { I2C_BOARD_INFO("mxc_hdmi_i2c", 0x50), }, { I2C_BOARD_INFO("Goodix-TS", 0x14), // .irq = gpio_to_irq(SABRESD_CAP_TCH_INT0), }, };修改gt9xx.h对rst和int脚的定义
#define GTP_RST_PORT IMX_GPIO_NR(2, 27) #define GTP_INT_PORT IMX_GPIO_NR(6, 8)修改touchscreen驱动Makefile
ifneq ($(wildcard drivers/input/touchscreen/gt9xx.c),) obj-$(CONFIG_TOUCHSCREEN_GT9XX) += gt9xx.o gt9xx_update.o goodix_tool.o else obj-$(CONFIG_TOUCHSCREEN_GT9XX) += gt9xx.module gt9xx_update.module goodix_tool.module endif修改touchscreen驱动Kconfig
config TOUCHSCREEN_TSC2007 tristate "TSC2007 based touchscreens" depends on I2C help Say Y here if you have a TSC2007 based touchscreen. If unsure, say N. To compile this driver as a module, choose M here: the module will be called tsc2007. config TOUCHSCREEN_GT9XX tristate "GT9XX based touchscreens" depends on I2C help Say Y here if you have a Gt9xx based touchscreen. If unsure, say N. To compile this driver as a module, choose M here: the module will be called gt9xx.配置内核
gt928驱动下载地址 附上调试信息
