From ec872304a2ac5c1b5025b30d52f08b91c08c0e2d Mon Sep 17 00:00:00 2001 From: Romain Pelletant Date: Thu, 2 Jan 2025 22:59:17 +0100 Subject: [PATCH] drivers: pinctrl: add low power support - Add low power pinctrl configuration support for gecko platform --- drivers/pinctrl/pinctrl_gecko.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/pinctrl/pinctrl_gecko.c b/drivers/pinctrl/pinctrl_gecko.c index db8f5523c015636..0f3805b1b3fd8bd 100644 --- a/drivers/pinctrl/pinctrl_gecko.c +++ b/drivers/pinctrl/pinctrl_gecko.c @@ -33,6 +33,15 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, uintp pin_config.pin = GECKO_GET_PIN(pins[i]); loc = GECKO_GET_LOC(pins[i]); + /* Force input for low power mode */ + if (GECKO_GET_LP(pins[i]) == GECKO_LP_ENABLE) { + pin_config.mode = gpioModeInput; + pin_config.out = 0; + GPIO_PinModeSet(pin_config.port, pin_config.pin, pin_config.mode, + pin_config.out); + continue; + } + switch (GECKO_GET_FUN(pins[i])) { #ifdef CONFIG_UART_GECKO case GECKO_FUN_UART_RX: