Device tree binding: can not make work my touch device

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

Device tree binding: can not make work my touch device

Contributor III

I have a Goodix touch device that uses i2c interface. This is the doc on how to bind it.

And this my node:

    i2cmux {
        compatible = "i2c-mux-gpio";
        #address-cells = <1>;
        #size-cells = <0>;
        mux-gpios = <&gpio1 2 0>;
        i2c-parent = <&i2c1>;

        i2c@0 {
            reg = <0>;
            #address-cells = <1>;
            #size-cells = <0>;

            /*my node*/

            gt9271@XX {
                    compatible = "goodix,gt9271";
                   reg = <0x5d>;
                   reg = <0x14>;
                   interrupt-parent = <&gpio1>;
                   interrupts = <4 0>;
                   irq-gpios = <&gpio1 4 0>;
                   resets = <&lcd_reset>;
The driver loads correctly, the reset sequence is OK too, but there are no interrupts generation when I touch the screen. So I suspect if my device tree binding could be wrong. How should I set the 0 value of interrupts and irq-gpios properties? The INT pin is connected to GPIO4, which is configured as input and is on HIGH level by default.  I've tried different combinations (0 0, 0 1, 1 0, 1 1) but all remains the same.
Labels (3)
0 Kudos
22 Replies

Contributor IV

Thats is good news. Reset and IRQ pins are optional; it seems that is why it is working. But I am afraid that it is not taking these values from dts file.

You are making this pin as interrupt pin by setting it as output which is not possible.

gpiod_direction_output(ts->gpiod_int, ts->client->addr == 0x14); 

But good thing which you have comment out is

gpiod_direction_input(ts->gpiod_rst); // I don't know why they are setting it as input. Ideally it should be output.

BTW it is working; so I am happy that your efforts has paid off. you can share the latest code if you have any doubts implementation.



0 Kudos

Contributor III

device_reset() function is defined on <linux/reset.h>. I know is executed because I can see it through oscilloscope that the reset pin does a falling edge during 10ms.

I think there is a confusion. The driver that I use is an older an simpler version, is the one that I attached on the tar.gz file. I'm NOT using the linked one on github, which is the master version, because that doesn't seems to perform better (reset pin stays always high).


But as you said there is defined

#define GOODIX_GPIO_INT_NAME "irq"    //Matching to string in device tree

#define GOODIX_GPIO_RST_NAME "reset"   //Matching to string in device tree

and possibly that's the reason it isn't working because I'm not matching the strings? Where on the device tree do I specify these strings?

Thank you.

0 Kudos