]> git.karo-electronics.de Git - linux-beck.git/commit
spi: cadence: Make sure that clock polarity changes are applied
authorLars-Peter Clausen <lars@metafoo.de>
Thu, 10 Jul 2014 09:26:28 +0000 (11:26 +0200)
committerMark Brown <broonie@linaro.org>
Fri, 11 Jul 2014 13:39:26 +0000 (14:39 +0100)
commita39e65e9cc935b84f35d080e934c3fdd9ff86654
treecc57d81f14a944e6d833217469b8e525fa9d5939
parent7171511eaec5bf23fb06078f59784a3a0626b38f
spi: cadence: Make sure that clock polarity changes are applied

It seems that the cadence SPI controller does not immediately change the clock
polarity setting when writing the CR register. Instead the change is delayed
until the next transfer starts. This happens after the chip select line has
already been asserted. As a result the first transfer after a clock polarity
change will generate spurious clock transitions which typically results in the
SPI slave not being able to properly understand the message. Toggling the ER
register seems to cause the SPI controller to apply the clock polarity changes,
so implement this as a workaround to fix the issue.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-cadence.c