Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: stm32: Handle RSVD pin configuration

When a pin is assigned to a coprocessor not running Linux, the pin
should be flagged in the DT as reserved and not usable by Linux.

Add pin configuration RSVD (Reserved) and instrument the driver to
not update the mux setting.

Signed-off-by: Fabien Dessenne <fabien.dessenne@foss.st.com>
Signed-off-by: Antonio Borneo <antonio.borneo@foss.st.com>
Link: https://lore.kernel.org/20250610152309.299438-2-antonio.borneo@foss.st.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Fabien Dessenne and committed by
Linus Walleij
a88ca6de da5b24fb

+11 -1
+9
drivers/pinctrl/stm32/pinctrl-stm32.c
··· 91 91 "af8", "af9", "af10", 92 92 "af11", "af12", "af13", 93 93 "af14", "af15", "analog", 94 + "reserved", 94 95 }; 95 96 96 97 struct stm32_pinctrl_group { ··· 664 663 if (pin->pin.number != pin_num) 665 664 continue; 666 665 666 + if (fnum == STM32_PIN_RSVD) 667 + return true; 668 + 667 669 for (k = 0; k < STM32_CONFIG_NUM; k++) { 668 670 if (func->num == fnum) 669 671 return true; ··· 964 960 if (!range) { 965 961 dev_err(pctl->dev, "No gpio range defined.\n"); 966 962 return -EINVAL; 963 + } 964 + 965 + if (function == STM32_PIN_RSVD) { 966 + dev_dbg(pctl->dev, "Reserved pins, skipping HW update.\n"); 967 + return 0; 967 968 } 968 969 969 970 bank = gpiochip_get_data(range->gc);
+2 -1
drivers/pinctrl/stm32/pinctrl-stm32.h
··· 17 17 #define STM32_PIN_GPIO 0 18 18 #define STM32_PIN_AF(x) ((x) + 1) 19 19 #define STM32_PIN_ANALOG (STM32_PIN_AF(15) + 1) 20 - #define STM32_CONFIG_NUM (STM32_PIN_ANALOG + 1) 20 + #define STM32_PIN_RSVD (STM32_PIN_ANALOG + 1) 21 + #define STM32_CONFIG_NUM (STM32_PIN_RSVD + 1) 21 22 22 23 /* package information */ 23 24 #define STM32MP_PKG_AA BIT(0)