aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <[email protected]>2012-12-06 15:55:33 +0000
committerGrant Likely <[email protected]>2012-12-07 13:13:56 +0000
commitc20151dff8a6d503c0d0cc4387c33a618cdabcb7 (patch)
tree79eddf6e2d19950611613ce62d56db9a00e865fd /drivers/spi/spi.c
parentspi: Fix comparison of different integer types (diff)
downloadkernel-c20151dff8a6d503c0d0cc4387c33a618cdabcb7.tar.gz
kernel-c20151dff8a6d503c0d0cc4387c33a618cdabcb7.zip
spi: Add support for specifying 3-wire mode via device tree
This patch allows to specify that a SPI device is connected in 3-wire mode via device tree. Signed-off-by: Lars-Peter Clausen <[email protected]> Acked-by: Rob Herring <[email protected]> Signed-off-by: Grant Likely <[email protected]>
Diffstat (limited to 'drivers/spi/spi.c')
-rw-r--r--drivers/spi/spi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index b370d292d19c..2ca5f079ff01 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -861,6 +861,8 @@ static void of_register_spi_devices(struct spi_master *master)
spi->mode |= SPI_CPOL;
if (of_find_property(nc, "spi-cs-high", NULL))
spi->mode |= SPI_CS_HIGH;
+ if (of_find_property(nc, "spi-3wire", NULL))
+ spi->mode |= SPI_3WIRE;
/* Device speed */
prop = of_get_property(nc, "spi-max-frequency", &len);