Skip to content

Commit

Permalink
ARM: OMAP: Add hibernation support to omap_hsmmc.
Browse files Browse the repository at this point in the history
Setting a dev_pm_ops suspend/resume pair but not a set of hibernation
functions means that pm functions will not be called upon suspend/resume.
Fix this by using SET_SYSTEM_SLEEP_PM_OPS, which appropriately assigns the
suspend/resume and hibernation handlers.

Additionally, do not rely on the RESETDONE bit to determine if context
needs to be restored, as that bit may have been cleared by the kernel
loading our restore image.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
  • Loading branch information
Russ Dill authored and Russ Dill committed Feb 19, 2013
1 parent 08dcc50 commit 2ea98de
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions drivers/mmc/host/omap_hsmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,9 +611,6 @@ static int omap_hsmmc_context_restore(struct omap_hsmmc_host *host)
if (host->context_loss == context_loss)
return 1;

if (!OMAP_HSMMC_READ(host->base, SYSSTATUS) & RESETDONE)
return 1;

if (host->pdata->controller_flags & OMAP_HSMMC_SUPPORTS_DUAL_VOLT) {
if (host->power_mode != MMC_POWER_OFF &&
(1 << ios->vdd) <= MMC_VDD_23_24)
Expand Down Expand Up @@ -2209,12 +2206,11 @@ static int omap_hsmmc_runtime_resume(struct device *dev)
}

static struct dev_pm_ops omap_hsmmc_dev_pm_ops = {
.suspend = omap_hsmmc_suspend,
.resume = omap_hsmmc_resume,
SET_SYSTEM_SLEEP_PM_OPS(omap_hsmmc_suspend, omap_hsmmc_resume)
SET_RUNTIME_PM_OPS(omap_hsmmc_runtime_suspend,
omap_hsmmc_runtime_resume, NULL)
.prepare = omap_hsmmc_prepare,
.complete = omap_hsmmc_complete,
.runtime_suspend = omap_hsmmc_runtime_suspend,
.runtime_resume = omap_hsmmc_runtime_resume,
};

static struct platform_driver omap_hsmmc_driver = {
Expand Down

0 comments on commit 2ea98de

Please sign in to comment.