Skip to content

Commit

Permalink
tmio_mmc: map SD control registers after enabling the MFD cell
Browse files Browse the repository at this point in the history
ASIC3 can disable the memory, so we need to wait for mfd_cell->enable
to enable the memory before we can map the SD control registers.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Acked-by: Ian Molton <ian@mnementh.co.uk>
Signed-off-by: Pierre Ossman <pierre@ossman.eu>
  • Loading branch information
Philipp Zabel authored and Pierre Ossman committed Jun 13, 2009
1 parent d6c9b5e commit 544f277
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions drivers/mmc/host/tmio_mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,18 +493,18 @@ static int tmio_mmc_resume(struct platform_device *dev)
struct tmio_mmc_host *host = mmc_priv(mmc);
int ret = 0;

/* Enable the MMC/SD Control registers */
sd_config_write16(host, CNF_CMD, SDCREN);
sd_config_write32(host, CNF_CTL_BASE,
(dev->resource[0].start >> host->bus_shift) & 0xfffe);

/* Tell the MFD core we are ready to be enabled */
if (cell->enable) {
ret = cell->enable(dev);
if (ret)
goto out;
}

/* Enable the MMC/SD Control registers */
sd_config_write16(host, CNF_CMD, SDCREN);
sd_config_write32(host, CNF_CTL_BASE,
(dev->resource[0].start >> host->bus_shift) & 0xfffe);

mmc_resume_host(mmc);

out:
Expand Down Expand Up @@ -563,18 +563,18 @@ static int __devinit tmio_mmc_probe(struct platform_device *dev)
mmc->f_min = mmc->f_max / 512;
mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;

/* Enable the MMC/SD Control registers */
sd_config_write16(host, CNF_CMD, SDCREN);
sd_config_write32(host, CNF_CTL_BASE,
(dev->resource[0].start >> host->bus_shift) & 0xfffe);

/* Tell the MFD core we are ready to be enabled */
if (cell->enable) {
ret = cell->enable(dev);
if (ret)
goto unmap_cnf;
}

/* Enable the MMC/SD Control registers */
sd_config_write16(host, CNF_CMD, SDCREN);
sd_config_write32(host, CNF_CTL_BASE,
(dev->resource[0].start >> host->bus_shift) & 0xfffe);

/* Disable SD power during suspend */
sd_config_write8(host, CNF_PWR_CTL_3, 0x01);

Expand Down

0 comments on commit 544f277

Please sign in to comment.