diff options
author | Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> | 2015-01-23 11:08:34 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-01-26 14:23:35 -0500 |
commit | 0240f94516964db00d0fc1d1e676f3c273710e17 (patch) | |
tree | 7d2031b153c6c9d48c66a655fd57bfe9614e9e53 /drivers/spi | |
parent | bca690db90b832a58756b30d5ff41e65881216f9 (diff) |
spi/xilinx: Support for spi mode LOOP
Hardware supports LOOP mode. Support it also in the driver.
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-xilinx.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c index d4edeeeabbc3..e1d9a2003ae6 100644 --- a/drivers/spi/spi-xilinx.c +++ b/drivers/spi/spi-xilinx.c | |||
@@ -35,7 +35,7 @@ | |||
35 | #define XSPI_CR_CPOL 0x08 | 35 | #define XSPI_CR_CPOL 0x08 |
36 | #define XSPI_CR_CPHA 0x10 | 36 | #define XSPI_CR_CPHA 0x10 |
37 | #define XSPI_CR_MODE_MASK (XSPI_CR_CPHA | XSPI_CR_CPOL | \ | 37 | #define XSPI_CR_MODE_MASK (XSPI_CR_CPHA | XSPI_CR_CPOL | \ |
38 | XSPI_CR_LSB_FIRST) | 38 | XSPI_CR_LSB_FIRST | XSPI_CR_LOOP) |
39 | #define XSPI_CR_TXFIFO_RESET 0x20 | 39 | #define XSPI_CR_TXFIFO_RESET 0x20 |
40 | #define XSPI_CR_RXFIFO_RESET 0x40 | 40 | #define XSPI_CR_RXFIFO_RESET 0x40 |
41 | #define XSPI_CR_MANUAL_SSELECT 0x80 | 41 | #define XSPI_CR_MANUAL_SSELECT 0x80 |
@@ -197,6 +197,8 @@ static void xilinx_spi_chipselect(struct spi_device *spi, int is_on) | |||
197 | cr |= XSPI_CR_CPOL; | 197 | cr |= XSPI_CR_CPOL; |
198 | if (spi->mode & SPI_LSB_FIRST) | 198 | if (spi->mode & SPI_LSB_FIRST) |
199 | cr |= XSPI_CR_LSB_FIRST; | 199 | cr |= XSPI_CR_LSB_FIRST; |
200 | if (spi->mode & SPI_LOOP) | ||
201 | cr |= XSPI_CR_LOOP; | ||
200 | xspi->write_fn(cr, xspi->regs + XSPI_CR_OFFSET); | 202 | xspi->write_fn(cr, xspi->regs + XSPI_CR_OFFSET); |
201 | 203 | ||
202 | /* We do not check spi->max_speed_hz here as the SPI clock | 204 | /* We do not check spi->max_speed_hz here as the SPI clock |
@@ -356,7 +358,7 @@ static int xilinx_spi_probe(struct platform_device *pdev) | |||
356 | return -ENODEV; | 358 | return -ENODEV; |
357 | 359 | ||
358 | /* the spi->mode bits understood by this driver: */ | 360 | /* the spi->mode bits understood by this driver: */ |
359 | master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_LSB_FIRST; | 361 | master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_LSB_FIRST | SPI_LOOP; |
360 | 362 | ||
361 | xspi = spi_master_get_devdata(master); | 363 | xspi = spi_master_get_devdata(master); |
362 | xspi->bitbang.master = master; | 364 | xspi->bitbang.master = master; |