Skip to content

Commit db290a6

Browse files
adamkondraciuknashif
authored andcommitted
drivers: spi: nrfx_spim: set/clear pins retention
Add pins retention control when GPD is enabled for SPIM. Signed-off-by: Adam Kondraciuk <[email protected]>
1 parent 02bb624 commit db290a6

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
@@ -11,6 +11,9 @@
1111
#include <zephyr/drivers/pinctrl.h>
1212
#include <zephyr/mem_mgmt/mem_attr.h>
1313
#include <soc.h>
14+
#ifdef CONFIG_SOC_NRF54H20_GPD
15+
#include <nrf/gpd.h>
16+
#endif
1417
#ifdef CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58
1518
#include <nrfx_ppi.h>
1619
#endif
@@ -586,6 +589,11 @@ static int spim_nrfx_pm_action(const struct device *dev,
586589
/* nrfx_spim_init() will be called at configuration before
587590
* the next transfer.
588591
*/
592+
593+
#ifdef CONFIG_SOC_NRF54H20_GPD
594+
nrf_gpd_retain_pins_set(dev_config->pcfg, false);
595+
#endif
596+
589597
break;
590598

591599
case PM_DEVICE_ACTION_SUSPEND:
@@ -594,6 +602,10 @@ static int spim_nrfx_pm_action(const struct device *dev,
594602
dev_data->initialized = false;
595603
}
596604

605+
#ifdef CONFIG_SOC_NRF54H20_GPD
606+
nrf_gpd_retain_pins_set(dev_config->pcfg, true);
607+
#endif
608+
597609
ret = pinctrl_apply_state(dev_config->pcfg,
598610
PINCTRL_STATE_SLEEP);
599611
if (ret < 0) {

0 commit comments

Comments
 (0)