From: Yogesh Narayan Gaur Date: Mon, 3 Dec 2018 08:39:12 +0000 (+0000) Subject: spi: spi-mem: add support for octal mode I/O data transfer X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b12a084c8729ef423089bb9a5a143eed39cd94e7;p=openwrt%2Fstaging%2Fblogic.git spi: spi-mem: add support for octal mode I/O data transfer Add support for octal mode I/O data transfer in spi-mem framework. Signed-off-by: Yogesh Gaur Reviewed-by: Boris Brezillon Signed-off-by: Mark Brown --- diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c index 62a7b80801d2..5e15d62775e9 100644 --- a/drivers/spi/spi-mem.c +++ b/drivers/spi/spi-mem.c @@ -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; }