Touch panel reset pin vim3l on device-tree

Hi!
I couldn’t find the reset pin name for the device-tree configuration of a custom touchscreen… I found number “6” from TS050 but it fails to open being declared non existent by the driver gt9xx.

From the schematics it has to be P6 from the TCA6408ARGTR ic, but I cannot find a GPIO name like “GPIOA_5” for TP_INT (which is working)…

Thanks in advance!
@numbqq

We use GPIO expander to control the RESET and POWER pin of LCD. You can check the commit of add support Khadas TS050

Where is the reset pin in that code? I can’t find it…

“power” isn’t related to LCD backlight PWM ?

Found this…

We don’t use this, please read the source code.

So, I think the best solution is to update the khadas-tca6408 to be a gpio driver, so it can be accesible through the gpiolib… this way anyone will be able to configure any touchscreen driver with just the pin like this:
reset-gpio = <&gpio GPIOZ_15 GPIO_ACTIVE_HIGH>;

My touchscreen IC is supported in official linux and even has an amlogic version of the driver available in the default VIM3L image… but it will never work with the pin TP_RST (which is the dedicated pin in VIM3L) if you don’t provide gpiolib access for it, so it can be instantiated via device-tree, and that would be everyone’s win.

Modifying the gt9xx driver just to include khadas-tca6408 calls like these tca6408_output_set_value((0<<6), (1<<6)); instead of the gpio reset capability already covered by the official driver is not a good sustainable idea…

From what I’ve researched the vim3-ft5x06 driver is compatible with tca6408. So the majority of the gpio_chip driver should be already done…

what do you think @numbqq?

1 Like

Yes, you are right, we already have the standard GPIO expander driver tested on VIM3, but haven’t tested on the LCD, we plan to do it in next step.

2 Likes

Also, for the time being, to anyone reading this… this is not a tidy workaround, but it works…

  1. Leave the ft5336 node (this will control the reset pin)
  2. remove its interrupt attribute
  3. add your IC to the i2c3 node with an unused GPIO (for example GPIOZ_15)

Example:

&i2c3 {
status = “okay”;

gt9xx-i2c@5d {
compatible = “goodix,gt9xx”;
status = “okay”;

  reg = <0x5d>;

  interrupt-parent = <&gpio>;
  reset-gpio = <&gpio GPIOZ_15 GPIO_ACTIVE_HIGH>;
  irq-gpio = <&gpio GPIOA_5 IRQ_TYPE_LEVEL_LOW>; // GPIOA_5 = TP_INT
  irq-flags = <2>; // 1 for rising edge trigger, 2 for falling edge trigger

  ... // your touchscreen parameters

};

ft5336@38 {
compatible = “edt,edt-ft5336”, “ft5x06”;
reg = <0x38>;
// remove interrupt info… interrupt_pin = <&gpio GPIOA_5 GPIO_ACTIVE_HIGH>;
reset_pin = <6>;
status = “okay”;
};
};

1 Like