Re: [PATCH 2/2] spi: tools: Fix build errors

2020-06-11 Thread zhangqing

On 06/11/2020 04:02 PM, Geert Uytterhoeven wrote:

Hi Qing,

Thanks for your patch!

On Thu, Jun 11, 2020 at 5:43 AM Qing Zhang  wrote:

Fix the following build errors:

include/linux/spi 2>&1 || true
ln -sf /home/zhangqing/spi.git2/tools/spi/../../include/uapi/linux/spi/spidev.h 
include/linux/spi/spidev.h
make -f /home/zhangqing/spi.git2/tools/build/Makefile.build dir=. 
obj=spidev_test
make[1]: Entering directory '/home/zhangqing/spi.git2/tools/spi'
   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
/home/zhangqing/spi.git2/tools/build/Makefile.build:144: recipe for target 
'spidev_test-in.o' failed
make[1]: *** [spidev_test-in.o] Error 1
make[1]: Leaving directory '/home/zhangqing/spi.git2/tools/spi'
Makefile:39: recipe for target 'spidev_test-in.o' failed
make: *** [spidev_test-in.o] Error 2

Signed-off-by: Qing Zhang 

Oops, somehow I forgot I had made a similar change on the target
when adding Octal mode support to spidev_test.c.
Sorry for that.

Fixes: 896fa735084e4a91 ("spi: spidev_test: Add support for Octal mode
data transfers")
Reviewed-by: Geert Uytterhoeven 


--- a/include/uapi/linux/spi/spidev.h
+++ b/include/uapi/linux/spi/spidev.h
@@ -48,6 +48,8 @@
  #define SPI_TX_QUAD0x200
  #define SPI_RX_DUAL0x400
  #define SPI_RX_QUAD0x800
+#defineSPI_TX_OCTAL0x2000
+#defineSPI_RX_OCTAL0x4000

Probably we should add SPI_CS_WORD and SPI_3WIRE_HIZ, too?


Hi Geert,

Thanks for your reply and suggestion.
Maybe SPI_CS_WORD and SPI_3WIRE_HIZ will be used in the future.
I will do it and then send v2.

Thanks,
Qing



Gr{oetje,eeting}s,

 Geert





Re: [PATCH 2/2] spi: tools: Fix build errors

2020-06-11 Thread Geert Uytterhoeven
Hi Qing,

Thanks for your patch!

On Thu, Jun 11, 2020 at 5:43 AM Qing Zhang  wrote:
> Fix the following build errors:
>
> include/linux/spi 2>&1 || true
> ln -sf 
> /home/zhangqing/spi.git2/tools/spi/../../include/uapi/linux/spi/spidev.h 
> include/linux/spi/spidev.h
> make -f /home/zhangqing/spi.git2/tools/build/Makefile.build dir=. 
> obj=spidev_test
> make[1]: Entering directory '/home/zhangqing/spi.git2/tools/spi'
>   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
> /home/zhangqing/spi.git2/tools/build/Makefile.build:144: recipe for target 
> 'spidev_test-in.o' failed
> make[1]: *** [spidev_test-in.o] Error 1
> make[1]: Leaving directory '/home/zhangqing/spi.git2/tools/spi'
> Makefile:39: recipe for target 'spidev_test-in.o' failed
> make: *** [spidev_test-in.o] Error 2
>
> Signed-off-by: Qing Zhang 

Oops, somehow I forgot I had made a similar change on the target
when adding Octal mode support to spidev_test.c.
Sorry for that.

Fixes: 896fa735084e4a91 ("spi: spidev_test: Add support for Octal mode
data transfers")
Reviewed-by: Geert Uytterhoeven 

> --- a/include/uapi/linux/spi/spidev.h
> +++ b/include/uapi/linux/spi/spidev.h
> @@ -48,6 +48,8 @@
>  #define SPI_TX_QUAD0x200
>  #define SPI_RX_DUAL0x400
>  #define SPI_RX_QUAD0x800
> +#defineSPI_TX_OCTAL0x2000
> +#defineSPI_RX_OCTAL0x4000

Probably we should add SPI_CS_WORD and SPI_3WIRE_HIZ, too?

Gr{oetje,eeting}s,

Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds


[PATCH 2/2] spi: tools: Fix build errors

2020-06-10 Thread Qing Zhang
Fix the following build errors:

include/linux/spi 2>&1 || true
ln -sf /home/zhangqing/spi.git2/tools/spi/../../include/uapi/linux/spi/spidev.h 
include/linux/spi/spidev.h
make -f /home/zhangqing/spi.git2/tools/build/Makefile.build dir=. 
obj=spidev_test
make[1]: Entering directory '/home/zhangqing/spi.git2/tools/spi'
  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
/home/zhangqing/spi.git2/tools/build/Makefile.build:144: recipe for target 
'spidev_test-in.o' failed
make[1]: *** [spidev_test-in.o] Error 1
make[1]: Leaving directory '/home/zhangqing/spi.git2/tools/spi'
Makefile:39: recipe for target 'spidev_test-in.o' failed
make: *** [spidev_test-in.o] Error 2

Signed-off-by: Qing Zhang 
---
 include/uapi/linux/spi/spidev.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/uapi/linux/spi/spidev.h b/include/uapi/linux/spi/spidev.h
index ee0f246..8b04c62 100644
--- a/include/uapi/linux/spi/spidev.h
+++ b/include/uapi/linux/spi/spidev.h
@@ -48,6 +48,8 @@
 #define SPI_TX_QUAD0x200
 #define SPI_RX_DUAL0x400
 #define SPI_RX_QUAD0x800
+#defineSPI_TX_OCTAL0x2000
+#defineSPI_RX_OCTAL0x4000
 
 /*---*/
 
-- 
2.1.0