From 4b65c867cb94e2c4f726637f4706ae5a432c002e Mon Sep 17 00:00:00 2001 From: xubilv Date: Mon, 18 May 2015 10:10:06 +0800 Subject: [PATCH] 3368sdk: TP: Support GT911. Signed-off-by: xubilv --- drivers/input/touchscreen/Kconfig | 2 ++ drivers/input/touchscreen/gt9xx/Kconfig | 13 +++++++++++++ ...89006B_GT911_Config_20140625_085816_0X43.cfg | 1 + drivers/input/touchscreen/gt9xx/gt9xx.c | 17 +++++++++++++---- drivers/input/touchscreen/gt9xx/gt9xx.h | 6 ++++++ 5 files changed, 35 insertions(+), 4 deletions(-) create mode 100755 drivers/input/touchscreen/gt9xx/Kconfig create mode 100755 drivers/input/touchscreen/gt9xx/WGJ89006B_GT911_Config_20140625_085816_0X43.cfg mode change 100644 => 100755 drivers/input/touchscreen/gt9xx/gt9xx.c mode change 100644 => 100755 drivers/input/touchscreen/gt9xx/gt9xx.h diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig index 45787d918a33..d25e45205830 100755 --- a/drivers/input/touchscreen/Kconfig +++ b/drivers/input/touchscreen/Kconfig @@ -38,6 +38,8 @@ config TOUCHSCREEN_GT9XX code includes that in its table of IIC devices. If unsure, say N. +source "drivers/input/touchscreen/gt9xx/Kconfig" + config TOUCHSCREEN_CT36X_TS tristate "CT36X touchscreens support" diff --git a/drivers/input/touchscreen/gt9xx/Kconfig b/drivers/input/touchscreen/gt9xx/Kconfig new file mode 100755 index 000000000000..25ea14734597 --- /dev/null +++ b/drivers/input/touchscreen/gt9xx/Kconfig @@ -0,0 +1,13 @@ +if TOUCHSCREEN_GT9XX + +config GT911 + bool "GT911 Support" + default n + + ---help--- + Say Y here if you have a touchscreen interface using the + two goodix gt911, and your board-specific initialization + code includes that in its table of IIC devices. + If unsure, say N. + +endif diff --git a/drivers/input/touchscreen/gt9xx/WGJ89006B_GT911_Config_20140625_085816_0X43.cfg b/drivers/input/touchscreen/gt9xx/WGJ89006B_GT911_Config_20140625_085816_0X43.cfg new file mode 100755 index 000000000000..1c42d9ef7ce1 --- /dev/null +++ b/drivers/input/touchscreen/gt9xx/WGJ89006B_GT911_Config_20140625_085816_0X43.cfg @@ -0,0 +1 @@ +0x43,0x00,0x10,0x00,0x10,0x0A,0x3D,0x20,0x01,0x08,0x28,0x08,0x50,0x32,0x03,0x05,0x00,0x00,0x00,0x00,0x11,0x00,0x00,0x18,0x1A,0x20,0x14,0x8C,0x2E,0x0E,0x3C,0x3E,0x0C,0x08,0x00,0x00,0x00,0x41,0x03,0x1D,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x5A,0x94,0xC5,0x02,0x08,0x00,0x00,0x04,0xA0,0x36,0x00,0x8B,0x3C,0x00,0x7C,0x43,0x00,0x6B,0x4C,0x00,0x5F,0x55,0x00,0x5F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x04,0x06,0x08,0x0A,0x0C,0x0E,0x10,0x12,0x14,0x16,0x18,0x1A,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x04,0x06,0x08,0x0A,0x0C,0x0F,0x10,0x12,0x13,0x14,0x16,0x18,0x1C,0x1D,0x1E,0x1F,0x2A,0x29,0x28,0x26,0x24,0x22,0x21,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0x01 \ No newline at end of file diff --git a/drivers/input/touchscreen/gt9xx/gt9xx.c b/drivers/input/touchscreen/gt9xx/gt9xx.c old mode 100644 new mode 100755 index c54055f11f5e..90d96693212f --- a/drivers/input/touchscreen/gt9xx/gt9xx.c +++ b/drivers/input/touchscreen/gt9xx/gt9xx.c @@ -410,6 +410,7 @@ static void gtp_touch_down(struct goodix_ts_data* ts,s32 id,s32 x,s32 y,s32 w) GTP_SWAP(x, y); } +#ifndef CONFIG_GT911 if(mGtp_X_Reverse){ x = ts->abs_x_max - x; } @@ -417,6 +418,7 @@ static void gtp_touch_down(struct goodix_ts_data* ts,s32 id,s32 x,s32 y,s32 w) if(mGtp_Y_Reverse){ y = ts->abs_y_max - y; } +#endif #if GTP_ICS_SLOT_REPORT input_mt_slot(ts->input_dev, id); @@ -1347,6 +1349,7 @@ static s32 gtp_get_info(struct goodix_ts_data *ts) //ts->abs_x_max = GTP_MAX_WIDTH; //ts->abs_y_max = GTP_MAX_HEIGHT; + ts->int_trigger_type = GTP_INT_TRIGGER; opr_buf[0] = (u8)((GTP_REG_CONFIG_DATA+1) >> 8); @@ -1395,7 +1398,7 @@ static s32 gtp_init_panel(struct goodix_ts_data *ts) u8 check_sum = 0; u8 opr_buf[16] = {0}; u8 sensor_id = 0; - + u8 cfg_info_group2[] = CTP_CFG_GROUP2; u8 cfg_info_group3[] = CTP_CFG_GROUP3; u8 cfg_info_group4[] = CTP_CFG_GROUP4; @@ -1411,12 +1414,17 @@ static s32 gtp_init_panel(struct goodix_ts_data *ts) CFG_GROUP_LEN(cfg_info_group6)};; GTP_INFO(" <%s>_%d \n", __func__, __LINE__); - + if(m89or101){ send_cfg_buf[0] = gtp_dat_8_9; cfg_info_len[0] = CFG_GROUP_LEN(gtp_dat_8_9); } - + +#ifdef CONFIG_GT911 + send_cfg_buf[0] = gtp_dat_gt11; + cfg_info_len[0] = CFG_GROUP_LEN(gtp_dat_gt11); +#endif + GTP_DEBUG_FUNC(); GTP_DEBUG("Config Groups\' Lengths: %d, %d, %d, %d, %d, %d", cfg_info_len[0], cfg_info_len[1], cfg_info_len[2], cfg_info_len[3], @@ -2561,6 +2569,7 @@ static int goodix_ts_probe(struct i2c_client *client, const struct i2c_device_id dev_err(&client->dev, "no max-x defined\n"); return -EINVAL; } + if(val == 89){ m89or101 = TRUE; mGtpChange_X2Y = TRUE; @@ -2572,6 +2581,7 @@ static int goodix_ts_probe(struct i2c_client *client, const struct i2c_device_id mGtp_X_Reverse = TRUE; mGtp_Y_Reverse = FALSE; } + ts->irq_pin = of_get_named_gpio_flags(np, "touch-gpio", 0, (enum of_gpio_flags *)(&ts->irq_flags)); ts->rst_pin = of_get_named_gpio_flags(np, "reset-gpio", 0, &rst_flags); ts->pwr_pin = of_get_named_gpio_flags(np, "power-gpio", 0, &pwr_flags); @@ -3081,7 +3091,6 @@ static void goodix_ts_exit(void) destroy_workqueue(goodix_wq); } } - //late_initcall(goodix_ts_init); module_init(goodix_ts_init); diff --git a/drivers/input/touchscreen/gt9xx/gt9xx.h b/drivers/input/touchscreen/gt9xx/gt9xx.h old mode 100644 new mode 100755 index 873b93bccf9d..22e0fb3ca6fa --- a/drivers/input/touchscreen/gt9xx/gt9xx.h +++ b/drivers/input/touchscreen/gt9xx/gt9xx.h @@ -208,6 +208,12 @@ extern u16 total_len; } */ +/*CFG for GT911*/ +u8 gtp_dat_gt11[] = { +/* <1200, 1920>*/ +#include "WGJ89006B_GT911_Config_20140625_085816_0X43.cfg" +}; + //WGJ10187_GT9271_Config_20140623_104014_0X41.cfg #define CTP_CFG_GROUP1 {\ 0x41,0x80,0x07,0xB0,0x04,0x0A,0x05,0x00,0x01,0x08,0x28,0x0F,0x50,0x32,0x03, \ -- 2.34.1