On Mon, Oct 19, 2020 at 2:06 PM Geert Uytterhoeven <geert+renesas@xxxxxxxxx> wrote: > From: Phong Hoang <phong.hoang.wz@xxxxxxxxxxx> > > Add support for the R-Car V3U (r8a779a0) SoC. > This includes support for the new "General Input Enable" register to > control input enable. > > Signed-off-by: Phong Hoang <phong.hoang.wz@xxxxxxxxxxx> > Signed-off-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx> > --- > Untested on actual hardware. > > Should input be enabled unconditionally, as recommended by the Hardware > Manual for backwards compatibility with existing software? > As per (errata?) commit ae9550f635533b1c ("gpio-rcar: Use OUTDT when > reading GPIOs configured as output"), the gpio-rcar driver does not use > the INDT register to read the status of a GPIO line when configured for > output. More investigation: 1. On SH7734, R-Car Gen1, R-Car Gen2, and RZ/G1, INDT only reflects the state of the input pin if the GPIO is configured for input (documented, verified on R-Car M2-W), 2. On R-Car Gen3 and RZ/G2, INDT always reflects the state of the input pin (documented, verified on R-Car H3/M3-W/M3-N), 3. On R-Car V3U, input enable can be configured explicitly through the new INEN register (documented, unverified). Given register accesses are slow, I think it makes sense to enable input explicitly and unconditionally on R-Car V3U, and always use INDT to read pin state on R-Car Gen3 and V3U. Thanks for your comments! Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds