Skip to content

Commit e7391af

Browse files
committed
drivers: spi: implement apply default pin state API for ESP32
Implement the apply default pin state API for the ESP32. Signed-off-by: Benedikt Schmidt <[email protected]>
1 parent 7cd0d4b commit e7391af

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/spi/spi_esp32_spim.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,13 @@ static int spi_esp32_release(const struct device *dev,
494494
return 0;
495495
}
496496

497+
static int spi_esp32_apply_default_pin_state(const struct device *dev)
498+
{
499+
const struct spi_esp32_config *cfg = dev->config;
500+
501+
return pinctrl_apply_state(cfg->pcfg, PINCTRL_STATE_DEFAULT);
502+
}
503+
497504
static const struct spi_driver_api spi_api = {
498505
.transceive = spi_esp32_transceive,
499506
#ifdef CONFIG_SPI_ASYNC
@@ -502,7 +509,8 @@ static const struct spi_driver_api spi_api = {
502509
#ifdef CONFIG_SPI_RTIO
503510
.iodev_submit = spi_rtio_iodev_default_submit,
504511
#endif
505-
.release = spi_esp32_release
512+
.release = spi_esp32_release,
513+
.apply_default_pin_state = spi_esp32_apply_default_pin_state,
506514
};
507515

508516
#ifdef CONFIG_SOC_SERIES_ESP32

0 commit comments

Comments
 (0)