GT9271 CPT touch interfacing

Hi,
Good morning.
We need to interface a Capacitive touch interface with our Colibri VF61 .We are using GT9271 Chipset (belongs to Goodix driver) .how to use this driver in our device

Thank you .

hi jojo

which bsp version and carrier board are you using? how do you want to connect your GT9271 CPT touch to colibri vf61.

how to use this driver in our device

what is your device?

We are using Colibri_VF_LinuxImage V2.6 version and custom carrier board. CPT touch is connect with colibri vf61 by using I2c interface

Hi

It looks like the kernel used for Colibri VF does in fact contain a driver for your touchscreen.

You would have to configure the kernel to include the relevant config and adapt the device tree to configure said driver correctly, and then rebuild and deploy kernel/modules/device tree.

Have a look at the commit which added the driver and its documentation.

Max

hi

when Goodix touch driver used in our board ,shows this error

root@colibri-vf:~# dmesg | grep Goodix                                          
[    1.290321] Goodix-TS 0-0014: i2c test failed attempt 1: -11                 
[    1.327106] Goodix-TS 0-0014: i2c test failed attempt 2: -11                 
[    1.367035] Goodix-TS 0-0014: I2C communication failure: -11                 
[    1.379743] Goodix-TS: probe of 0-0014 failed with error -11  

my colibri -eval-v3.dtsi like this

&i2c0 {
	clock-frequency = <400000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c0>;
	status = "okay";
		gt9271@14 {
		compatible = "goodix,gt9271";	
		reg = <0x14>;
		interrupt-parent = <&gpio0>;
		interrupts = <15 IRQ_TYPE_EDGE_FALLING>;
		irq-gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
		reset-gpios =<&gpio0 16 GPIO_ACTIVE_LOW>;
		//reset = <&lcd_reset>;
		//status = "okay";
	};
}

can you help me to find a solution

hi

Could you provide the details (images) about your hardware connection of the GT9271 to your board? Please name to which SODIMM Pin of Module which signal (i2c, reset, interrupt) is connected?

Additionally can you check using i2cdetect if the i2c connection to the cpt touch is working?

hi Jaski

we use Colibri vf61 custom board with Linux angstrom distribution for development purpose. In that case include a 7 " capacitive touch 800x480 densitron display with goodix touch driver( Goodix touchscreen driver(GT9271) with densitron display(DMT070WVNLCMI)). But we can’t successfully install goodix driver in our board.

when booting we see this message.

root@colibri-vf:~# dmesg | grep Goodix                                          
[    1.806835] Goodix-TS 0-0014: i2c test failed attempt 1: -6                  
[    1.846960] Goodix-TS 0-0014: i2c test failed attempt 2: -6                  
[    1.886839] Goodix-TS 0-0014: I2C communication failure: -6 
 
root@colibri-vf:~# dmesg | grep i2c

[    0.143166] i2c i2c-0: IMX I2C adapter registered
[    0.143301] i2c i2c-0: using dma0chan0 (tx) and dma0chan1 (rx) for DMA transfers
[    1.806835] Goodix-TS 0-0014: i2c test failed attempt 1: -6
[    1.846960] Goodix-TS 0-0014: i2c test failed attempt 2: -6
[    1.930222] i2c /dev entries driver

also our device shows these data too

root@colibri-vf:~# i2cdetect -y 0

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- 14 -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --     

root@colibri-vf:~# modinfo goodix

filename:       /lib/modules/4.4.121-dirty/kernel/drivers/input/touchscreen/goodix.ko
license:        GPL v2
description:    Goodix touchscreen driver
author:         Bastien Nocera 
author:         Benjamin Tissoires 
srcversion:     14EC9CF3D1F29A86BF0A7F7
alias:          i2c:GDIX1001:00
alias:          of:N*T*Cgoodix,gt967*
alias:          of:N*T*Cgoodix,gt928*
alias:          of:N*T*Cgoodix,gt9271*
alias:          of:N*T*Cgoodix,gt927*
alias:          of:N*T*Cgoodix,gt912*
alias:          of:N*T*Cgoodix,gt9110*
alias:          of:N*T*Cgoodix,gt911*
depends:        
intree:         Y
vermagic:       4.4.121-dirty mod_unload modversions ARMv7 p2v8 

root@colibri-vf:~# ls /sys/bus/i2c/devices/
0-0014  0-0068  i2c-0

NOTE : attached some configuration file with circuit for checking purpose link text

Hi

Looking through your device-tree files I found the following inconsistencies:

