GT911 touch controller not working with imx8mm

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GT911 touch controller not working with imx8mm

Jump to solution
11,965 Views
anushan
Contributor III

Hello Everyone,

I have integrated a gt911 touch controller on the imx8mm custom board.

My device tree parameters are correct and my driver is goodix.c from the kernel source code.

I have gone through the thread IMX8 & Goodix GT911 touchscreen  but did not find it useful.

Please suggest how to overcome i2c communication failure(error code -6) from the driver.

I am able to access the i2c device at address 0x5d from user space, but not through driver.

I have attached the datasheet of gt911 touch controller.

Thank you

Labels (1)
1 Solution
11,310 Views
igorpadykov
NXP Employee
NXP Employee

Hi Anusha

gt911 example can be found on boundary devices nitrogen8mm board:

linux-imx6/imx8mmn-nitrogen8mm.dtsi at boundary-imx_4.14.x_2.0.0_ga · boundarydevices/linux-imx6 · G... 

One can check i2c signals with oscilloscope, debug touchscreen driver in probe function

goodix.c\touchscreen\input\drivers - linux-imx - i.MX Linux kernel 

May be useful to check if i2c clocks are enabled with CCM_CCGR23-26 registers.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
6 Replies
11,311 Views
igorpadykov
NXP Employee
NXP Employee

Hi Anusha

gt911 example can be found on boundary devices nitrogen8mm board:

linux-imx6/imx8mmn-nitrogen8mm.dtsi at boundary-imx_4.14.x_2.0.0_ga · boundarydevices/linux-imx6 · G... 

One can check i2c signals with oscilloscope, debug touchscreen driver in probe function

goodix.c\touchscreen\input\drivers - linux-imx - i.MX Linux kernel 

May be useful to check if i2c clocks are enabled with CCM_CCGR23-26 registers.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
6,144 Views
jacoblindberg
Contributor I
do you know if there is anything that needs to be changed in this code block to satisfy the imx8m nano instead of the imx8mm which is what this post chat thread is about?
0 Kudos
Reply
11,310 Views
anushan
Contributor III

Hi Sir,

After changing the pad control value as 0x1d6 for interrupt pin and 0x149 for reset pin it worked at once like a charm.

Thank you very much for your support.:smileyhappy:

Regards

Anusha

11,310 Views
e_kotsarev
Contributor II

WOW thank you a lot. I've tried a lot of values! 

imx8m mini

RST(IRQ) GPIO1_IO24

RESET(INT) GPIO1_IO26

Goodix GT911

uboot
+    IMX8MM_PAD_ENET_RX_CTL_GPIO1_IO24 | MUX_PAD_CTRL(0x1d6),      // IRQ TOUCH
+    IMX8MM_PAD_ENET_RD0_GPIO1_IO26 | MUX_PAD_CTRL(0x149),         // RESET TOUCH

+++ b/arch/arm64/boot/dts/freescale/fsl-imx8mm-evk-rm67191.dts
@@ -18,14 +18,14 @@
};
 
&i2c4 {
-       synaptics_dsx_ts@20 {
-               compatible = "synaptics_dsx";
-               reg = <0x20>;
-               pinctrl-names = "default";
-               pinctrl-0 = <&pinctrl_i2c4_synaptics_dsx_io>;
-               interrupt-parent = <&gpio1>;
-               interrupts = <24 IRQ_TYPE_LEVEL_LOW>;
-               synaptics,diagonal-rotation;
-               status = "okay";
+        touchscreen@14 {
+        compatible = "goodix,gt911";
+        reg = <0x14>;
+        pinctrl-names = "default";
+        pinctrl-0 = <&ts_reset_pin>;
+        interrupt-parent = <&gpio1>;
+        interrupts = <24 IRQ_TYPE_EDGE_FALLING>;
+        irq-gpios = <&gpio1 24 GPIO_ACTIVE_HIGH>;
+        reset-gpios = <&gpio1 26 GPIO_ACTIVE_HIGH>;
       };
};
diff --git a/arch/arm64/boot/dts/freescale/fsl-imx8mm-evk.dts b/arch/arm64/boot/dts/freescale/fsl-imx8mm-evk.dts
index ca917eb02eec..69603e6fdcf1 100644
--- a/arch/arm64/boot/dts/freescale/fsl-imx8mm-evk.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-imx8mm-evk.dts
@@ -71,9 +71,10 @@
                       >;
               };
 
-               pinctrl_i2c4_synaptics_dsx_io: synaptics_dsx_iogrp {
+               ts_reset_pin: goodix_dsx_iogrp {
                       fsl,pins = <
-                               MX8MM_IOMUXC_ENET_RX_CTL_GPIO1_IO24             0x159   /* Touch int */
+                               MX8MM_IOMUXC_ENET_RX_CTL_GPIO1_IO24             0x1d6   /* Touch irq */
+                               MX8MM_IOMUXC_ENET_RD0_GPIO1_IO26                0x149   /* Touch reset */
                       >;
               };

0 Kudos
Reply
6,147 Views
jacoblindberg
Contributor I
can you explain how you find the values 0x1d6 and 0x149? I am trying to do the exact same thing but for the imx8m nano
0 Kudos
Reply
11,310 Views
anushan
Contributor III

Hi Евгений Коцарев,

Did it work for you?

0 Kudos
Reply