diff options
author | Yogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com> | 2018-12-03 08:39:06 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-12-03 17:14:53 +0000 |
commit | 6b03061f882de49b83ccf44beb3a12c920a2da1b (patch) | |
tree | fde15c5042859a38003ae199754b51deb3595e9c /drivers/spi | |
parent | c2b142cc3939e932d4fa2210c2a5155df5736590 (diff) | |
download | linux-stable-6b03061f882de49b83ccf44beb3a12c920a2da1b.tar.gz linux-stable-6b03061f882de49b83ccf44beb3a12c920a2da1b.tar.bz2 linux-stable-6b03061f882de49b83ccf44beb3a12c920a2da1b.zip |
spi: add support for octal mode I/O data transfer
Add flags for Octal mode I/O data transfer
Required for the SPI controller which can do the data transfer (TX/RX)
on 8 data lines e.g. NXP FlexSPI controller.
SPI_TX_OCTAL: transmit with 8 wires
SPI_RX_OCTAL: receive with 8 wires
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>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index b6fd8ea8ac0d..18ebc400249c 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -1633,6 +1633,9 @@ static int of_spi_parse_dt(struct spi_controller *ctlr, struct spi_device *spi, case 4: spi->mode |= SPI_TX_QUAD; break; + case 8: + spi->mode |= SPI_TX_OCTAL; + break; default: dev_warn(&ctlr->dev, "spi-tx-bus-width %d not supported\n", @@ -1651,6 +1654,9 @@ static int of_spi_parse_dt(struct spi_controller *ctlr, struct spi_device *spi, case 4: spi->mode |= SPI_RX_QUAD; break; + case 8: + spi->mode |= SPI_RX_OCTAL; + break; default: dev_warn(&ctlr->dev, "spi-rx-bus-width %d not supported\n", @@ -2839,7 +2845,8 @@ int spi_setup(struct spi_device *spi) /* if it is SPI_3WIRE mode, DUAL and QUAD should be forbidden */ if ((spi->mode & SPI_3WIRE) && (spi->mode & - (SPI_TX_DUAL | SPI_TX_QUAD | SPI_RX_DUAL | SPI_RX_QUAD))) + (SPI_TX_DUAL | SPI_TX_QUAD | SPI_TX_OCTAL | + SPI_RX_DUAL | SPI_RX_QUAD | SPI_RX_OCTAL))) return -EINVAL; /* help drivers fail *cleanly* when they need options * that aren't supported with their current controller @@ -2848,7 +2855,8 @@ int spi_setup(struct spi_device *spi) */ bad_bits = spi->mode & ~(spi->controller->mode_bits | SPI_CS_WORD); ugly_bits = bad_bits & - (SPI_TX_DUAL | SPI_TX_QUAD | SPI_RX_DUAL | SPI_RX_QUAD); + (SPI_TX_DUAL | SPI_TX_QUAD | SPI_TX_OCTAL | + SPI_RX_DUAL | SPI_RX_QUAD | SPI_RX_OCTAL); if (ugly_bits) { dev_warn(&spi->dev, "setup: ignoring unsupported mode bits %x\n", |