aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/host/omap.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index ab0974d261e5..14759e9f42ad 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -1276,11 +1276,17 @@ static void mmc_omap_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
1276 OMAP_MMC_WRITE(host, CON, dsor); 1276 OMAP_MMC_WRITE(host, CON, dsor);
1277 slot->saved_con = dsor; 1277 slot->saved_con = dsor;
1278 if (ios->power_mode == MMC_POWER_ON) { 1278 if (ios->power_mode == MMC_POWER_ON) {
1279 /* worst case at 400kHz, 80 cycles makes 200 microsecs */
1280 int usecs = 250;
1281
1279 /* Send clock cycles, poll completion */ 1282 /* Send clock cycles, poll completion */
1280 OMAP_MMC_WRITE(host, IE, 0); 1283 OMAP_MMC_WRITE(host, IE, 0);
1281 OMAP_MMC_WRITE(host, STAT, 0xffff); 1284 OMAP_MMC_WRITE(host, STAT, 0xffff);
1282 OMAP_MMC_WRITE(host, CMD, 1 << 7); 1285 OMAP_MMC_WRITE(host, CMD, 1 << 7);
1283 while ((OMAP_MMC_READ(host, STAT) & 1) == 0); 1286 while (usecs > 0 && (OMAP_MMC_READ(host, STAT) & 1) == 0) {
1287 udelay(1);
1288 usecs--;
1289 }
1284 OMAP_MMC_WRITE(host, STAT, 1); 1290 OMAP_MMC_WRITE(host, STAT, 1);
1285 } 1291 }
1286 1292