vf-colibri-eval-v3.dtsi, ln 226

	pinctrl_gpiotouch: touchgpios {
		fsl,pins = <
			VF610_PAD_PTA15__GPIO_25	0x6f
			VF610_PAD_PTA16__GPIO_26	0x4f
			VF610_PAD_PTB8__GPIO_30		0x6f
			VF610_PAD_PTB1__GPIO_23		0x4f
		>;
  • Why do you have 4 pins in here?
  • In your schematic you use SODIMM_190/192, VF pads PTA25/PTA26 but you added PTA15/16, why?
  • You should remove the two pins PTB8/PTB1, you do not use them for touch, they are muxed for PWMs which will create a conflict.

vf-colibri-eval-v3.dtsi, ln 147

touch:
	gt9271@14 {
		compatible = "goodix,gt9271";	
		reg = <0x14>;
		interrupt-parent = <&gpio0>;
		interrupts = <15 IRQ_TYPE_EDGE_FALLING>;
		irq-gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
		reset = <&gpio0 16 GPIO_ACTIVE_LOW>;
	};

You use gpios which get muxed by ‘pinctrl_gpiotouch: touchgpios’ but you
do not add that muxing to the gt9271@14 node.
You should add two addtional properties:

pinctrl-names = "default";
pinctrl-0 = <&pinctrl_gpiotouch>;

Note that the goddix driver has no code to handle a reset pin. Thus the pin
will be muxed to gpio input and stays that way. Since you have an external
pullup reset will be deasserted and the chip should work.


vf-colibri-eval-v3.dtsi, ln 147

	&esdhc1 {
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_esdhc1>;
		bus-width = <4>;
		status = "okay";
	};

This node configures the SD card driver to use pinctrl_esdhc1. This pinctrl
uses the same pins that you use for IRQ / RESET for your touchcontroller.
I guess that your HW does not have any SD card slot, so you can set
status = “disabled”
in this node.

Max

hi max

i change my configuration file like above.but still problem is not solved yet.
these are the response while send these commands

root@colibri-vf:~# i2cdetect -y 0                                               
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f                             
00:          -- -- -- -- -- -- -- -- -- -- -- -- --                             
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                             
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                             
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                             
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                             
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                             
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                             
70: -- -- -- -- -- -- -- --                
root@colibri-vf:~# ls /sys/bus/i2c/devices/                                     
0-0014  0-0068  i2c-0  
root@colibri-vf:~# ls -l /dev/i2c-0                                             
crw-------    1 root     root       89,   0 Oct  4 08:17 /dev/i2c-0  
root@colibri-vf:~# modinfo goodix                                               
filename:       /lib/modules/4.4.121-dirty/kernel/drivers/input/touchscreen/gooo
license:        GPL v2                                                          
description:    Goodix touchscreen driver                                       
author:         Bastien Nocera                               
author:         Benjamin Tissoires                
srcversion:     14EC9CF3D1F29A86BF0A7F7                                         
alias:          i2c:GDIX1001:00                                                 
alias:          of:N*T*Cgoodix,gt967*                                           
alias:          of:N*T*Cgoodix,gt928*                                           
alias:          of:N*T*Cgoodix,gt9271*                                          
alias:          of:N*T*Cgoodix,gt927*                                           
alias:          of:N*T*Cgoodix,gt912*                                           
alias:          of:N*T*Cgoodix,gt9110*                                          
alias:          of:N*T*Cgoodix,gt911*                                           
depends:                                                                        
intree:         Y                                                               
vermagic:       4.4.121-dirty mod_unload modversions ARMv7 p2v8             
root@colibri-vf:~# dmesg | grep i2c                                             
[    0.142984] i2c i2c-0: IMX I2C adapter registered                            
[    0.143125] i2c i2c-0: using dma0chan0 (tx) and dma0chan1 (rx) for DMA transs
[    1.349909] i2c /dev entries driver 

any other configuration required for this?

Hi

It looks like the issue is worse now. Could you share your device tree files, please? Thanks.

hi jaski,

Thank you for your time,
here I attach all device tree file with this ,link text

and also attached some extra configuration fileslink text

note: location of the file are included in to name.

when send this command i can able see only I2C pins not any IRQ or RESET pins(filtered)

root@colibri-vf:~# cat /sys/kernel/debug/pinctrl/pinctrl-handles

Requested pin control handlers their pinmux maps:

device: 40066000.i2c current state: default
state: default

type: MUX_GROUP controller 40048000.iomuxc group: i2c0grp (9) function: vf610-colibri (0)

type: CONFIGS_PIN controller 40048000.iomuxc pin VF610_PAD_PTB14 (36)config 000037ff

type: CONFIGS_PIN controller 40048000.iomuxc pin VF610_PAD_PTB15 (37)config 000037ff

Thankyou

hi

Thanks for the files. Could you just send the files with the changes asked by max.tx and show clearly what did you change? Thanks.

hi max

good morning.

here attached all file that what we are changed.
all device tree file with this link. link text and
some extra configuration files link link text

  changes done are in short 

  **in file vfxxx.dtsi**

       i2c0: i2c@40066000 {
			#address-cells = <1>;
			#size-cells = <0>;
			compatible = "fsl,vf610-i2c";
			reg = <0x40066000 0x1000>;
			interrupts = <71 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&clks VF610_CLK_I2C0>;
			clock-names = "ipg";
			dmas = <&edma0 0 50>,
				<&edma0 0 51>;
			dma-names = "rx","tx";
			*status = "okay";*
		};

In file vf-colibri-eval-v3.dtsi

       &esdhc1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_esdhc1>;
bus-width = <4>;
status = "disabled";
 };


    &i2c0 {
status = "okay";

touch: gt9271@14 {
	compatible = "goodix,gt9271";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_gpiotouch>;
	reg = <0x14>;
	interrupt-parent = <&gpio0>;
	interrupts = <15 IRQ_TYPE_EDGE_FALLING>;
	irq-gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
	reset-gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
	status = "okay";
};

  };

    &iomuxc {

vf610-colibri {

			pinctrl_gpiotouch: touchgpios {
		fsl,pins = <
			*VF610_PAD_PTA25__GPIO_15	0x31f1
			VF610_PAD_PTA26__GPIO_16	0x31f2*
		>;
	};

};

  };

