]> git.baikalelectronics.ru Git - kernel.git/commit
pinctrl: ocelot: Fix alt mode for ocelot
authorHoratiu Vultur <horatiu.vultur@microchip.com>
Mon, 6 Feb 2023 20:37:20 +0000 (21:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Apr 2023 09:16:44 +0000 (11:16 +0200)
commit0c6f30a72d52af765feb81146a8f36f29f190be0
treed6ea1d354c247412059f7a269203074e221bf88d
parentf2977b5dad53acad8bf3e4926eca2825f655594c
pinctrl: ocelot: Fix alt mode for ocelot

[ Upstream commit 657fd9da2d4b4aa0a384105b236baa22fa0233bf ]

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: aa4e88f2559a ("pinctrl: ocelot: fix pinmuxing for pins after 31")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Link: https://lore.kernel.org/r/20230206203720.1177718-1-horatiu.vultur@microchip.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pinctrl/pinctrl-ocelot.c