Even if find out the amount of time MOSI would be required high prior to CS low, then we would need some sort of MOSI high/low state set with a delay prior to active CS. That might be enough to support the AD4000 series of devices but, would it be worth the added complexity? > > > + > > +Peripherals that require this extension must request it by setting the > > +SPI_MOSI_IDLE_HIGH bit into the mode attribute of their struct spi_device and > > Could use inline code formatting for C code bits, e.g. ``struct spi_device`` > ``SPI_MOSI_IDLE_HIGH``, etc. ok, updated those for v5. > > > +call spi_setup(). Controllers that support this extension should indicate it by> +setting SPI_MOSI_IDLE_HIGH in the mode_bits attribute of their struct > > +spi_controller. The configuration to idle MOSI low is analogous but uses the > > +SPI_MOSI_IDLE_LOW mode bit. > > + > > + > > THANKS TO > > --------- > > Contributors to Linux-SPI discussions include (in alphabetical order, > > ... > > > index e8e1e798924f..8e50a8559225 100644 > > --- a/include/linux/spi/spi.h > > +++ b/include/linux/spi/spi.h > > @@ -599,6 +599,12 @@ struct spi_controller { > > * assert/de-assert more than one chip select at once. > > */ > > #define SPI_CONTROLLER_MULTI_CS BIT(7) > > + /* > > + * The spi-controller is capable of keeping the MOSI line low or high > > + * when not clocking out data. > > + */ > > +#define SPI_CONTROLLER_MOSI_IDLE_LOW BIT(8) /* Can idle MOSI low */ > > +#define SPI_CONTROLLER_MOSI_IDLE_HIGH BIT(9) /* Can idle MOSI high */ > > I don't see where these are used anywhere else in the series. They > seem redundant with SPI_MOSI_IDLE_LOW and SPI_MOSI_IDLE_HIGH. > Good point. They are currently not being used. Comparing with what we have for SPI_CONTROLLER_MULTI_CS, I'm thinking it may be handy to have dt properties to indicate controller MOSI idle capabilities. Does that sound reasonable? > > > > /* Flag indicating if the allocation of this struct is devres-managed */ > > bool devm_allocated; > > diff --git a/include/uapi/linux/spi/spi.h b/include/uapi/linux/spi/spi.h > > index ca56e477d161..ee4ac812b8f8 100644 > > --- a/include/uapi/linux/spi/spi.h > > +++ b/include/uapi/linux/spi/spi.h > > @@ -28,7 +28,8 @@ > > #define SPI_RX_OCTAL _BITUL(14) /* receive with 8 wires */ > > #define SPI_3WIRE_HIZ _BITUL(15) /* high impedance turnaround */ > > #define SPI_RX_CPHA_FLIP _BITUL(16) /* flip CPHA on Rx only xfer */ > > -#define SPI_MOSI_IDLE_LOW _BITUL(17) /* leave mosi line low when idle */ > > +#define SPI_MOSI_IDLE_LOW _BITUL(17) /* leave MOSI line low when idle */ > > +#define SPI_MOSI_IDLE_HIGH _BITUL(18) /* leave MOSI line high when idle */ > > > > /* > > * All the bits defined above should be covered by SPI_MODE_USER_MASK. > > @@ -38,6 +39,6 @@ > > * These bits must not overlap. A static assert check should make sure of that. > > * If adding extra bits, make sure to increase the bit index below as well. > > */ > > -#define SPI_MODE_USER_MASK (_BITUL(18) - 1) > > +#define SPI_MODE_USER_MASK (_BITUL(19) - 1) > > > > #endif /* _UAPI_SPI_H */ >