Hi Hans! Dne sreda, 26. januar 2022 ob 12:02:04 CET je Hans Verkuil napisal(a): > The commit that sets the direction directly without calling > pinctrl_gpio_direction(), forgot to add chip->base to the offset when > calling sunxi_pmx_gpio_set_direction(). > > This caused failures for various Allwinner boards which have two > GPIO blocks. > > Signed-off-by: Hans Verkuil <hverkuil-cisco@xxxxxxxxx> > Reported-by: 5kft <5kft@xxxxxxxx> > Suggested-by: 5kft <5kft@xxxxxxxx> > Reported-by: Corentin Labbe <clabbe.montjoie@xxxxxxxxx> > Fixes: 8df89a7cbc63 (pinctrl-sunxi: don't call pinctrl_gpio_direction()) > Tested-by: Corentin Labbe <clabbe.montjoie@xxxxxxxxx> Next time please send to all sunxi maintainers/reviewers and mailing list. Tested-by: Jernej Skrabec <jernej.skrabec@xxxxxxxxx> Acked-by: Jernej Skrabec <jernej.skrabec@xxxxxxxxx> Best regards, Jernej > --- > Corentin, can you please test this patch to verify that this fixes your > issue on the orangepiPC? > --- > > diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/ pinctrl-sunxi.c > index 80d6750c74a6..061323eab8b1 100644 > --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c > +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c > @@ -837,7 +837,8 @@ static int sunxi_pinctrl_gpio_direction_input(struct gpio_chip *chip, > { > struct sunxi_pinctrl *pctl = gpiochip_get_data(chip); > > - return sunxi_pmx_gpio_set_direction(pctl->pctl_dev, NULL, offset, true); > + return sunxi_pmx_gpio_set_direction(pctl->pctl_dev, NULL, > + chip->base + offset, true); > } > > static int sunxi_pinctrl_gpio_get(struct gpio_chip *chip, unsigned offset) > @@ -890,7 +891,8 @@ static int sunxi_pinctrl_gpio_direction_output(struct gpio_chip *chip, > struct sunxi_pinctrl *pctl = gpiochip_get_data(chip); > > sunxi_pinctrl_gpio_set(chip, offset, value); > - return sunxi_pmx_gpio_set_direction(pctl->pctl_dev, NULL, offset, false); > + return sunxi_pmx_gpio_set_direction(pctl->pctl_dev, NULL, > + chip->base + offset, false); > } > > static int sunxi_pinctrl_gpio_of_xlate(struct gpio_chip *gc, >