aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Ocker <weo@reccoware.de>2008-10-15 15:00:47 +0200
committerKumar Gala <galak@kernel.crashing.org>2008-10-20 23:34:01 -0500
commitf618ebfcbf9616a0fa9a78f5ecb69762f0fa3c59 (patch)
tree89ac6262cce1610e61aa846ae305ea2c0c6323b2
parentfd657efc67dbd70f422285101a50c2e84d03463d (diff)
downloadlinux-linaro-f618ebfcbf9616a0fa9a78f5ecb69762f0fa3c59.tar.gz
of/spi: Support specifying chip select as active high via device tree
The patch allows to specify that an SPI device needs an active high chip select. Signed-off-by: Wolfgang Ocker <weo@reccoware.de> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
-rw-r--r--Documentation/powerpc/booting-without-of.txt2
-rw-r--r--drivers/of/of_spi.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt
index de4063cb4fd..02ea9a971b8 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -1917,6 +1917,8 @@ platforms are moved over to use the flattened-device-tree model.
inverse clock polarity (CPOL) mode
- spi-cpha - (optional) Empty property indicating device requires
shifted clock phase (CPHA) mode
+ - spi-cs-high - (optional) Empty property indicating device requires
+ chip select active high
SPI example for an MPC5200 SPI bus:
spi@f00 {
diff --git a/drivers/of/of_spi.c b/drivers/of/of_spi.c
index b01eec026f6..bed0ed6dcdc 100644
--- a/drivers/of/of_spi.c
+++ b/drivers/of/of_spi.c
@@ -61,6 +61,8 @@ void of_register_spi_devices(struct spi_master *master, struct device_node *np)
spi->mode |= SPI_CPHA;
if (of_find_property(nc, "spi-cpol", NULL))
spi->mode |= SPI_CPOL;
+ if (of_find_property(nc, "spi-cs-high", NULL))
+ spi->mode |= SPI_CS_HIGH;
/* Device speed */
prop = of_get_property(nc, "spi-max-frequency", &len);