In fille vf-colibri.dtsi

    &esdhc1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_esdhc1>;
bus-width = <4>;
cd-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
disable-wp;
*status = "disabled";*
};

  &i2c0 {
clock-frequency = <400000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c0>;
*status = "okay";*
  };

   &can0 {
pinctrl-names = "default";
*//pinctrl-0 = <&pinctrl_flexcan0>;
status = "disabled";*
     };

       &iomuxc {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_hog_0 &pinctrl_hog_1>;

vf610-colibri {

	pinctrl_flexcan1: can1grp {
		fsl,pins = <
			*//VF610_PAD_PTB14__CAN0_RX	0x31F1
			//VF610_PAD_PTB15__CAN0_TX	0x31F2*
		>;
	};

	pinctrl_esdhc1: esdhc1grp {
		fsl,pins = <
			VF610_PAD_PTA24__ESDHC1_CLK		0x31ef
			//VF610_PAD_PTA25__ESDHC1_CMD		0x31ef
			//VF610_PAD_PTA26__ESDHC1_DAT0	0x31ef
			VF610_PAD_PTA27__ESDHC1_DAT1	0x31ef
			VF610_PAD_PTA28__ESDHC1_DATA2	0x31ef
			VF610_PAD_PTA29__ESDHC1_DAT3	0x31ef
			VF610_PAD_PTB20__GPIO_42		0x219d
		>;
	};
      }
}

Also changes done in other file like

colibri_vf_defconfig file in location linux_toradex/arch/arm/configs/

 CONFIG_INPUT_TOUCHSCREEN=y
 CONFIG_TOUCHSCREEN_ATMEL_MXT=m
 CONFIG_TOUCHSCREEN_FUSION_F0710A=m
CONFIG_TOUCHSCREEN_WM97XX=y
CONFIG_TOUCHSCREEN_GOODIX=m 

.config file in location linux_toradex/

  CONFIG_INPUT_TOUCHSCREEN=y
  CONFIG_TOUCHSCREEN_PROPERTIES=y
  CONFIG_TOUCHSCREEN_GOODIX=m

Kconfig file in location linux_toradex/drivers/input/touchscreen/

     config TOUCHSCREEN_GOODIX
        tristate "Goodix I2C touchscreen"
        depends on I2C
       default y 
     help
        Say Y here if you have the Goodix touchscreen (such as one
         installed in Onda v975w tablets) connected to your
         system. It also supports 5-finger chip models, which can be
         found on ARM tablets, like Wexler TAB7200 and MSI Primo73.

  If unsure, say N.

  To compile this driver as a module, choose M here: the
  module will be called goodix.

Thankyou

Can you also attach the complete kernel debug output? You can save it to a file using dmesg > dmesg.txt and then attach that file to this thread.

hi stefan

Good evening

here below i attach complete kernel debug output link text

Thankyou.

hi

We are done a small change in our circuit.Now Interrupt pin are in pull down state because we are use 0x5d(0xBA/0xBB) as address and this alt text.

