Re: [PATCH v2 2/4] Documentation: DT: bindings: input: Add documentation for cyttsp5

From: Andreas Kemnade
Date: Wed Nov 10 2021 - 12:37:14 EST


On Wed, 10 Nov 2021 22:59:50 +1000
Alistair Francis <alistair23@xxxxxxxxx> wrote:

[...]
> >
> > > + reset-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>;
> >
> > hmm, if the reset gpio at the chip is active low (I guess it is) that
> > would indicate an inverter between SoC and gpio. So a nonstandard setup
> > as an example, probably not a good idea.
>
> It seems to be common for the cypress,tt2100, as the original
> documentation and the rM2 both do this. Does the Kobo not do this?
>

You have a kind of double inversion here, so things are automagically fixed.
IMHO to describe it correctly would be to set GPIO_ACTIVE_LOW here
and in the driver

/* Reset the gpio to be in a reset state */
ts->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
if (IS_ERR(ts->reset_gpio)) {
rc = PTR_ERR(ts->reset_gpio);
dev_err(dev, "Failed to request reset gpio, error %d\n", rc);
return rc;
}
gpiod_set_value(ts->reset_gpio, 0);

That is the way how other active-low reset lines are handled.

Regards,
Andreas