Skip to content

Commit b6d4542

Browse files
gmarullmmahadevan108
authored andcommitted
drivers: serial: nrfx_uarte: set/clear pins retention
When GPD is managed by pinctrl, pins retention needs to be controlled by the driver to avoid glitches. Signed-off-by: Gerard Marull-Paretas <[email protected]>
1 parent 77fc183 commit b6d4542

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/serial/uart_nrfx_uarte.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
#include <zephyr/linker/devicetree_regions.h>
2424
#include <zephyr/irq.h>
2525
#include <zephyr/logging/log.h>
26+
27+
#ifdef CONFIG_SOC_NRF54H20_GPD
28+
#include <nrf/gpd.h>
29+
#endif
30+
2631
LOG_MODULE_REGISTER(uart_nrfx_uarte, CONFIG_UART_LOG_LEVEL);
2732

2833
#if !defined(CONFIG_ARCH_POSIX)
@@ -2098,6 +2103,9 @@ static void uarte_pm_resume(const struct device *dev)
20982103

20992104
if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME) || !LOW_POWER_ENABLED(cfg)) {
21002105
uarte_periph_enable(dev);
2106+
#ifdef CONFIG_SOC_NRF54H20_GPD
2107+
nrf_gpd_retain_pins_set(cfg->pcfg, false);
2108+
#endif
21012109
}
21022110
}
21032111

@@ -2160,6 +2168,10 @@ static void uarte_pm_suspend(const struct device *dev)
21602168
wait_for_tx_stopped(dev);
21612169
}
21622170

2171+
#ifdef CONFIG_SOC_NRF54H20_GPD
2172+
nrf_gpd_retain_pins_set(cfg->pcfg, true);
2173+
#endif
2174+
21632175
nrf_uarte_disable(uarte);
21642176

21652177
(void)pinctrl_apply_state(cfg->pcfg, PINCTRL_STATE_SLEEP);

0 commit comments

Comments
 (0)