RK3368: TP: use dts to control the difference between GT9XX.
authorxubilv <xbl@rock-chips.com>
Thu, 18 Jun 2015 03:38:19 +0000 (11:38 +0800)
committerxubilv <xbl@rock-chips.com>
Thu, 18 Jun 2015 03:38:19 +0000 (11:38 +0800)
Signed-off-by: xubilv <xbl@rock-chips.com>
drivers/input/touchscreen/gt9xx/Kconfig [deleted file]
drivers/input/touchscreen/gt9xx/gt9xx.c
drivers/input/touchscreen/gt9xx/gt9xx.h

diff --git a/drivers/input/touchscreen/gt9xx/Kconfig b/drivers/input/touchscreen/gt9xx/Kconfig
deleted file mode 100755 (executable)
index 25ea147..0000000
+++ /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
index 90d96693212f2c19ce7cdd1e72c91385e78d843b..1fa511ff8951d72562e194c4530164d0f3798c16 100755 (executable)
@@ -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));
index 22e0fb3ca6fa6638ec6ba5bbc6c97e601f4fee33..05e707234b671a00d6ffc14eb0412f15b4ccae5d 100755 (executable)
@@ -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