]> git.karo-electronics.de Git - linux-beck.git/commitdiff
spi: Add support for specifying 3-wire mode via device tree
authorLars-Peter Clausen <lars@metafoo.de>
Thu, 6 Dec 2012 15:55:33 +0000 (16:55 +0100)
committerGrant Likely <grant.likely@secretlab.ca>
Fri, 7 Dec 2012 13:13:56 +0000 (13:13 +0000)
This patch allows to specify that a SPI device is connected in 3-wire mode via
device tree.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Documentation/devicetree/bindings/spi/spi-bus.txt
drivers/spi/spi.c

index 77a8b0d39b546d9994209b2c0a47a47a46bb12f9..296015e3c632af7d7f6dbc85e862bfd20044a296 100644 (file)
@@ -53,6 +53,8 @@ contain the following properties.
                shifted clock phase (CPHA) mode
 - spi-cs-high     - (optional) Empty property indicating device requires
                chip select active high
+- spi-3wire       - (optional) Empty property indicating device requires
+                   3-wire mode.
 
 If a gpio chipselect is used for the SPI slave the gpio number will be passed
 via the cs_gpio
index b370d292d19c4d93ef3d98bb5cc6a6ee84ebe05f..2ca5f079ff013079186196a5a5b7fa45af9fecd4 100644 (file)
@@ -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);