From 9c46bb6969949e9522628b243ac70bc5c3e4b193 Mon Sep 17 00:00:00 2001 From: xubilv Date: Thu, 18 Jun 2015 11:38:19 +0800 Subject: [PATCH] RK3368: TP: use dts to control the difference between GT9XX. Signed-off-by: xubilv --- drivers/input/touchscreen/gt9xx/Kconfig | 13 ---------- drivers/input/touchscreen/gt9xx/gt9xx.c | 34 +++++++++++++++---------- drivers/input/touchscreen/gt9xx/gt9xx.h | 1 + 3 files changed, 21 insertions(+), 27 deletions(-) delete mode 100755 drivers/input/touchscreen/gt9xx/Kconfig diff --git a/drivers/input/touchscreen/gt9xx/Kconfig b/drivers/input/touchscreen/gt9xx/Kconfig deleted file mode 100755 index 25ea14734597..000000000000 --- a/drivers/input/touchscreen/gt9xx/Kconfig +++ /dev/null @@ -1,13 +0,0 @@ -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/gt9xx.c b/drivers/input/touchscreen/gt9xx/gt9xx.c index 90d96693212f..1fa511ff8951 100755 --- a/drivers/input/touchscreen/gt9xx/gt9xx.c +++ b/drivers/input/touchscreen/gt9xx/gt9xx.c @@ -410,15 +410,15 @@ 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; - } - - if(mGtp_Y_Reverse){ - y = ts->abs_y_max - y; - } -#endif + if (!bgt911) { + if(mGtp_X_Reverse){ + x = ts->abs_x_max - x; + } + + if(mGtp_Y_Reverse){ + y = ts->abs_y_max - y; + } + } #if GTP_ICS_SLOT_REPORT input_mt_slot(ts->input_dev, id); @@ -1419,11 +1419,11 @@ static s32 gtp_init_panel(struct goodix_ts_data *ts) 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 + + if (bgt911) { + send_cfg_buf[0] = gtp_dat_gt11; + cfg_info_len[0] = CFG_GROUP_LEN(gtp_dat_gt11); + } GTP_DEBUG_FUNC(); GTP_DEBUG("Config Groups\' Lengths: %d, %d, %d, %d, %d, %d", @@ -2580,6 +2580,12 @@ static int goodix_ts_probe(struct i2c_client *client, const struct i2c_device_id mGtpChange_X2Y = TRUE; mGtp_X_Reverse = TRUE; mGtp_Y_Reverse = FALSE; + } else if (val == 911) { + m89or101 = FALSE; + bgt911 = TRUE; + mGtpChange_X2Y = TRUE; + mGtp_X_Reverse = FALSE; + mGtp_Y_Reverse = TRUE; } ts->irq_pin = of_get_named_gpio_flags(np, "touch-gpio", 0, (enum of_gpio_flags *)(&ts->irq_flags)); diff --git a/drivers/input/touchscreen/gt9xx/gt9xx.h b/drivers/input/touchscreen/gt9xx/gt9xx.h index 22e0fb3ca6fa..05e707234b67 100755 --- a/drivers/input/touchscreen/gt9xx/gt9xx.h +++ b/drivers/input/touchscreen/gt9xx/gt9xx.h @@ -391,6 +391,7 @@ u8 gtp_dat_gt11[] = { #define FALSE 0 bool m89or101 = TRUE; +bool bgt911 = FALSE; bool mGtpChange_X2Y = TRUE; //GTP_CHANGE_X2Y 1 bool mGtp_X_Reverse = FALSE; //GTP_X_REVERSE_ENABLE bool mGtp_Y_Reverse = TRUE; //GTP_Y_REVERSE_ENABLE -- 2.34.1