diff options
author | Michael Welling <mwelling@ieee.org> | 2015-05-23 22:13:43 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-05-25 08:00:04 -0400 |
commit | 4373f8b6dab0de16e5ecf527626d958d20a45b3b (patch) | |
tree | 8cd6e6955a7ebb50ac2c5075da8a73f5a3fc291d /drivers/spi/spi-omap2-mcspi.c | |
parent | be632f658462f5c80817a383c6d9b9790c0e7d1f (diff) |
spi: omap2-mcspi: Fix set_cs function for active high
The core spi driver swaps the polarity of the enable based on SPI_CS_HIGH.
The omap2 controller has an internal configuration register bit called
OMAP2_MCSPI_CHCONF_EPOL to handle active high chip selects as well.
So we have to revert swap the polarity back for the correct setting of the
OMAP2_MCSPI_CHCONF_FORCE bit in omap2_mcspi_set_cs.
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.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c index 304b427db95d..502db29fd0fe 100644 --- a/drivers/spi/spi-omap2-mcspi.c +++ b/drivers/spi/spi-omap2-mcspi.c | |||
@@ -247,6 +247,13 @@ static void omap2_mcspi_set_cs(struct spi_device *spi, bool enable) | |||
247 | { | 247 | { |
248 | u32 l; | 248 | u32 l; |
249 | 249 | ||
250 | /* The controller handles the inverted chip selects | ||
251 | * using the OMAP2_MCSPI_CHCONF_EPOL bit so revert | ||
252 | * the inversion from the core spi_set_cs function. | ||
253 | */ | ||
254 | if (spi->mode & SPI_CS_HIGH) | ||
255 | enable = !enable; | ||
256 | |||
250 | if (spi->controller_state) { | 257 | if (spi->controller_state) { |
251 | l = mcspi_cached_chconf0(spi); | 258 | l = mcspi_cached_chconf0(spi); |
252 | 259 | ||