Re: [PATCH 1/2 v2] spi: add SPI_MOSI_IDLE_LOW support from device tree

From: Marcelo Schmitt

Date: Sun Mar 29 2026 - 10:25:34 EST


Hello Charles-Antoine,

On 03/29, charles-antoine.couret@xxxxxxx wrote:
> From: Charles-Antoine Couret <charles-antoine.couret@xxxxxxx>
>
> This flag was introduced but was not added as device tree property which is
> limiting the possibility to use this flag on real devices.

I'm not seeing why a device tree property is needed for SPI idle modes. For
idling high, the configuration is requested through spi_setup(). It should
work in similar way for idling low. See spi-summary.rst. If believe a dt
property is needed despite the spi_setup() interface, can you elaborate on why?

>
> This flag can be configured as done for other flags.
>
> Signed-off-by: Charles-Antoine Couret <charles-antoine.couret@xxxxxxx>
> ---
> drivers/spi/spi.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
> index 9b1125556d29..489a64e20305 100644
> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c
> @@ -2363,6 +2363,8 @@ static int of_spi_parse_dt(struct spi_controller *ctlr, struct spi_device *spi,
> spi->mode |= SPI_LSB_FIRST;
> if (of_property_read_bool(nc, "spi-cs-high"))
> spi->mode |= SPI_CS_HIGH;
> + if (of_property_read_bool(nc, "spi-mosi-idle-low"))
> + spi->mode |= SPI_MOSI_IDLE_LOW;
>
> /* Device DUAL/QUAD mode */
>
> --
> 2.53.0
>
>

With best regards,
Marcelo