aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorAnton Vorontsov <avorontsov@ru.mvista.com>2009-03-16 17:14:00 -0400
committerPierre Ossman <drzeus@drzeus.cx>2009-03-24 16:30:10 -0400
commit3e3bf20756aeee57a40fd37b923263c9a51b8c68 (patch)
tree9cf64169c61208b59a1a6c16e0bfc48b45a1c7a7 /drivers/mmc
parent8114634ccb54d67a8c01e5825d95bff4e7f7b357 (diff)
sdhci: Add quirk for controllers that need small delays for PIO
Small udelay is needed to make eSDHC work in PIO mode. Without the delay reading causes endless interrupt storm, and writing corrupts data. The first guess would be that we must wait for some bit in some register, but I didn't find any reliable bits that change before and after the delay. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sdhci.c3
-rw-r--r--drivers/mmc/host/sdhci.h2
2 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 75d0ecbce10c..cd6dab34ba54 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -336,6 +336,9 @@ static void sdhci_transfer_pio(struct sdhci_host *host)
336 mask = ~0; 336 mask = ~0;
337 337
338 while (sdhci_readl(host, SDHCI_PRESENT_STATE) & mask) { 338 while (sdhci_readl(host, SDHCI_PRESENT_STATE) & mask) {
339 if (host->quirks & SDHCI_QUIRK_PIO_NEEDS_DELAY)
340 udelay(100);
341
339 if (host->data->flags & MMC_DATA_READ) 342 if (host->data->flags & MMC_DATA_READ)
340 sdhci_read_block_pio(host); 343 sdhci_read_block_pio(host);
341 else 344 else
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index b9bc622735ba..c5ce9ee1a1bc 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -220,6 +220,8 @@ struct sdhci_host {
220#define SDHCI_QUIRK_INVERTED_WRITE_PROTECT (1<<16) 220#define SDHCI_QUIRK_INVERTED_WRITE_PROTECT (1<<16)
221/* Controller has nonstandard clock management */ 221/* Controller has nonstandard clock management */
222#define SDHCI_QUIRK_NONSTANDARD_CLOCK (1<<17) 222#define SDHCI_QUIRK_NONSTANDARD_CLOCK (1<<17)
223/* Controller does not like fast PIO transfers */
224#define SDHCI_QUIRK_PIO_NEEDS_DELAY (1<<18)
223 225
224 int irq; /* Device IRQ */ 226 int irq; /* Device IRQ */
225 void __iomem * ioaddr; /* Mapped address */ 227 void __iomem * ioaddr; /* Mapped address */