diff options
author | Anton Vorontsov <avorontsov@ru.mvista.com> | 2007-07-31 03:38:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-31 18:39:39 -0400 |
commit | 49bb23006b220c11bcf4e1d3eb99c289e6ab855e (patch) | |
tree | b3852d2edebf7704c9662341e1cb886384a2a11c /drivers/spi | |
parent | 99eb8a550dbccc0e1f6c7e866fe421810e0585f6 (diff) |
spi_mpc83xx: turn off SPI unit while switching mode
Documentation clearly states, that mode should not be changed till
SPMODE_ENABLE bit set. I've seen hangs w/o this patch.
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>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi_mpc83xx.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c index 3295cfcc9f20..0b99fd9f5171 100644 --- a/drivers/spi/spi_mpc83xx.c +++ b/drivers/spi/spi_mpc83xx.c | |||
@@ -176,6 +176,8 @@ static void mpc83xx_spi_chipselect(struct spi_device *spi, int value) | |||
176 | regval |= SPMODE_PM(pm); | 176 | regval |= SPMODE_PM(pm); |
177 | } | 177 | } |
178 | 178 | ||
179 | /* Turn off SPI unit prior changing mode */ | ||
180 | mpc83xx_spi_write_reg(&mpc83xx_spi->base->mode, 0); | ||
179 | mpc83xx_spi_write_reg(&mpc83xx_spi->base->mode, regval); | 181 | mpc83xx_spi_write_reg(&mpc83xx_spi->base->mode, regval); |
180 | if (mpc83xx_spi->activate_cs) | 182 | if (mpc83xx_spi->activate_cs) |
181 | mpc83xx_spi->activate_cs(spi->chip_select, pol); | 183 | mpc83xx_spi->activate_cs(spi->chip_select, pol); |
@@ -249,6 +251,8 @@ int mpc83xx_spi_setup_transfer(struct spi_device *spi, struct spi_transfer *t) | |||
249 | regval &= 0xff0fffff; | 251 | regval &= 0xff0fffff; |
250 | regval |= SPMODE_LEN(bits_per_word); | 252 | regval |= SPMODE_LEN(bits_per_word); |
251 | 253 | ||
254 | /* Turn off SPI unit prior changing mode */ | ||
255 | mpc83xx_spi_write_reg(&mpc83xx_spi->base->mode, 0); | ||
252 | mpc83xx_spi_write_reg(&mpc83xx_spi->base->mode, regval); | 256 | mpc83xx_spi_write_reg(&mpc83xx_spi->base->mode, regval); |
253 | 257 | ||
254 | return 0; | 258 | return 0; |