Hi Shimoda-san, On Wed, Nov 4, 2020 at 6:23 AM Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx> wrote: > > From: Geert Uytterhoeven, Sent: Friday, October 30, 2020 5:15 PM > > Currently, the R-Car GPIO driver treats R-Car Gen2 and R-Car Gen3 GPIO > > controllers the same. However, there exist small differences, like the > > behavior of the General Input Register (INDT): > > - On R-Car Gen1, R-Car Gen2, and RZ/G1, INDT only reflects the state > > of an input pin if the GPIO is configured for input, > > - On R-Car Gen3 and RZ/G2, INDT always reflects the state of the input > > pins. > > Hence to accommodate all variants, the driver does not use the INDT > > register to read the status of a GPIO line when configured for output, > > at the expense of doing 2 or 3 register reads instead of 1. > > > > Given register accesses are slow, change the .get() and .get_multiple() > > callbacks to always use INDT to read pin state on SoCs where this is > > supported. > > > > Signed-off-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx> > <snip> > > @@ -302,9 +303,9 @@ static int gpio_rcar_get(struct gpio_chip *chip, unsigned offset) > > struct gpio_rcar_priv *p = gpiochip_get_data(chip); > > u32 bit = BIT(offset); > > > > - /* testing on r8a7790 shows that INDT does not show correct pin state > > - * when configured as output, so use OUTDT in case of output pins */ > > - if (gpio_rcar_read(p, INOUTSEL) & bit) > > + /* Before R-Car Gen3, INDT does not show correct pin state when > > + * configured as output, so use OUTDT in case of output pins */ > > nit: checkpatch.pl said warning as the following. > --- > WARNING: Block comments use a trailing */ on a separate line > #46: FILE: drivers/gpio/gpio-rcar.c:307: > + * configured as output, so use OUTDT in case of output pins */ > > total: 0 errors, 1 warnings, 72 lines checked That's a pre-existing issue. But it might be the right time to fix that ;-) Will do. > Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx> Thanks! 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