spi: spi-mem: add support for octal mode I/O data transfer
authorYogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com>
Mon, 3 Dec 2018 08:39:12 +0000 (08:39 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 3 Dec 2018 17:20:14 +0000 (17:20 +0000)
Add support for octal mode I/O data transfer in spi-mem framework.

Signed-off-by: Yogesh Gaur <yogeshnarayan.gaur@nxp.com>
Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-mem.c

index 62a7b80801d22098f24f8bc0711b7d5f63c557d6..5e15d62775e9e18e877edb3096bd1c790401a0b0 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "internals.h"
 
-#define SPI_MEM_MAX_BUSWIDTH           4
+#define SPI_MEM_MAX_BUSWIDTH           8
 
 /**
  * spi_controller_dma_map_mem_op_data() - DMA-map the buffer attached to a
@@ -121,6 +121,13 @@ static int spi_check_buswidth_req(struct spi_mem *mem, u8 buswidth, bool tx)
 
                break;
 
+       case 8:
+               if ((tx && (mode & SPI_TX_OCTAL)) ||
+                   (!tx && (mode & SPI_RX_OCTAL)))
+                       return 0;
+
+               break;
+
        default:
                break;
        }