aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/host/omap_hsmmc.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 61883093e25b..488f222054f8 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -498,6 +498,19 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
498 return IRQ_HANDLED; 498 return IRQ_HANDLED;
499} 499}
500 500
501static void set_sd_bus_power(struct mmc_omap_host *host)
502{
503 unsigned long i;
504
505 OMAP_HSMMC_WRITE(host->base, HCTL,
506 OMAP_HSMMC_READ(host->base, HCTL) | SDBP);
507 for (i = 0; i < loops_per_jiffy; i++) {
508 if (OMAP_HSMMC_READ(host->base, HCTL) & SDBP)
509 break;
510 cpu_relax();
511 }
512}
513
501/* 514/*
502 * Switch MMC interface voltage ... only relevant for MMC1. 515 * Switch MMC interface voltage ... only relevant for MMC1.
503 * 516 *
@@ -554,9 +567,7 @@ static int omap_mmc_switch_opcond(struct mmc_omap_host *host, int vdd)
554 reg_val |= SDVS30; 567 reg_val |= SDVS30;
555 568
556 OMAP_HSMMC_WRITE(host->base, HCTL, reg_val); 569 OMAP_HSMMC_WRITE(host->base, HCTL, reg_val);
557 570 set_sd_bus_power(host);
558 OMAP_HSMMC_WRITE(host->base, HCTL,
559 OMAP_HSMMC_READ(host->base, HCTL) | SDBP);
560 571
561 return 0; 572 return 0;
562err: 573err:
@@ -942,8 +953,7 @@ static void omap_hsmmc_init(struct mmc_omap_host *host)
942 OMAP_HSMMC_WRITE(host->base, SYSCONFIG, value | AUTOIDLE); 953 OMAP_HSMMC_WRITE(host->base, SYSCONFIG, value | AUTOIDLE);
943 954
944 /* Set SD bus power bit */ 955 /* Set SD bus power bit */
945 value = OMAP_HSMMC_READ(host->base, HCTL); 956 set_sd_bus_power(host);
946 OMAP_HSMMC_WRITE(host->base, HCTL, value | SDBP);
947} 957}
948 958
949static struct mmc_host_ops mmc_omap_ops = { 959static struct mmc_host_ops mmc_omap_ops = {