From 2ba1f1cbe5d9fadfaef187c99ce93a8f45f8291f Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Thu, 17 Jul 2025 13:27:35 +1000 Subject: [PATCH] spi: nrfx_spim: initial pin state to SLEEP, not DEFAULT Configure the initial pin state of the SPIM peripheral to SLEEP, not DEFAULT. This fixes the pins being configured in DEFAULT until the first time the interface is used if `zephyr,pm-device-runtime-auto` is enabled. Signed-off-by: Jordan Yates --- drivers/spi/spi_nrfx_spim.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi_nrfx_spim.c b/drivers/spi/spi_nrfx_spim.c index c92104d9da87..5a3d95007097 100644 --- a/drivers/spi/spi_nrfx_spim.c +++ b/drivers/spi/spi_nrfx_spim.c @@ -731,10 +731,10 @@ static int spi_nrfx_init(const struct device *dev) struct spi_nrfx_data *dev_data = dev->data; int err; - err = pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_DEFAULT); - if (err < 0) { - return err; - } + /* Apply sleep state by default. + * If PM is disabled, the default state will be applied in pm_device_driver_init. + */ + (void)pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_SLEEP); if (dev_config->wake_pin != WAKE_PIN_NOT_USED) { err = spi_nrfx_wake_init(&dev_config->wake_gpiote, dev_config->wake_pin);