From 812abb9fbe32751dcd402e0e9251b1f667f85248 Mon Sep 17 00:00:00 2001 From: Adam Kondraciuk Date: Fri, 8 Nov 2024 10:57:20 +0100 Subject: [PATCH] drivers: spi: nrfx_spim: set/clear pins retention Add pins retention control when GPD is enabled for SPIM. Signed-off-by: Adam Kondraciuk --- drivers/spi/spi_nrfx_spim.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/spi/spi_nrfx_spim.c b/drivers/spi/spi_nrfx_spim.c index 3de9f82709c5d..b0eecc076252f 100644 --- a/drivers/spi/spi_nrfx_spim.c +++ b/drivers/spi/spi_nrfx_spim.c @@ -11,6 +11,9 @@ #include #include #include +#ifdef CONFIG_SOC_NRF54H20_GPD +#include +#endif #ifdef CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 #include #endif @@ -586,6 +589,11 @@ static int spim_nrfx_pm_action(const struct device *dev, /* nrfx_spim_init() will be called at configuration before * the next transfer. */ + +#ifdef CONFIG_SOC_NRF54H20_GPD + nrf_gpd_retain_pins_set(dev_config->pcfg, false); +#endif + break; case PM_DEVICE_ACTION_SUSPEND: @@ -594,6 +602,10 @@ static int spim_nrfx_pm_action(const struct device *dev, dev_data->initialized = false; } +#ifdef CONFIG_SOC_NRF54H20_GPD + nrf_gpd_retain_pins_set(dev_config->pcfg, true); +#endif + ret = pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_SLEEP); if (ret < 0) {