diff options
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/omap_hsmmc.c | 24 |
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 | } |
2200 | err: | ||
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); |