Re: [PATCH] spi: Add SPI_NO_TX/RX support

From: Andy Shevchenko
Date: Wed Nov 11 2020 - 09:45:51 EST


On Wed, Nov 11, 2020 at 4:13 PM Alexandru Ardelean
<alexandru.ardelean@xxxxxxxxxx> wrote:
>
> From: Dragos Bogdan <dragos.bogdan@xxxxxxxxxx>
>
> Transmit/receive only is a valid SPI mode. For example, the MOSI/TX line
> might be missing from an ADC while for a DAC the MISO/RX line may be
> optional. This patch adds these two new modes: SPI_NO_TX and
> SPI_NO_RX. This way, the drivers will be able to identify if any of
> these two lines is missing and to adjust the transfers accordingly.

Shouldn't this update a binding documentation?

...

> - /* check mode to prevent that DUAL and QUAD set at the same time
> + /* check mode to prevent that any two of DUAL, QUAD and NO_MOSI/MISO
> + * are set at the same time
> */

/*
* Perhaps switch to proper multi-line comment style
* at the same time?
*/

...

> #define SPI_TX_OCTAL 0x2000 /* transmit with 8 wires */
> #define SPI_RX_OCTAL 0x4000 /* receive with 8 wires */
> #define SPI_3WIRE_HIZ 0x8000 /* high impedance turnaround */
> +#define SPI_NO_TX 0x10000 /* no transmit wire */
> +#define SPI_NO_RX 0x20000 /* no receive wire */

Perhaps switch to use BIT() instead at some point (as a prerequisite
patch, for example)

--
With Best Regards,
Andy Shevchenko