root@colibri-vf:~# i2cdetect -y 0
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – – – – – – – – – – – – –
10: – – – – – – – – – – – – – – – –
20: – – – – – – – – – – – – – – – –
30: – – – – – – – – – – – – – – – –
40: – – – – – – – – – – – – – – – –
50: – – – – – – – – – – – – – 5d – –
60: – – – – – – – – – – – – – – – –
70: – – – – – – – –

        root@colibri-vf:~# dmesg | grep Goodix                                             

[ 3.044097] Goodix-TS 0-005d: read version failed: -6
[ 3.058165] Goodix-TS 0-005d: Read version failed.
root@colibri-vf:~# modinfo goodix
filename: /lib/modules/4.4.21-dirty/kernel/drivers/input/touchscreen/goodo
license: GPL v2
description: Goodix touchscreen driver
author: Bastien Nocera
author: Benjamin Tissoires
srcversion: 14EC9CF3D1F29A86BF0A7F7
alias: i2c:GDIX1001:00
alias: of:NTCgoodix,gt967*
alias: of:NTCgoodix,gt928*
alias: of:NTCgoodix,gt9271*
alias: of:NTCgoodix,gt927*
alias: of:NTCgoodix,gt912*
alias: of:NTCgoodix,gt9110*
alias: of:NTCgoodix,gt911*
depends:
intree: Y
vermagic: 4.4.21-dirty mod_unload modversions ARMv7 p2v8

our kernel file are attached to this link text
and dmesg response are here link text

hi

any updates

hello, at this point, it is very difficult for us to help you without having the hardware. Please check if the i2c communication with the goodix at startup of linux is working correctly using an oscilloscope and contact the supplier of this cpt touch for help.

Hi

Let me inform you after check it

thankyou,

Hi everyone,

At last my touch driver gives a positive response.When I touch the display that response well, but after a 3 or 4 touch it not response as required. Because ‘goodix_i2c_read’ not success then touch is not working. And also it goto an unknown state. when I give the manual reset to the driver(short RST pin and GND), then it goes to the normal state. Again that work as same that mentioned above.
Please check the file that I attached with this mail.
in my touch circuit, SDA, SCL, RST are pullup with 4,7k to 3.3v and INT are not pulled up.

gt9271@14 {
		compatible = "goodix,gt9271";
		reg = <0x14>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_gpiotouch>;
		interrupt-parent = <&gpio0>;
		interrupts = <15 IRQ_TYPE_EDGE_FALLING>;
		goodix,irq-gpios = <&gpio0 15  0>; 
		goodix,reset-gpios = <&gpio0 16 0>; 
		goodix,panel-coords = <0 0 479 799>;
		goodix,display-coords = <0 0 479 799>;
		goodix,i2c-pull-up;
		goodix,product-id ="9271";
		goodix,have-touch-key;
		skip-firmware-request;
		reset-delay-us=<10000>;
		status = "okay";
	};
	pinctrl_gpiotouch: touchgpios {
		fsl,pins = <
			VF610_PAD_PTA25__GPIO_15		 0x22ed//0x2c2e
			VF610_PAD_PTA26__GPIO_16		0x398d
		>;
	};

when touch isn’t working

[ 49.145897] Goodix-TS 0-0014: I2C transfer error: -11

[ 49.151066] Goodix-TS 0-0014: I2C write end_cmd error

[ 49.156193] Goodix-TS 0-0014: Goodix return -11,Register :814e Count : 747 Result 142

[ 49.163920] Goodix-TS 0-0014: I2C transfer error: -11

[ 49.169074] Goodix-TS 0-0014: I2C write end_cmd error

[ 49.180877] Goodix-TS 0-0014: Goodix return -11,Register :814e Count : 748 Result 142

when touch gives proper response

[ 66.555174] Goodix-TS 0-0014: Goodix return 2,Register :814e Count : 773 Result 0

[ 66.563403] Goodix-TS 0-0014: Goodix return 2,Register :814e Count : 774 Result 0

[ 66.572463] Goodix-TS 0-0014: Goodix return 2,Register :814e Count : 775 Result 129

[ 66.580862] Goodix-TS 0-0014: Goodix return 2,Register :814e Count : 776 Result 0

[ 66.589973] Goodix-TS 0-0014: Goodix return 2,Register :814e Count : 777 Result 128

These response are depend on 'goodix_i2c_read() in goodix.c

please check goodix.c file and vf-colibri-eval-v3.dtsi file .link text

I think my reset PIN are not worked as properly.
Please give me any suggestion
thank you.