]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
spi: quad: fix the name of DT property
authorwangyuhang <wangyuhang2014@gmail.com>
Sun, 1 Sep 2013 09:36:21 +0000 (17:36 +0800)
committerJason Liu <r64343@freescale.com>
Wed, 30 Oct 2013 01:56:10 +0000 (09:56 +0800)
spi: quad: fix the name of DT property in patch

The previous property name spi-tx-nbits and spi-rx-nbits looks not
human-readable. To make it consistent with other devices, using property
name spi-tx-bus-width and spi-rx-bus-width instead of the previous one
specify the number of data wires that spi controller will work in.
Add the specification in spi-bus.txt.

Signed-off-by: wangyuhang <wangyuhang2014@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
Documentation/devicetree/bindings/spi/spi-bus.txt
drivers/spi/spi.c

index 296015e3c632af7d7f6dbc85e862bfd20044a296..800dafe5b01b1b6cc0e6c8f4fcd6d9432c9d699f 100644 (file)
@@ -55,6 +55,16 @@ contain the following properties.
                chip select active high
 - spi-3wire       - (optional) Empty property indicating device requires
                    3-wire 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
+                      used for MISO. Defaults to 1 if not present.
+
+Some SPI controllers and devices support Dual and Quad SPI transfer mode.
+It allows data in SPI system transfered in 2 wires(DUAL) or 4 wires(QUAD).
+Now the value that spi-tx-bus-width and spi-rx-bus-width can receive is
+only 1(SINGLE), 2(DUAL) and 4(QUAD).
+Dual/Quad mode is not allowed when 3-wire mode is used.
 
 If a gpio chipselect is used for the SPI slave the gpio number will be passed
 via the cs_gpio
index 03fd26b19fd3e25d3301df2d610cd0ebf8cdc564..841683f6801ea54b0ca8be1a15dec9baafe82542 100644 (file)
@@ -886,7 +886,7 @@ static void of_register_spi_devices(struct spi_master *master)
                        spi->mode |= SPI_3WIRE;
 
                /* Device DUAL/QUAD mode */
-               prop = of_get_property(nc, "spi-tx-nbits", &len);
+               prop = of_get_property(nc, "spi-tx-bus-width", &len);
                if (prop && len == sizeof(*prop)) {
                        switch (be32_to_cpup(prop)) {
                        case SPI_NBITS_SINGLE:
@@ -899,14 +899,14 @@ static void of_register_spi_devices(struct spi_master *master)
                                break;
                        default:
                                dev_err(&master->dev,
-                                       "spi-tx-nbits %d not supported\n",
+                                       "spi-tx-bus-width %d not supported\n",
                                        be32_to_cpup(prop));
                                spi_dev_put(spi);
                                continue;
                        }
                }
 
-               prop = of_get_property(nc, "spi-rx-nbits", &len);
+               prop = of_get_property(nc, "spi-rx-bus-width", &len);
                if (prop && len == sizeof(*prop)) {
                        switch (be32_to_cpup(prop)) {
                        case SPI_NBITS_SINGLE:
@@ -919,7 +919,7 @@ static void of_register_spi_devices(struct spi_master *master)
                                break;
                        default:
                                dev_err(&master->dev,
-                                       "spi-rx-nbits %d not supported\n",
+                                       "spi-rx-bus-width %d not supported\n",
                                        be32_to_cpup(prop));
                                spi_dev_put(spi);
                                continue;