From 5c5da250c9ea5396d2ca82b9ca0bdba0acfc9c79 Mon Sep 17 00:00:00 2001 From: Adam Kondraciuk Date: Fri, 8 Nov 2024 10:57:20 +0100 Subject: [PATCH] [nrf fromlist] drivers: spi: nrfx_spim: set/clear pins retention Add pins retention control when GPD is enabled for SPIM. Upstream PR #: 81134 Signed-off-by: Adam Kondraciuk (cherry picked from commit 87e5b3f36d215898b127ad25aadf56f0e3d162ed) --- 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 01191caa829..aacf863e3b4 100644 --- a/drivers/spi/spi_nrfx_spim.c +++ b/drivers/spi/spi_nrfx_spim.c @@ -12,6 +12,9 @@ #include #include #include +#ifdef CONFIG_SOC_NRF54H20_GPD +#include +#endif #ifdef CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 #include #endif @@ -592,6 +595,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: @@ -600,6 +608,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); break;