summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-bcm2835.c
diff options
context:
space:
mode:
authorMartin Sperl <kernel@martin.sperl.org>2015-03-19 10:01:53 +0100
committerMark Brown <broonie@kernel.org>2015-03-23 19:54:34 +0100
commit6935224da2482a261c786501fbccb1dc4a675225 (patch)
tree56fd215b05bc43b505ce124ebdf3c22bbc20c46d /drivers/spi/spi-bcm2835.c
parentspi: bcm2835: clock divider can be a multiple of 2 (diff)
downloadlinux-6935224da2482a261c786501fbccb1dc4a675225.tar.xz
linux-6935224da2482a261c786501fbccb1dc4a675225.zip
spi: bcm2835: enable support of 3-wire mode
Signed-off-by: Martin Sperl <kernel@martin.sperl.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-bcm2835.c')
-rw-r--r--drivers/spi/spi-bcm2835.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c
index 8de1925fe554..3f93718aad3f 100644
--- a/drivers/spi/spi-bcm2835.c
+++ b/drivers/spi/spi-bcm2835.c
@@ -67,7 +67,8 @@
#define BCM2835_SPI_CS_CS_01 0x00000001
#define BCM2835_SPI_TIMEOUT_MS 30000
-#define BCM2835_SPI_MODE_BITS (SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_NO_CS)
+#define BCM2835_SPI_MODE_BITS (SPI_CPOL | SPI_CPHA | SPI_CS_HIGH \
+ | SPI_NO_CS | SPI_3WIRE)
#define DRV_NAME "spi-bcm2835"
@@ -163,6 +164,9 @@ static int bcm2835_spi_start_transfer(struct spi_device *spi,
cdiv = 0; /* 0 is the slowest we can go */
}
+ if ((spi->mode & SPI_3WIRE) && (tfr->rx_buf))
+ cs |= BCM2835_SPI_CS_REN;
+
if (spi->mode & SPI_CPOL)
cs |= BCM2835_SPI_CS_CPOL;
if (spi->mode & SPI_CPHA)