]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/spi/omap3_spi.c
drivers/spi/omap3: Bug fix of premature write transfer completion
[karo-tx-uboot.git] / drivers / spi / omap3_spi.c
index a3ad056473c8844ac9100c4153167e668cbeeab3..651e46e4bd20b345b83dcd9a87d89a5196c583bf 100644 (file)
@@ -260,8 +260,9 @@ int omap3_spi_write(struct spi_slave *slave, unsigned int len, const void *txp,
        }
 
        /* wait to finish of transfer */
-       while (!(readl(&ds->regs->channel[ds->slave.cs].chstat) &
-                        OMAP3_MCSPI_CHSTAT_EOT));
+       while ((readl(&ds->regs->channel[ds->slave.cs].chstat) &
+                        (OMAP3_MCSPI_CHSTAT_EOT | OMAP3_MCSPI_CHSTAT_TXS)) !=
+                        (OMAP3_MCSPI_CHSTAT_EOT | OMAP3_MCSPI_CHSTAT_TXS));
 
        /* Disable the channel otherwise the next immediate RX will get affected */
        omap3_spi_set_enable(ds,OMAP3_MCSPI_CHCTRL_DIS);