Skip to content

Commit

Permalink
pinctrl: sunxi: sunxi_pconf_set: use correct offset
Browse files Browse the repository at this point in the history
[ Upstream commit cd4c1e6 ]

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: 90be64e ("pinctrl: sunxi: implement pin_config_set")
Signed-off-by: Andrei Lalaev <andrey.lalaev@gmail.com>
Reviewed-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20220525190423.410609-1-andrey.lalaev@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
AndreyLalaev authored and gregkh committed Jul 12, 2022
1 parent e1cda2a commit 1d0c3ce
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/pinctrl/sunxi/pinctrl-sunxi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1d0c3ce

Please sign in to comment.