Skip to content

Commit dc6fc8e

Browse files
committed
[nrf fromtree] drivers: serial: nrfx_uarte: Fix pin retention
b6d4542 Added support for pin retention but it was added only to the case when device PM is used. There is another mode in which UARTE is disabled when idle (low power mode) and in that case pin retention must also be added. Signed-off-by: Krzysztof Chruściński <[email protected]> (cherry picked from commit 760bba6)
1 parent d4ebf62 commit dc6fc8e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

drivers/serial/uart_nrfx_uarte.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,9 @@ static void uarte_periph_enable(const struct device *dev)
590590

591591
(void)data;
592592
nrf_uarte_enable(uarte);
593+
#ifdef CONFIG_SOC_NRF54H20_GPD
594+
nrf_gpd_retain_pins_set(config->pcfg, false);
595+
#endif
593596
#if UARTE_BAUDRATE_RETENTION_WORKAROUND
594597
nrf_uarte_baudrate_set(uarte,
595598
COND_CODE_1(CONFIG_UART_USE_RUNTIME_CONFIGURE,
@@ -702,6 +705,11 @@ static void uarte_disable_locked(const struct device *dev, uint32_t dis_mask)
702705
}
703706
#endif
704707

708+
#ifdef CONFIG_SOC_NRF54H20_GPD
709+
const struct uarte_nrfx_config *cfg = dev->config;
710+
711+
nrf_gpd_retain_pins_set(cfg->pcfg, true);
712+
#endif
705713
nrf_uarte_disable(get_uarte_instance(dev));
706714
}
707715

@@ -2103,9 +2111,6 @@ static void uarte_pm_resume(const struct device *dev)
21032111

21042112
if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME) || !LOW_POWER_ENABLED(cfg)) {
21052113
uarte_periph_enable(dev);
2106-
#ifdef CONFIG_SOC_NRF54H20_GPD
2107-
nrf_gpd_retain_pins_set(cfg->pcfg, false);
2108-
#endif
21092114
}
21102115
}
21112116

0 commit comments

Comments
 (0)