Skip to content

Commit 657fd9d

Browse files
HoratiuVulturlinusw
authored andcommitted
pinctrl: ocelot: Fix alt mode for ocelot
In case the driver was trying to set an alternate mode for gpio 0 or 32 then the mode was not set correctly. The reason is that there is computation error inside the function ocelot_pinmux_set_mux because in this case it was trying to shift to left by -1. Fix this by actually shifting the function bits and not the position. Fixes: 4b36082 ("pinctrl: ocelot: fix pinmuxing for pins after 31") Signed-off-by: Horatiu Vultur <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 7bb97e3 commit 657fd9d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pinctrl/pinctrl-ocelot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1204,7 +1204,7 @@ static int ocelot_pinmux_set_mux(struct pinctrl_dev *pctldev,
12041204
regmap_update_bits(info->map, REG_ALT(0, info, pin->pin),
12051205
BIT(p), f << p);
12061206
regmap_update_bits(info->map, REG_ALT(1, info, pin->pin),
1207-
BIT(p), f << (p - 1));
1207+
BIT(p), (f >> 1) << p);
12081208

12091209
return 0;
12101210
}

0 commit comments

Comments
 (0)