Trouble with capacitive touch panel GT911 which does not work upon power-up but works after restart.

1,370 views
Skip to first unread message

libor.or...@gmail.com

unread,
Sep 29, 2016, 3:50:06 AM9/29/16
to BeagleBoard

Dear all,

I recently acquired  5" LCD display DSN50602-PCT with capacitive touch panel, thus my intention was to use it with Beaglebone Black board.
The image which I chose for this project is:

debian@beaglebone:~$ cat /etc/dogtag
BeagleBoard.org Debian Image 2016-01-10
debian@beaglebone:~$ uname -r
4.1.33-bone24


There was no problem in writing appropriate dts for the display and it works flawlessly. The challenge was to expand dts to support capacitive touch panel with its controller Goodix GT911. The controller communicates with BBB via i2c1 bus and furthermore uses two additional gpios, one for the interrupt and another for reset. 
So, finally, I had expanded my lcd dts with the following fragments:

    fragment@0 {        
        target
= <&am33xx_pinmux>;
        __overlay__
{
            bb_i2c1_pins
: pinmux_bb_i2c1_pins {
                pinctrl
-single,pins = <
                    BONE_P9_18
(SLEWCTRL_SLOW | PIN_INPUT_PULLUP | MUX_MODE2)    
                    BONE_P9_17
(SLEWCTRL_SLOW | PIN_INPUT_PULLUP | MUX_MODE2)    
               
>;
           
};

            gt911_ts
: pinmux_gt911_ts {
                pinctrl
-single,pins = <
                BONE_P8_14
(PIN_OUTPUT_PULLUP | MUX_MODE7)        
                BONE_P8_13
(PIN_INPUT_PULLUP | MUX_MODE7)        
               
>;
           
};
       
};
   
};
   
    fragment@1
{
        target
= <&i2c1>;    
        __overlay__
{
            pinctrl
-names = "default";
            pinctrl
-0 = <&bb_i2c1_pins>;
            status
= "okay";
            clock
-frequency = <100000>;
           
           
/* shut up DTC warnings */
           
#address-cells = <1>;
           
#size-cells = <0>;
           
            ctp@5d
{
                status
= "okay";
                pinctrl
-names = "default";
                pinctrl
-0 = <&gt911_ts>;
                compatible
= "goodix,gt911";
                               
                reg
= <0x5d>;
                interrupt
-parent = <&gt911_ts>;
                interrupts
= <8 13 2>;                
                irq
-gpios = <8 13>;
                reset
-gpios = <8 14>;
                touchscreen
-swapped-x-y;                
           
};          
       
};
   
};    
   

Of course, goodix modul is needed for the touchscreen, so I had it added to /etc/modules-load.d/modules.conf file.


When I power up the BBB, the touchscreen is not functioning.
From dmesg I cannot see what is wrong:

debian@beaglebone:~$ dmesg | grep Goodix
[    5.574184] Goodix-TS 1-005d: IC VERSION: 39 31 31 00 60 10
[    5.596674] input: Goodix Capacitive TouchScreen as /devices/platform/ocp/4802a000.i2c/i2c-1/1-005d/input/input1


Now comes the interesting part.
After restarting the operating system (sudo shutdown -r now), I get fully functional touchscreen panel which will work perfectly until I shutdown the board. There is no difference in dmesg log which would give me a clue why the touchscreen behaves differently depending whether I am powering up the system or resetting it. 

I am struggling with this for few days now and I thought that maybe there is some difference between power-up and restart which reflects on touchscreen functionallity.

I would gladly read your comments and ideas on how to resolve the issue which I am facing with.

libor.or...@gmail.com

unread,
Oct 4, 2016, 8:01:45 AM10/4/16
to BeagleBoard
I am pretty sure that the problem is in the following block of code:
                interrupts = <8 13 2>;                
                irq
-gpios = <8 13>;
                reset
-gpios = <8 14>;


I do not know how to define these gpios in that block of code, how to assign them to interrupts, irg-gpios and reset-gpios.

Gpio which is connected to GT911 controller's interrupt is P8_13 and gpio for reset of the GT911 controller is P8_14.

Robert Nelson

unread,
Oct 4, 2016, 11:29:53 AM10/4/16
to Beagle Board, libor.or...@gmail.com
On Tue, Oct 4, 2016 at 7:01 AM, <libor.or...@gmail.com> wrote:
> I am pretty sure that the problem is in the following block of code:
> interrupts = <8 13 2>;
> irq-gpios = <8 13>;
> reset-gpios = <8 14>;
>
> I do not know how to define these gpios in that block of code, how to assign
> them to interrupts, irg-gpios and reset-gpios.
>
> Gpio which is connected to GT911 controller's interrupt is P8_13 and gpio
> for reset of the GT911 controller is P8_14.

Well,

https://github.com/derekmolloy/boneDeviceTree/blob/master/docs/BeagleboneBlackP8HeaderTable.pdf

P8_13 = gpio0_23
P8_24 = gpio0_26

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/input/touchscreen/goodix.txt

interrupt-parent = <&gpio0>;
interrupts = <0 0>; //interrupts : Interrupt to which the chip is connected

irq-gpios = <&gpio0 23 GPIO_ACTIVE_LOW>;
reset-gpios = <&gpio0 26 GPIO_ACTIVE_LOW>;

Regards,

--
Robert Nelson
https://rcn-ee.com/

libor.or...@gmail.com

unread,
Oct 5, 2016, 7:44:26 AM10/5/16
to BeagleBoard, libor.or...@gmail.com
Thank you very much for your response Mr. Nelson.

I tried with your solution but it did not work for me.
Situation was the same.
But, more importantly, you made me thinking and finally I have a working dts:

    fragment@0 {
        target = <&am33xx_pinmux>;
        __overlay__ {
            bb_i2c1_pins: pinmux_bb_i2c1_pins {
                pinctrl-single,pins = <
                    BONE_P9_18 0x72    // spi0_d1.i2c1_sda, SLEWCTRL_SLOW | INPUT_PULLUP | MODE2
                    BONE_P9_17 0x72    // spi0_cs0.i2c1_scl, SLEWCTRL_SLOW | INPUT_PULLUP | MODE2
                >;
            };           
        };
    };
   
    fragment@1 {
        target = <&am33xx_pinmux>;
        __overlay__ {
            gt911_ts: pinmux_gt911_ts {
                pinctrl-single,pins = <               
                BONE_P8_13 (PIN_INPUT_PULLUP | MUX_MODE7)
                BONE_P8_14 (PIN_OUTPUT_PULLUP | MUX_MODE7)
                >;
            };
        };
    };
   

    fragment@2 {
        target = <&i2c1>;    // i2c1 is numbered correctly
        __overlay__ {

            status = "okay";
            pinctrl-names = "default";
            pinctrl-0 = <&bb_i2c1_pins>;

            // configuration start
            clock-frequency = <100000>;


            #address-cells = <1>;
            #size-cells = <0>;
                   
            ctp@5d {
                status = "okay";
                pinctrl-names = "default";
                compatible = "goodix,gt911";
                               
                reg = <0x5d>;
                interrupt-parent = <&gt911_ts>;
                interrupts = <1 0>;                
                irq-gpios = <&gt911_ts 0 GPIO_ACTIVE_LOW>;
                reset-gpios = <&gt911_ts 1 GPIO_ACTIVE_LOW>;
                touchscreen-swapped-x-y;               
            };           
        };
    };
   


Once again, thank you for your help.
Regards,
--
Libor Orgovan.
Reply all
Reply to author
Forward
0 new messages