aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2011-11-22 09:02:17 -0500
committerTony Lindgren <tony@atomide.com>2011-12-08 19:24:09 -0500
commit31f9d4635bde3f03bc6dbac01d4c0fb0da9d06d7 (patch)
treebebd0a1b33b667cd242c1b33b6eff13e1a87f83c /drivers/mmc
parent5611cc4572e889b62a7b4c72a413536bf6a9c416 (diff)
omap_hsmmc: consider MMC_PM_KEEP_POWER on suspend/resume
When an mmc card has the MMC_PM_KEEP_POWER flag, it shouldn't be powered off on suspend (and thus doesn't have to be powered-on on resume) While on it, change the suspend flow a bit, to make it a bit easier to follow. Signed-off-by: Eliad Peller <eliad@wizery.com> Acked-by: Chris Ball <cjb@laptop.org> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/omap_hsmmc.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 101cd31c8220..6784fbbc337d 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -2176,13 +2176,7 @@ static int omap_hsmmc_suspend(struct device *dev)
2176 cancel_work_sync(&host->mmc_carddetect_work); 2176 cancel_work_sync(&host->mmc_carddetect_work);
2177 ret = mmc_suspend_host(host->mmc); 2177 ret = mmc_suspend_host(host->mmc);
2178 2178
2179 if (ret == 0) { 2179 if (ret) {
2180 omap_hsmmc_disable_irq(host);
2181 OMAP_HSMMC_WRITE(host->base, HCTL,
2182 OMAP_HSMMC_READ(host->base, HCTL) & ~SDBP);
2183 if (host->got_dbclk)
2184 clk_disable(host->dbclk);
2185 } else {
2186 host->suspended = 0; 2180 host->suspended = 0;
2187 if (host->pdata->resume) { 2181 if (host->pdata->resume) {
2188 ret = host->pdata->resume(&pdev->dev, 2182 ret = host->pdata->resume(&pdev->dev,
@@ -2191,9 +2185,20 @@ static int omap_hsmmc_suspend(struct device *dev)
2191 dev_dbg(mmc_dev(host->mmc), 2185 dev_dbg(mmc_dev(host->mmc),
2192 "Unmask interrupt failed\n"); 2186 "Unmask interrupt failed\n");
2193 } 2187 }
2188 goto err;
2194 } 2189 }
2195 pm_runtime_put_sync(host->dev); 2190
2191 if (!(host->mmc->pm_flags & MMC_PM_KEEP_POWER)) {
2192 omap_hsmmc_disable_irq(host);
2193 OMAP_HSMMC_WRITE(host->base, HCTL,
2194 OMAP_HSMMC_READ(host->base, HCTL) & ~SDBP);
2195 }
2196 if (host->got_dbclk)
2197 clk_disable(host->dbclk);
2198
2196 } 2199 }
2200err:
2201 pm_runtime_put_sync(host->dev);
2197 return ret; 2202 return ret;
2198} 2203}
2199 2204
@@ -2213,7 +2218,8 @@ static int omap_hsmmc_resume(struct device *dev)
2213 if (host->got_dbclk) 2218 if (host->got_dbclk)
2214 clk_enable(host->dbclk); 2219 clk_enable(host->dbclk);
2215 2220
2216 omap_hsmmc_conf_bus_power(host); 2221 if (!(host->mmc->pm_flags & MMC_PM_KEEP_POWER))
2222 omap_hsmmc_conf_bus_power(host);
2217 2223
2218 if (host->pdata->resume) { 2224 if (host->pdata->resume) {
2219 ret = host->pdata->resume(&pdev->dev, host->slot_id); 2225 ret = host->pdata->resume(&pdev->dev, host->slot_id);