Skip to content

Commit 07fd342

Browse files
mstasiaknordicrlubos
authored andcommitted
[nrf fromlist] drivers: pwm: nrfx: add pin retention
Add pin retenion if GPD is enabled for nRF54H20. Upstream PR #: 80672 Signed-off-by: Michał Stasiak <[email protected]> (cherry picked from commit b524b0e)
1 parent 5c5da25 commit 07fd342

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/pwm/pwm_nrfx.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
#include <zephyr/linker/devicetree_regions.h>
1414
#include <zephyr/cache.h>
1515
#include <zephyr/mem_mgmt/mem_attr.h>
16+
#ifdef CONFIG_SOC_NRF54H20_GPD
17+
#include <nrf/gpd.h>
18+
#endif
1619

1720
#include <zephyr/logging/log.h>
1821

@@ -274,6 +277,10 @@ static void pwm_resume(const struct device *dev)
274277

275278
(void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT);
276279

280+
#ifdef CONFIG_SOC_NRF54H20_GPD
281+
nrf_gpd_retain_pins_set(config->pcfg, false);
282+
#endif
283+
277284
for (size_t i = 0; i < NRF_PWM_CHANNEL_COUNT; i++) {
278285
uint32_t psel;
279286

@@ -302,6 +309,10 @@ static void pwm_suspend(const struct device *dev)
302309
while (!nrfx_pwm_stopped_check(&config->pwm)) {
303310
}
304311

312+
#ifdef CONFIG_SOC_NRF54H20_GPD
313+
nrf_gpd_retain_pins_set(config->pcfg, true);
314+
#endif
315+
305316
memset(dev->data, 0, sizeof(struct pwm_nrfx_data));
306317
(void)pinctrl_apply_state(config->pcfg, PINCTRL_STATE_SLEEP);
307318
}

0 commit comments

Comments
 (0)