summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-omap2-mcspi.c
diff options
context:
space:
mode:
authorMichael Welling <mwelling@ieee.org>2015-05-24 05:13:44 +0300
committerMark Brown <broonie@kernel.org>2015-05-25 15:00:04 +0300
commita06b430fd82c816bf76fb6f6f63f1ae1ced3b897 (patch)
tree283fd0cb8a24634bd2d65fc77a1e0932f04c29c2 /drivers/spi/spi-omap2-mcspi.c
parent4373f8b6dab0de16e5ecf527626d958d20a45b3b (diff)
downloadlinux-a06b430fd82c816bf76fb6f6f63f1ae1ced3b897.tar.xz
spi: omap2-mcspi: Fix GPIO chip select support
The OMAP2_MCSPI_CHCONF_FORCE must be toggled even when using GPIO chip selects. This patch conditionally calls the omap2_mcspi_set_cs function to do so when using GPIO chip selects. Signed-off-by: Michael Welling <mwelling@ieee.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-omap2-mcspi.c')
-rw-r--r--drivers/spi/spi-omap2-mcspi.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index 502db29fd0fe..c4e21adb9bf7 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -1108,6 +1108,9 @@ static int omap2_mcspi_work_one(struct omap2_mcspi *mcspi,
omap2_mcspi_set_enable(spi, 0);
+ if (gpio_is_valid(spi->cs_gpio))
+ omap2_mcspi_set_cs(spi, spi->mode & SPI_CS_HIGH);
+
if (par_override ||
(t->speed_hz != spi->max_speed_hz) ||
(t->bits_per_word != spi->bits_per_word)) {
@@ -1192,6 +1195,9 @@ out:
omap2_mcspi_set_enable(spi, 0);
+ if (gpio_is_valid(spi->cs_gpio))
+ omap2_mcspi_set_cs(spi, !(spi->mode & SPI_CS_HIGH));
+
if (mcspi->fifo_depth > 0 && t)
omap2_mcspi_set_fifo(spi, t, 0);