Skip to content

Commit

Permalink
spi: Add support for specifying 3-wire mode via device tree
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lars-Peter Clausen authored and Grant Likely committed Dec 7, 2012
1 parent 5323f49 commit c20151d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/spi/spi-bus.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions drivers/spi/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c20151d

Please sign in to comment.