Electrical – linux – Device tree binding: can not make work the touch device

linux

I have a touchscreen that the touch pad doesn't work. It uses i2c.

This is the driver: goodix.c.

This is how I should add the node to the device tree: goodix.txt

This is the device tree: imx6qdl-sb-fx6.dtsi

And this is the node that I put as child of /i2cmux/i2c@0:

            gt9271@XX {
                compatible = "goodix,gt9271";
#if GOODIX_5D
                reg = <0x5d>;
#else
                reg = <0x14>;
#endif
                interrupt-parent = <&gpio1>;
                interrupts = <4 0>;
                irq-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
                reset = <&pca9555 11 GPIO_ACTIVE_LOW>; 
            };

The driver loads correctly:

root@cm-fx6:~# dmesg | grep Goodix
[    4.811992] Goodix-TS 3-0014: ID 9271, version: 1020
[    4.828035] Goodix-TS 3-0014: Invalid config, using defaults
[    4.832665] input: Goodix Capacitive TouchScreen as /devices/soc0/soc/2100000.aips-bus/21a0000.i2c/i2c-0/i2c-3/3-0014/input/input0

But there are no interrupts generation when I touch.
The initialization phase (check goodix_reset function) is neither performed as it should. This is what I should see (with an oscilloscope) during power on: http://imgur.com/a/puLsu.
But INT and RESET pins remain HIGH at all time.

I've wrote reset instead of reset-gpios as described on the documentation because otherwise I get error trying to get the pin. The error is -16 which means the resource is busy, because pca9555 11 is being used by another device too (check mipi-dsi-reset node). Btw, pca9555 is an auxiliary gpio controller.

Any clue on what is happening and why the pins don't act like the driver dictates? It has been already discarded to be a connection problem: if I don't load the driver and try to set gpio4 to 1 or 0 I see it reflected on the pin (both sides).

Best Answer

If the GPIO pin is used by another device, you will get such device busy error. Check whether any other device is using it.

You can try either of the following :

Do not load the other driver that uses the GPIO that you are currently trying to use in your touchscreen driver by either not including the other driver at all or remove the other driver related information from device tree (dtsi) or Use an alternate GPIO pin for your touchscreen that is not used for other purposes while you use the touchscreen.