]> git.baikalelectronics.ru Git - kernel.git/commit
spi: spi-mxs: Fix extra CS pulses and read mode in multi-transfer messages
authorTrent Piepho <tpiepho@gmail.com>
Tue, 1 Oct 2013 20:14:57 +0000 (13:14 -0700)
committerMark Brown <broonie@linaro.org>
Fri, 18 Oct 2013 00:00:30 +0000 (01:00 +0100)
commit28bd4cf06a70ca48ddc413a7753ab8dbd4017bd6
tree86e495ed4b4e0494c952223cc8214bc97240045d
parent061609a53fe877ac3b7f1f5e85f6368e53ab8cfb
spi: spi-mxs: Fix extra CS pulses and read mode in multi-transfer messages

There are two bits which control the CS line in the CTRL0 register:
LOCK_CS and IGNORE_CRC.  The latter would be better named DEASSERT_CS
in SPI mode.

Setting DEASSERT_CS causes CS to be de-asserted at the end of the transfer.
It should normally be set only for the final segment of the final transfer.
The DMA code explicitly sets it in this case, but because it never clears
the bit from the ctrl0 register, it will remain set for all transfers in
subsequent messages.  This results in a CS pulse between transfers.

There is a similar problem with the read mode bit never being cleared
in DMA mode.

This patch fixes DEASSERT_CS and READ being left on in DMA mode.

Signed-off-by: Trent Piepho <tpiepho@gmail.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-mxs.c