]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
spi: spi-mxs: Fix chip select control bits in DMA mode
authorTrent Piepho <tpiepho@gmail.com>
Tue, 1 Oct 2013 20:15:04 +0000 (13:15 -0700)
committerMark Brown <broonie@linaro.org>
Fri, 18 Oct 2013 00:00:30 +0000 (01:00 +0100)
commit0b782f70b51b9e611a69b9d4533b44d66b2e3e75
treef52e36ea91cf2432af35ca1d80bbe0f716def1ff
parentdf23286e57ceefe427d7ff925193283a8fafe9f3
spi: spi-mxs: Fix chip select control bits in DMA mode

In DMA mode the chip select control bits would be ORed into the CTRL0
register without first clearing the bits.  This means that after
addressing slave 1, the CTRL0 bit to address slave 1 would be still be
set when addressing slave 0, resulting in slave 1 continuing to be
addressed.

The message handling function would pass the CS value to the txrx
function, which would re-program the bits on each transfer in the
message.  The selected CS does not change during a message so this is
inefficient.  It also means there are two different sets of code for
selecting the CS, one for PIO that worked and one for DMA that didn't.

Change the code to set the CS bits in the message handling function
once.  Now the DMA and PIO txrx functions don't need to care about CS
at all.

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