Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 336300
b: refs/heads/master
c: a48ce88
h: refs/heads/master
v: v3
  • Loading branch information
Felipe Balbi authored and Chris Ball committed Dec 6, 2012
1 parent 242ac66 commit b84441e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cd587096c0e2b85a67e77721a753679bac89b394
refs/heads/master: a48ce884d5819d5df2cf1139ab3c43f8e9e419b3
44 changes: 24 additions & 20 deletions trunk/drivers/mmc/host/omap_hsmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2070,6 +2070,25 @@ static int __devexit omap_hsmmc_remove(struct platform_device *pdev)
}

#ifdef CONFIG_PM
static int omap_hsmmc_prepare(struct device *dev)
{
struct omap_hsmmc_host *host = dev_get_drvdata(dev);

if (host->pdata->suspend)
return host->pdata->suspend(dev, host->slot_id);

return 0;
}

static void omap_hsmmc_complete(struct device *dev)
{
struct omap_hsmmc_host *host = dev_get_drvdata(dev);

if (host->pdata->resume)
host->pdata->resume(dev, host->slot_id);

}

static int omap_hsmmc_suspend(struct device *dev)
{
int ret = 0;
Expand All @@ -2083,23 +2102,10 @@ static int omap_hsmmc_suspend(struct device *dev)

pm_runtime_get_sync(host->dev);
host->suspended = 1;
if (host->pdata->suspend) {
ret = host->pdata->suspend(dev, host->slot_id);
if (ret) {
dev_dbg(dev, "Unable to handle MMC board"
" level suspend\n");
host->suspended = 0;
return ret;
}
}
ret = mmc_suspend_host(host->mmc);

if (ret) {
host->suspended = 0;
if (host->pdata->resume) {
if (host->pdata->resume(dev, host->slot_id))
dev_dbg(dev, "Unmask interrupt failed\n");
}
goto err;
}

Expand Down Expand Up @@ -2136,12 +2142,6 @@ static int omap_hsmmc_resume(struct device *dev)
if (!(host->mmc->pm_flags & MMC_PM_KEEP_POWER))
omap_hsmmc_conf_bus_power(host);

if (host->pdata->resume) {
ret = host->pdata->resume(dev, host->slot_id);
if (ret)
dev_dbg(dev, "Unmask interrupt failed\n");
}

omap_hsmmc_protect_card(host);

/* Notify the core to resume the host */
Expand All @@ -2157,8 +2157,10 @@ static int omap_hsmmc_resume(struct device *dev)
}

#else
#define omap_hsmmc_prepare NULL
#define omap_hsmmc_complete NULL
#define omap_hsmmc_suspend NULL
#define omap_hsmmc_resume NULL
#define omap_hsmmc_resume NULL
#endif

static int omap_hsmmc_runtime_suspend(struct device *dev)
Expand Down Expand Up @@ -2186,6 +2188,8 @@ 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,
.prepare = omap_hsmmc_prepare,
.complete = omap_hsmmc_complete,
.runtime_suspend = omap_hsmmc_runtime_suspend,
.runtime_resume = omap_hsmmc_runtime_resume,
};
Expand Down

0 comments on commit b84441e

Please sign in to comment.