linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: sunxi: sunxi_pconf_set: use correct offset
@ 2022-05-25 19:04 Andrei Lalaev
  2022-05-26 20:52 ` Jernej Škrabec
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Andrei Lalaev @ 2022-05-25 19:04 UTC (permalink / raw)
  To: linus.walleij, wens, jernej.skrabec, samuel, linux-gpio
  Cc: linux-sunxi, Andrei Lalaev

Some Allwinner SoCs have 2 pinctrls (PIO and R_PIO).
Previous implementation used absolute pin numbering and it was incorrect
for R_PIO pinctrl.
It's necessary to take into account the base pin number.

Fixes: 90be64e27621 ("pinctrl: sunxi: implement pin_config_set")
Signed-off-by: Andrei Lalaev <andrey.lalaev@gmail.com>
---
 drivers/pinctrl/sunxi/pinctrl-sunxi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
index d9327d7d56ee..dd928402af99 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
@@ -544,6 +544,8 @@ static int sunxi_pconf_set(struct pinctrl_dev *pctldev, unsigned pin,
 	struct sunxi_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
 	int i;
 
+	pin -= pctl->desc->pin_base;
+
 	for (i = 0; i < num_configs; i++) {
 		enum pin_config_param param;
 		unsigned long flags;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-06-27  9:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-25 19:04 [PATCH] pinctrl: sunxi: sunxi_pconf_set: use correct offset Andrei Lalaev
2022-05-26 20:52 ` Jernej Škrabec
2022-06-15 18:06   ` Andrei Lalaev
2022-06-15 13:17 ` Linus Walleij
2022-06-15 15:56   ` Jernej Škrabec
2022-06-17  4:32     ` Samuel Holland
2022-06-27  9:27 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).