Restoring speed & wordsize on mpc83xx disables the controller temporarily
which makes the SPI outputs floating. This can cause a glich on
the SPI CLK which makes the slave in the other end unhappy.

Make sure that CS is disabled before restoring speed & wordsize
so any gliches are ignored by the SPI slave.

Signed-off-by: Joakim Tjernlund <[EMAIL PROTECTED]>
---

diff --git a/drivers/spi/spi_bitbang.c b/drivers/spi/spi_bitbang.c
index 0c85c98..53649cd 100644
--- a/drivers/spi/spi_bitbang.c
+++ b/drivers/spi/spi_bitbang.c
@@ -371,10 +371,6 @@ static void bitbang_work(struct work_struct *work)
                m->status = status;
                m->complete(m->context);
 
-               /* restore speed and wordsize */
-               if (setup_transfer)
-                       setup_transfer(spi, NULL);
-
                /* normally deactivate chipselect ... unless no error and
                 * cs_change has hinted that the next message will probably
                 * be for this chip too.
@@ -385,6 +381,10 @@ static void bitbang_work(struct work_struct *work)
                        ndelay(nsecs);
                }
 
+               /* restore speed and wordsize */
+               if (setup_transfer)
+                       setup_transfer(spi, NULL);
+
                spin_lock_irqsave(&bitbang->lock, flags);
        }
        bitbang->busy = 0;


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
spi-devel-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

Reply via email to