Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 140484
b: refs/heads/master
c: e13bb30
h: refs/heads/master
v: v3
  • Loading branch information
Adrian Hunter authored and Pierre Ossman committed Mar 24, 2009
1 parent 9874511 commit 5c48c01
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f3e2f1dd3bbe9352654eec8223495d35e1f52af2
refs/heads/master: e13bb3003a33df8f82cd027f8abfa5cd73f2eec0
20 changes: 15 additions & 5 deletions trunk/drivers/mmc/host/omap_hsmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,19 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
return IRQ_HANDLED;
}

static void set_sd_bus_power(struct mmc_omap_host *host)
{
unsigned long i;

OMAP_HSMMC_WRITE(host->base, HCTL,
OMAP_HSMMC_READ(host->base, HCTL) | SDBP);
for (i = 0; i < loops_per_jiffy; i++) {
if (OMAP_HSMMC_READ(host->base, HCTL) & SDBP)
break;
cpu_relax();
}
}

/*
* Switch MMC interface voltage ... only relevant for MMC1.
*
Expand Down Expand Up @@ -554,9 +567,7 @@ static int omap_mmc_switch_opcond(struct mmc_omap_host *host, int vdd)
reg_val |= SDVS30;

OMAP_HSMMC_WRITE(host->base, HCTL, reg_val);

OMAP_HSMMC_WRITE(host->base, HCTL,
OMAP_HSMMC_READ(host->base, HCTL) | SDBP);
set_sd_bus_power(host);

return 0;
err:
Expand Down Expand Up @@ -942,8 +953,7 @@ static void omap_hsmmc_init(struct mmc_omap_host *host)
OMAP_HSMMC_WRITE(host->base, SYSCONFIG, value | AUTOIDLE);

/* Set SD bus power bit */
value = OMAP_HSMMC_READ(host->base, HCTL);
OMAP_HSMMC_WRITE(host->base, HCTL, value | SDBP);
set_sd_bus_power(host);
}

static struct mmc_host_ops mmc_omap_ops = {
Expand Down

0 comments on commit 5c48c01

Please sign in to comment.