Skip to content

Commit f969f75

Browse files
JordanYatesPerMac
authored andcommitted
[nrf fromtree] serial: nrfx_uarte: initial pin state to SLEEP
Configure the initial pin state of the UARTE peripheral to SLEEP, not left uninitialised. This fixes the pin configuration not being set until the interface is used if `zephyr,pm-device-runtime-auto` is enabled. Signed-off-by: Jordan Yates <[email protected]> (cherry picked from commit 69acc01)
1 parent c64ca2e commit f969f75

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/serial/uart_nrfx_uarte.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2490,6 +2490,11 @@ static int uarte_instance_init(const struct device *dev,
24902490
((struct pinctrl_dev_config *)cfg->pcfg)->reg = (uintptr_t)cfg->uarte_regs;
24912491
}
24922492

2493+
/* Apply sleep state by default.
2494+
* If PM is disabled, the default state will be applied in pm_device_driver_init.
2495+
*/
2496+
(void)pinctrl_apply_state(cfg->pcfg, PINCTRL_STATE_SLEEP);
2497+
24932498
#ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE
24942499
err = uarte_nrfx_configure(dev, &((struct uarte_nrfx_data *)dev->data)->uart_config);
24952500
if (err) {

0 commit comments

Comments
 (0)