[RK3399][Android7.1] 移植笔记 --- GT9XX系列Touch添加

Platform: RK3399
OS: Android 7.1
Kernel: v4.4.83

原理图:

[RK3399][Android7.1] 移植笔记 --- GT9XX系列Touch添加_第1张图片

[RK3399][Android7.1] 移植笔记 --- GT9XX系列Touch添加_第2张图片

1.使用的是I2C3
2.TOUCH_RST_L对应GPIO是GPIO4_C6
3.TOUCH_INT_L对应GPIO是GPIO4_C7
4.电源默认上电提供
5.原理图上I2C在画图时候忘记上拉了


驱动移植:

DTS配置:

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-ecovacs.dts b/arch/arm64/boot/dts/rockchip/rk3399-ecovacs.dts
index aab6d0f..68cde12 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-ecovacs.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-ecovacs.dts
@@ -607,6 +607,42 @@
    };
 };

+//Kris,180702, add GT9XX touch.
+&i2c3 {
+   status = "okay";
+   i2c-scl-rising-time-ns = <345>;
+   i2c-scl-falling-time-ns = <11>;
+   clock-frequency = <400000>;
+
+   ts@14 {
+       compatible = "goodix,gt9xx";
+       reg = <0x14>;
+       //GPIO4_C7
+       goodix,irq-gpio = <&gpio4 23 IRQ_TYPE_LEVEL_LOW>;
+       //GPIO4_C6
+       goodix,rst-gpio = <&gpio4 22 GPIO_ACTIVE_LOW>;
+       goodix,cfg-group3 = [
+               42 00 08 00 06 0A 3D 00 01 0F 28
+               0F 50 32 03 05 00 00 00 00 00 00
+               04 18 1A 1E 14 90 30 CC 15 17 31
+               0D 00 00 01 83 03 2D 00 00 00 00
+               00 00 00 00 00 00 00 0F 2D 94 C5
+               02 07 00 00 04 A0 10 00 85 14 00
+               6B 1A 00 5B 20 00 4E 28 00 4E 00
+               00 00 00 00 00 00 00 00 00 00 00
+               00 00 00 00 00 00 00 00 00 00 00
+               00 00 00 00 00 00 00 00 00 00 00
+               00 00 1D 1C 1B 1A 19 18 17 16 15
+               14 11 10 0F 0E 0D 0C 09 08 07 06
+               05 04 01 00 00 00 00 00 00 00 2A
+               29 28 27 26 25 24 23 22 21 20 1F
+               1E 1C 1B 19 14 13 12 11 10 0F 0E
+               0D 0C 0A 08 07 06 04 02 00 00 00
+               00 00 00 00 00 00 00 00 8A 01];
+       status = "okay";
+   };
+};
+
 &i2c4 {
    status = "okay";
    i2c-scl-rising-time-ns = <345>;
@@ -625,21 +661,10 @@
 };

 &i2c5 {
-   status = "okay";
+   status = "disabled";
    i2c-scl-rising-time-ns = <150>;
    i2c-scl-falling-time-ns = <30>;
    clock-frequency = <400000>;
-
-   gt9xx: gt9xx@14 {
-       compatible = "goodix,gt9xx";
-       reg = <0x14>;
-       touch-gpio = <&gpio3 12 IRQ_TYPE_LEVEL_LOW>;
-       reset-gpio = <&gpio3 13 GPIO_ACTIVE_HIGH>;
-       max-x = <1536>;
-       max-y = <2048>;
-       tp-size = <970>;
-       tp-supply = <&vcc3v0_tp>;
-   };
 };

defconfig:

diff --git a/arch/arm64/configs/rockchip_defconfig b/arch/arm64/configs/rockchip_defconfig
index b4366b2..f96e5a6 100644
--- a/arch/arm64/configs/rockchip_defconfig
+++ b/arch/arm64/configs/rockchip_defconfig
@@ -370,10 +370,11 @@ CONFIG_TABLET_USB_GTCO=y
 CONFIG_TABLET_USB_HANWANG=y
 CONFIG_TABLET_USB_KBTAB=y
 CONFIG_INPUT_TOUCHSCREEN=y
-CONFIG_TOUCHSCREEN_GSLX680_PAD=y
-CONFIG_TOUCHSCREEN_GSLX680_VR=y
-CONFIG_TOUCHSCREEN_GSL3673=y
-CONFIG_TOUCHSCREEN_GT9XX=y
+#Kris,180702, add GT9XX touch driver.
+#CONFIG_TOUCHSCREEN_GSLX680_PAD=y
+#CONFIG_TOUCHSCREEN_GSLX680_VR=y
+#CONFIG_TOUCHSCREEN_GSL3673=y
+#CONFIG_TOUCHSCREEN_GT9XX=y
 CONFIG_ROCKCHIP_REMOTECTL=y
 CONFIG_ROCKCHIP_REMOTECTL_PWM=y
 CONFIG_SENSOR_DEVICE=y

Makefile:

diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile
index bec6526..111af55 100644
--- a/drivers/input/touchscreen/Makefile
+++ b/drivers/input/touchscreen/Makefile
@@ -6,6 +6,9 @@

 wm97xx-ts-y := wm97xx-core.o

+#Kris,180702, add GT9XX touch driver.
+EXTRA_CFLAGS += -Wno-date-time
+
 obj-$(CONFIG_TOUCHSCREEN_PROPERTIES)  += of_touchscreen.o
 obj-$(CONFIG_TOUCHSCREEN_88PM860X)    += 88pm860x-ts.o
 obj-$(CONFIG_TOUCHSCREEN_AD7877)  += ad7877.o
@@ -97,3 +100,9 @@ obj-$(CONFIG_TOUCHSCREEN_ZFORCE)    += zforce_ts.o
 obj-$(CONFIG_TOUCHSCREEN_COLIBRI_VF50)    += colibri-vf50-ts.o
 obj-$(CONFIG_TOUCHSCREEN_ROHM_BU21023)    += rohm_bu21023.o
 obj-$(CONFIG_TOUCHSCREEN_VTL_CT36X)   += vtl_ts/
+
+#Kris,180702, add GT9XX touch driver.
+obj-y += gt9xx/gt9xx.o
+obj-y += gt9xx/gt9xx_update.o
+obj-y += gt9xx/goodix_tool.o
+

你可能感兴趣的:(RK3399,子类__Touch)