From: Anton Vorontsov Date: Tue, 31 Jul 2007 07:38:42 +0000 (-0700) Subject: spi_mpc83xx: fix QE+LSB mode shifts X-Git-Tag: v2.6.23-rc2~93 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35cc0b975057389548bfe5703d438fe0deb4807e;p=linux-2.6 spi_mpc83xx: fix QE+LSB mode shifts spi_mpc83xx should use other shifts when running in QE+LSB mode. Signed-off-by: Anton Vorontsov Acked-by: Kumar Gala Signed-off-by: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c index 18c475dd57..72812bb9b4 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) } else return -EINVAL; + if (mpc83xx_spi->qe_mode && spi->mode & SPI_LSB_FIRST) { + mpc83xx_spi->tx_shift = 0; + if (bits_per_word <= 8) + mpc83xx_spi->rx_shift = 8; + else + mpc83xx_spi->rx_shift = 0; + } + /* nsecs = (clock period)/2 */ if (!hz) hz = spi->max_speed_hz;