[PATCH v2 2/2] spi: tools: Add macro definitions to fix build errors

From: Qing Zhang
Date: Thu Jun 11 2020 - 08:57:01 EST


Add SPI_TX_OCTAL and SPI_RX_OCTAL to fix the following build errors:

CC spidev_test.o
spidev_test.c: In function âtransferâ:
spidev_test.c:131:13: error: âSPI_TX_OCTALâ undeclared (first use in this function)
if (mode & SPI_TX_OCTAL)
^
spidev_test.c:131:13: note: each undeclared identifier is reported only once for each function it appears in
spidev_test.c:137:13: error: âSPI_RX_OCTALâ undeclared (first use in this function)
if (mode & SPI_RX_OCTAL)
^
spidev_test.c: In function âparse_optsâ:
spidev_test.c:290:12: error: âSPI_TX_OCTALâ undeclared (first use in this function)
mode |= SPI_TX_OCTAL;
^
spidev_test.c:308:12: error: âSPI_RX_OCTALâ undeclared (first use in this function)
mode |= SPI_RX_OCTAL;
^
LD spidev_test-in.o
ld: cannot find spidev_test.o: No such file or directory

Additionally, maybe SPI_CS_WORD and SPI_3WIRE_HIZ will be used in the future,
so add them too.

Fixes: 896fa735084e ("spi: spidev_test: Add support for Octal mode data transfers")
Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
Signed-off-by: Qing Zhang <zhangqing@xxxxxxxxxxx>
---

v2:
-Modify the patch subject
-Update the commit message
-Add macro definitions of SPI_CS_WORD and SPI_3WIRE_HIZ

include/uapi/linux/spi/spidev.h | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/include/uapi/linux/spi/spidev.h b/include/uapi/linux/spi/spidev.h
index ee0f246..9390615 100644
--- a/include/uapi/linux/spi/spidev.h
+++ b/include/uapi/linux/spi/spidev.h
@@ -48,6 +48,10 @@
#define SPI_TX_QUAD 0x200
#define SPI_RX_DUAL 0x400
#define SPI_RX_QUAD 0x800
+#define SPI_CS_WORD 0x1000
+#define SPI_TX_OCTAL 0x2000
+#define SPI_RX_OCTAL 0x4000
+#define SPI_3WIRE_HIZ 0x8000

/*---------------------------------------------------------------------------*/

--
2.1.0