Skip to content

Commit 7291793

Browse files
committed
[nrf fromlist] drivers: serial: nrfx_uarte: Reorder suspend
To get a glitchfree UARTE suspend sequence we need to * load the GPIO configuration for the suspend state * disable the UARTE so the GPIO configuration is applied * (optional) enable the GPIO retention as state should stick around The previous sequence (optionally) locked the analog state of the GPIO so the configuration wouldn't actually get applied. Next it disabled the UART, falling back to the existing GPIO state. Next it loaded the new GPIO state, which could be different from the old GPIO state, leading to a potential transition from TX high to low to high. Upstream PR #: 91550 Signed-off-by: Karsten Koenig <[email protected]>
1 parent 68ab1cf commit 7291793

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/serial/uart_nrfx_uarte.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2338,13 +2338,13 @@ static void uarte_pm_suspend(const struct device *dev)
23382338
wait_for_tx_stopped(dev);
23392339
}
23402340

2341-
#ifdef CONFIG_SOC_NRF54H20_GPD
2342-
nrf_gpd_retain_pins_set(cfg->pcfg, true);
2343-
#endif
2341+
(void)pinctrl_apply_state(cfg->pcfg, PINCTRL_STATE_SLEEP);
23442342

23452343
nrf_uarte_disable(uarte);
23462344

2347-
(void)pinctrl_apply_state(cfg->pcfg, PINCTRL_STATE_SLEEP);
2345+
#ifdef CONFIG_SOC_NRF54H20_GPD
2346+
nrf_gpd_retain_pins_set(cfg->pcfg, true);
2347+
#endif
23482348
}
23492349

23502350
static int uarte_nrfx_pm_action(const struct device *dev, enum pm_device_action action)

0 commit comments

Comments
 (0)