linux/drivers/pinctrl/nomadik
Théo Lebrun 1f40990563 gpio: nomadik: fix offset bug in nmk_pmx_set()
[ Upstream commit 53cf6b72e0 ]

Previously, the statement looked like:

    slpm[x] &= ~BIT(g->grp.pins[i]);

Where:
 - slpm is a unsigned int pointer;
 - g->grp.pins[i] is a pin number. It can grow to more than 32.

The expected shift amount is a pin bank offset.

This bug does not occur on every group or pin: the altsetting must be
NMK_GPIO_ALT_C and the pin must be 32 or above. It might have occured.
For example, in pinctrl-nomadik-db8500.c, pin group i2c3_c_2 has the
right altsetting and pins 229 and 230.

Fixes: dbfe8ca259 ("pinctrl/nomadik: implement pin multiplexing")
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Link: https://lore.kernel.org/r/20240228-mbly-gpio-v2-5-3ba757474006@bootlin.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-26 18:17:15 -04:00
..
Kconfig pinctrl: nomadik: Kconfig: Remove repeated config dependency 2021-09-17 00:08:14 +02:00
Makefile pinctrl: nomadik: Drop U8540/9540 support 2018-03-23 03:38:14 +01:00
pinctrl-ab8500.c pinctrl: nomadik: Add missing header(s) 2023-01-04 02:36:47 +01:00
pinctrl-ab8505.c pinctrl: nomadik: Add missing header(s) 2023-01-04 02:36:47 +01:00
pinctrl-abx500.c pinctrl: abx500: use gpiochip_dup_line_label() 2023-12-08 09:26:30 +01:00
pinctrl-abx500.h pinctrl: nomadik: Add missing header(s) 2023-01-04 02:36:47 +01:00
pinctrl-nomadik-db8500.c pinctrl: nomadik: Add missing header(s) 2023-01-04 02:36:47 +01:00
pinctrl-nomadik-stn8815.c pinctrl: nomadik: Add missing header(s) 2023-01-04 02:36:47 +01:00
pinctrl-nomadik.c gpio: nomadik: fix offset bug in nmk_pmx_set() 2024-03-26 18:17:15 -04:00
pinctrl-nomadik.h pinctrl: nomadik: Add missing header(s) 2023-01-04 02:36:47 +01:00