From 4cefed004d24bdcd3b2a5f47b1dfe77c0dd92269 Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Thu, 17 Jul 2025 17:27:55 +1000 Subject: [PATCH] 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 --- drivers/serial/uart_nrfx_uarte.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 46c5a8b83d2e9..c19d5a4816abe 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -2490,6 +2490,11 @@ static int uarte_instance_init(const struct device *dev, ((struct pinctrl_dev_config *)cfg->pcfg)->reg = (uintptr_t)cfg->uarte_regs; } + /* Apply sleep state by default. + * If PM is disabled, the default state will be applied in pm_device_driver_init. + */ + (void)pinctrl_apply_state(cfg->pcfg, PINCTRL_STATE_SLEEP); + #ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE err = uarte_nrfx_configure(dev, &((struct uarte_nrfx_data *)dev->data)->uart_config); if (err) {