aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhao Qiang <B45475@freescale.com>2014-04-01 05:10:50 -0400
committerMark Brown <broonie@linaro.org>2014-04-14 12:17:01 -0400
commitcd6339e6ced387ad67b5551dd2931cfd7e8b970b (patch)
treec3222a2ff83afd95c9cd48a6cc602222298dd362
parentc9eaa447e77efe77b7fa4c953bd62de8297fd6c5 (diff)
spi: add "spi-lsb-first" to devicetree
add optional property devicetree for SPI slave nodes into devicetree so that LSB mode can be enabled by devicetree. Signed-off-by: Zhao Qiang <B45475@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--Documentation/devicetree/bindings/spi/spi-bus.txt2
-rw-r--r--drivers/spi/spi.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/spi/spi-bus.txt b/Documentation/devicetree/bindings/spi/spi-bus.txt
index e5a4d1b4acfe..22d57404fdc3 100644
--- a/Documentation/devicetree/bindings/spi/spi-bus.txt
+++ b/Documentation/devicetree/bindings/spi/spi-bus.txt
@@ -55,6 +55,8 @@ contain the following properties.
55 chip select active high 55 chip select active high
56- spi-3wire - (optional) Empty property indicating device requires 56- spi-3wire - (optional) Empty property indicating device requires
57 3-wire mode. 57 3-wire mode.
58- spi-lsb-first - (optional) Empty property indicating device requires
59 LSB first mode.
58- spi-tx-bus-width - (optional) The bus width(number of data wires) that 60- spi-tx-bus-width - (optional) The bus width(number of data wires) that
59 used for MOSI. Defaults to 1 if not present. 61 used for MOSI. Defaults to 1 if not present.
60- spi-rx-bus-width - (optional) The bus width(number of data wires) that 62- spi-rx-bus-width - (optional) The bus width(number of data wires) that
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 4eb9bf02996c..214045c04705 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -1234,6 +1234,8 @@ static void of_register_spi_devices(struct spi_master *master)
1234 spi->mode |= SPI_CS_HIGH; 1234 spi->mode |= SPI_CS_HIGH;
1235 if (of_find_property(nc, "spi-3wire", NULL)) 1235 if (of_find_property(nc, "spi-3wire", NULL))
1236 spi->mode |= SPI_3WIRE; 1236 spi->mode |= SPI_3WIRE;
1237 if (of_find_property(nc, "spi-lsb-first", NULL))
1238 spi->mode |= SPI_LSB_FIRST;
1237 1239
1238 /* Device DUAL/QUAD mode */ 1240 /* Device DUAL/QUAD mode */
1239 if (!of_property_read_u32(nc, "spi-tx-bus-width", &value)) { 1241 if (!of_property_read_u32(nc, "spi-tx-bus-width", &value)) {