aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Vorontsov <avorontsov@ru.mvista.com>2007-07-31 03:38:42 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-31 18:39:40 -0400
commit35cc0b975057389548bfe5703d438fe0deb4807e (patch)
tree2299bebed4d2918efdd65f3becd860768e59e6b7
parent32421daaf8236b0fd6e032f6b1dd8086ccae2a46 (diff)
spi_mpc83xx: fix QE+LSB mode shifts
spi_mpc83xx should use other shifts when running in QE+LSB mode. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Acked-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/spi/spi_mpc83xx.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c
index 18c475dd5709..72812bb9b40f 100644
--- a/drivers/spi/spi_mpc83xx.c
+++ b/drivers/spi/spi_mpc83xx.c
@@ -237,6 +237,14 @@ int mpc83xx_spi_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
237 } else 237 } else
238 return -EINVAL; 238 return -EINVAL;
239 239
240 if (mpc83xx_spi->qe_mode && spi->mode & SPI_LSB_FIRST) {
241 mpc83xx_spi->tx_shift = 0;
242 if (bits_per_word <= 8)
243 mpc83xx_spi->rx_shift = 8;
244 else
245 mpc83xx_spi->rx_shift = 0;
246 }
247
240 /* nsecs = (clock period)/2 */ 248 /* nsecs = (clock period)/2 */
241 if (!hz) 249 if (!hz)
242 hz = spi->max_speed_hz; 250 hz = spi->max_speed_hz;