Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=49bb23006b220c11bcf4e1d3eb99c289e6ab855e
Commit:     49bb23006b220c11bcf4e1d3eb99c289e6ab855e
Parent:     99eb8a550dbccc0e1f6c7e866fe421810e0585f6
Author:     Anton Vorontsov <[EMAIL PROTECTED]>
AuthorDate: Tue Jul 31 00:38:40 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue Jul 31 15:39:39 2007 -0700

    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 <[EMAIL PROTECTED]>
    Acked-by: Kumar Gala <[EMAIL PROTECTED]>
    Signed-off-by: David Brownell <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 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 3295cfc..0b99fd9 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)
                        regval |= SPMODE_PM(pm);
                }
 
+               /* Turn off SPI unit prior changing mode */
+               mpc83xx_spi_write_reg(&mpc83xx_spi->base->mode, 0);
                mpc83xx_spi_write_reg(&mpc83xx_spi->base->mode, regval);
                if (mpc83xx_spi->activate_cs)
                        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)
        regval &= 0xff0fffff;
        regval |= SPMODE_LEN(bits_per_word);
 
+       /* Turn off SPI unit prior changing mode */
+       mpc83xx_spi_write_reg(&mpc83xx_spi->base->mode, 0);
        mpc83xx_spi_write_reg(&mpc83xx_spi->base->mode, regval);
 
        return 0;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to