This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux: Adding GT9xx touchscreen drivers to AM335x SDK

Tool/software: Linux

Hi,

I am new to the Linux and building this SDK as well. For our project, we need to include the GT9XX touch drivers. I have tried many ways which are there in the google, but could not succeed. My goal is to add the drivers to OS and made them running always. So i have added the files to "drivers/input/touchscreen", then i have modified the makefile and Kconfig which is there in the same folder. But when i am building image using "make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage" command, those objects were not being created. In the .config file i could not see anything related GT9 even after making the changes in makefile and Kconfig. I had tried to add in "tisdk_am335x-evm_defconfig" file also. None of them are seems to be working. Can some one please help me on this.

Thanks,

Vinod

  • The software team have been notified. They will respond here.
  • Have you done a

    make tisdk_am335x-evm_defconfig

    after modifying tisdk_am335x-evm_defconfig ?

  • Hello Vinod,

    You have the GT9xx touchscreen driver included in the Processor SKD since version 2.0.0 (kernel 4.1.6).

    I will use the latest Processor SDK to show you how this driver gets included in the OS.

    The driver is at <Processor SDK>/board-support/linux-<version>/drivers/input/touchscreen/goodix.c
    If you check the Makefile  you will see this line:
    obj-$(CONFIG_TOUCHSCREEN_GOODIX)    += goodix.o

    In <Processor SDK>/board-support/linux-<version>/arch/arm/configs/tisdk_am335x-evm_defconfig the CONFIG_TOUCHSCREEN_GOODIX=m assigns it to build as module.

    In menuconfig you can see its location and selection:
    $ cd <Processor SDK>/board-support/linux-<version>/
    $ ARCH=arm make menuconfig


    To make the drivers running always, you have to setup a device tree node.
    You can find the device tree bindings and node example at:
    <Processor SDK>/board-support/linux-<version>/Documentation/devicetree/bindings/input/touchscreen/goodix.txt

    Device tree bindings for Goodix GT9xx series touchscreen controller

    Required properties:

     - compatible        : Should be "goodix,gt911"
                     or "goodix,gt9110"
                     or "goodix,gt912"
                     or "goodix,gt927"
                     or "goodix,gt9271"
                     or "goodix,gt928"
                     or "goodix,gt967"
     - reg            : I2C address of the chip. Should be 0x5d or 0x14
     - interrupt-parent    : Interrupt controller to which the chip is connected
     - interrupts        : Interrupt to which the chip is connected

    Optional properties:

     - irq-gpios        : GPIO pin used for IRQ. The driver uses the
                  interrupt gpio pin as output to reset the device.
     - reset-gpios        : GPIO pin used for reset

     - touchscreen-inverted-x  : X axis is inverted (boolean)
     - touchscreen-inverted-y  : Y axis is inverted (boolean)
     - touchscreen-swapped-x-y : X and Y axis are swapped (boolean)
                                 (swapping is done after inverting the axis)

    Example:

        i2c@00000000 {
            /* ... */

            gt928@5d {
                compatible = "goodix,gt928";
                reg = <0x5d>;
                interrupt-parent = <&gpio>;
                interrupts = <0 0>;

                irq-gpios = <&gpio1 0 0>;
                reset-gpios = <&gpio1 1 0>;
            };

            /* ... */
        };

    Best regards,
    Kemal

  • Yes... I have done that.
  • Hi kemal,

    Thanks for your response. I have gone through this file. But i have not find place where i can specify the details of my I2C bus and slave address. will it take from device tree from @"gt928@5d { compatible = "goodix,gt928"; ..." . If so where can i specify the I2C bus details.?

    2) where can i add this
    i2c@00000000 {
    /* ... */

    gt928@5d {
    compatible = "goodix,gt928";
    reg = <0x5d>;
    interrupt-parent = <&gpio>;
    interrupts = <0 0>;

    irq-gpios = <&gpio1 0 0>;
    reset-gpios = <&gpio1 1 0>;
    };

    /* ... */
    };
    in to my dts file?.

    Sorry if i am asking basic questions, but i it was throwing error when i have added to am335x-blacbone.dts file. So please help me.

    Thanks,
    Vinod
  • First check on which i2c line the touch screen is physically attached, then put the touch screen node within this i2c node.

  • Hi Kemal,

    The device had been attached to i2c0, so i have made the change according to that. Now the dts file is building but touch is not working.

    here is the configuration:
    i2c@0{
    goodix_ts@14 {
    compatible = "goodix,gt9xx";
    reg = <0x14>;
    interrupt-parent = <&clkout2_pin>;
    interrupts = <31>;
    /* vdd_ana-supply = <&pm8226_l19>;
    vcc_i2c-supply = <&pm8226_lvs1>;
    goodix,rst-gpio = <&msmgpio 16 0x00>;
    goodix,irq-gpio = <&msmgpio 17 0x00>; */
    goodix,cfg-group0 = [
    42 D0 02 00 05 05 75 01 01 0F 24
    0F 64 3C 03 05 00 00 00 02 00 00
    00 16 19 1C 14 8C 0E 0E 24 00 31
    0D 00 00 00 83 33 1D 00 41 00 00
    00 00 00 08 0A 00 2B 1C 3C 94 D5
    03 08 00 00 04 93 1E 00 82 23 00
    74 29 00 69 2F 00 5F 37 00 5F 20
    40 60 00 F0 40 30 55 50 27 00 00
    00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 14 19 00 00
    50 50 02 04 06 08 0A 0C 0E 10 12
    14 16 18 1A 1C 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 1D
    1E 1F 20 21 22 24 26 28 29 2A 1C
    18 16 14 13 12 10 0F 0C 0A 08 06
    04 02 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 9C 01];
    goodix,cfg-group2 = [
    48 D0 02 00 05 05 75 01 01 0F 24
    0F 64 3C 03 05 00 00 00 02 00 00
    00 16 19 1C 14 8C 0E 0E 24 00 31
    0D 00 00 00 83 33 1D 00 41 00 00
    3C 0A 14 08 0A 00 2B 1C 3C 94 D5
    03 08 00 00 04 93 1E 00 82 23 00
    74 29 00 69 2F 00 5F 37 00 5F 20
    40 60 00 F0 40 30 55 50 27 00 00
    00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 14 19 00 00
    50 50 02 04 06 08 0A 0C 0E 10 12
    14 16 18 1A 1C 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 1D
    1E 1F 20 21 22 24 26 28 29 2A 1C
    18 16 14 13 12 10 0F 0C 0A 08 06
    04 02 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 3C 01];
    };
    };

    Can you please tell me what is going wrong here.

    Thanks,
    Vinod Kumar
  • Hi Kemal,

    The driver is loading, but it is showing " Invalid config, using defaults" . Does it means configuration in dts is wrong?? Can you please help in configuring correct data.

    I have copied the messages for your reference .

    [ 35.927901] Goodix-TS 0-0014: ID 928, version: 1040
    [ 35.958914] Goodix-TS 0-0014: Invalid config, using defaults
    [ 35.986554] input: Goodix Capacitive TouchScreen as /devices/platform/ocp/44e0b000.i2c/i2c-0/0-0014/input/input0

    oot@am335x-evm:/# i2cdetect -r 0
    WARNING! This program can confuse your I2C bus, cause data loss and worse!
    I will probe file /dev/i2c-0 using read byte commands.
    I will probe address range 0x03-0x77.
    Continue? [Y/n] y
            0 1 2 3 4 5 6 7 8 9 a b c d e f
    00: -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- -- -- UU -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- UU -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --

    please help me on this.

    Thanks and Regards,
    Vinod

  • Check your schematic again and see on which gpioX the irq-gpios and reset-gpios are tied. Then enter the correct gpios to the device tree.