]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
spi: add "spi-lsb-first" to devicetree
authorZhao Qiang <B45475@freescale.com>
Tue, 1 Apr 2014 09:10:50 +0000 (17:10 +0800)
committerNitin Garg <nitin.garg@freescale.com>
Fri, 16 Jan 2015 03:18:59 +0000 (21:18 -0600)
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>
(cherry picked from commit cd6339e6ced387ad67b5551dd2931cfd7e8b970b)
(cherry picked from commit 09623c20b3e6b11a914343d4b0f15b63e683f0d8)

Documentation/devicetree/bindings/spi/spi-bus.txt
drivers/spi/spi.c

index e5a4d1b4acfe1efca8b0a41d5d736ddf8187f009..22d57404fdc33cf0a4c5798240fa3f5a32f0dde4 100644 (file)
@@ -55,6 +55,8 @@ contain the following properties.
                chip select active high
 - spi-3wire       - (optional) Empty property indicating device requires
                    3-wire mode.
+- spi-lsb-first   - (optional) Empty property indicating device requires
+               LSB first mode.
 - spi-tx-bus-width - (optional) The bus width(number of data wires) that
                       used for MOSI. Defaults to 1 if not present.
 - spi-rx-bus-width - (optional) The bus width(number of data wires) that
index b2801851e257ba5c2fd899c830aced82bd3f2a60..67e023815b24c28208734400a29f34c492914408 100644 (file)
@@ -1239,6 +1239,8 @@ static void of_register_spi_devices(struct spi_master *master)
                        spi->mode |= SPI_CS_HIGH;
                if (of_find_property(nc, "spi-3wire", NULL))
                        spi->mode |= SPI_3WIRE;
+               if (of_find_property(nc, "spi-lsb-first", NULL))
+                       spi->mode |= SPI_LSB_FIRST;
 
                /* Device DUAL/QUAD mode */
                if (!of_property_read_u32(nc, "spi-tx-bus-width", &value)) {