Skip to content

Commit 5c5da25

Browse files
adamkondraciukrlubos
authored andcommitted
[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 <[email protected]> (cherry picked from commit 87e5b3f)
1 parent 2074636 commit 5c5da25

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/spi/spi_nrfx_spim.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
#include <zephyr/drivers/pinctrl.h>
1313
#include <zephyr/mem_mgmt/mem_attr.h>
1414
#include <soc.h>
15+
#ifdef CONFIG_SOC_NRF54H20_GPD
16+
#include <nrf/gpd.h>
17+
#endif
1518
#ifdef CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58
1619
#include <nrfx_ppi.h>
1720
#endif
@@ -592,6 +595,11 @@ static int spim_nrfx_pm_action(const struct device *dev,
592595
/* nrfx_spim_init() will be called at configuration before
593596
* the next transfer.
594597
*/
598+
599+
#ifdef CONFIG_SOC_NRF54H20_GPD
600+
nrf_gpd_retain_pins_set(dev_config->pcfg, false);
601+
#endif
602+
595603
break;
596604

597605
case PM_DEVICE_ACTION_SUSPEND:
@@ -600,6 +608,10 @@ static int spim_nrfx_pm_action(const struct device *dev,
600608
dev_data->initialized = false;
601609
}
602610

611+
#ifdef CONFIG_SOC_NRF54H20_GPD
612+
nrf_gpd_retain_pins_set(dev_config->pcfg, true);
613+
#endif
614+
603615
ret = pinctrl_apply_state(dev_config->pcfg,
604616
PINCTRL_STATE_SLEEP);
605617
break;

0 commit comments

Comments
 (0)