提交 e13bb300 编写于 作者: A Adrian Hunter 提交者: Pierre Ossman

omap_hsmmc: Wait for SDBP

It is necessary to wait for bus power before sending
any commands.
Signed-off-by: NAdrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: NPierre Ossman <drzeus@drzeus.cx>
上级 f3e2f1dd
...@@ -498,6 +498,19 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id) ...@@ -498,6 +498,19 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
return IRQ_HANDLED; 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. * Switch MMC interface voltage ... only relevant for MMC1.
* *
...@@ -554,9 +567,7 @@ static int omap_mmc_switch_opcond(struct mmc_omap_host *host, int vdd) ...@@ -554,9 +567,7 @@ static int omap_mmc_switch_opcond(struct mmc_omap_host *host, int vdd)
reg_val |= SDVS30; reg_val |= SDVS30;
OMAP_HSMMC_WRITE(host->base, HCTL, reg_val); OMAP_HSMMC_WRITE(host->base, HCTL, reg_val);
set_sd_bus_power(host);
OMAP_HSMMC_WRITE(host->base, HCTL,
OMAP_HSMMC_READ(host->base, HCTL) | SDBP);
return 0; return 0;
err: err:
...@@ -942,8 +953,7 @@ static void omap_hsmmc_init(struct mmc_omap_host *host) ...@@ -942,8 +953,7 @@ static void omap_hsmmc_init(struct mmc_omap_host *host)
OMAP_HSMMC_WRITE(host->base, SYSCONFIG, value | AUTOIDLE); OMAP_HSMMC_WRITE(host->base, SYSCONFIG, value | AUTOIDLE);
/* Set SD bus power bit */ /* Set SD bus power bit */
value = OMAP_HSMMC_READ(host->base, HCTL); set_sd_bus_power(host);
OMAP_HSMMC_WRITE(host->base, HCTL, value | SDBP);
} }
static struct mmc_host_ops mmc_omap_ops = { static struct mmc_host_ops mmc_omap_ops = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册