spi_mpc83xx: add small delay after asserting chip-select line
authorAnton Vorontsov <[email protected]>
Thu, 18 Jun 2009 23:49:01 +0000 (16:49 -0700)
committerLinus Torvalds <[email protected]>
Fri, 19 Jun 2009 23:46:04 +0000 (16:46 -0700)
This is needed for some underlaying GPIO controllers that may be a bit
slow, or if chip-select signal need some time to stabilize.

For what it's worth, we already have the similar delay for chip-select
de-assertion case.

Signed-off-by: Anton Vorontsov <[email protected]>
Cc: Kumar Gala <[email protected]>
Cc: David Brownell <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
drivers/spi/spi_mpc83xx.c

index 4988230a7e0cb3970394de702b86758ffa1d6ccd..6e0232e65a382dd224bc08c4f8a0fb9858be6210 100644 (file)
@@ -383,8 +383,10 @@ static void mpc83xx_spi_work(struct work_struct *work)
                                        break;
                        }
 
-                       if (cs_change)
+                       if (cs_change) {
                                mpc83xx_spi_chipselect(spi, BITBANG_CS_ACTIVE);
+                               ndelay(nsecs);
+                       }
                        cs_change = t->cs_change;
                        if (t->len)
                                status = mpc83xx_spi_bufs(spi, t);