From: Andrei Lalaev <andrey.lalaev@gmail.com>
To: linus.walleij@linaro.org, wens@csie.org,
jernej.skrabec@gmail.com, samuel@sholland.org,
linux-gpio@vger.kernel.org
Cc: linux-sunxi@lists.linux.dev, Andrei Lalaev <andrey.lalaev@gmail.com>
Subject: [PATCH] pinctrl: sunxi: sunxi_pconf_set: use correct offset
Date: Wed, 25 May 2022 22:04:25 +0300 [thread overview]
Message-ID: <20220525190423.410609-1-andrey.lalaev@gmail.com> (raw)
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
next reply other threads:[~2022-05-25 19:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-25 19:04 Andrei Lalaev [this message]
2022-05-26 20:52 ` [PATCH] pinctrl: sunxi: sunxi_pconf_set: use correct offset 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220525190423.410609-1-andrey.lalaev@gmail.com \
--to=andrey.lalaev@gmail.com \
--cc=jernej.skrabec@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=samuel@sholland.org \
--cc=wens@csie.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).