Skip to content

Commit

Permalink
[nrf fromlist] drivers: spi: nrfx_spim: set/clear pins retention
Browse files Browse the repository at this point in the history
Add pins retention control when GPD is enabled for SPIM.

Upstream PR #: 81134

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
(cherry picked from commit 87e5b3f)
  • Loading branch information
adamkondraciuk authored and rlubos committed Nov 13, 2024
1 parent 2074636 commit 5c5da25
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/spi/spi_nrfx_spim.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
#include <zephyr/drivers/pinctrl.h>
#include <zephyr/mem_mgmt/mem_attr.h>
#include <soc.h>
#ifdef CONFIG_SOC_NRF54H20_GPD
#include <nrf/gpd.h>
#endif
#ifdef CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58
#include <nrfx_ppi.h>
#endif
Expand Down Expand Up @@ -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:
Expand All @@ -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;
Expand Down

0 comments on commit 5c5da25

Please sign in to comment.