linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] omap_hsmmc: consider MMC_PM_KEEP_POWER on suspend/resume
@ 2011-11-22 14:02 Eliad Peller
  2011-11-22 14:02 ` [PATCH 2/3] omap_hsmmc: add pm_caps field Eliad Peller
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Eliad Peller @ 2011-11-22 14:02 UTC (permalink / raw)
  To: linux-arm-kernel

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>
---
 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 21e4a79..ec7c83c 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -2174,13 +2174,7 @@ static int omap_hsmmc_suspend(struct device *dev)
 		cancel_work_sync(&host->mmc_carddetect_work);
 		ret = mmc_suspend_host(host->mmc);
 
-		if (ret == 0) {
-			omap_hsmmc_disable_irq(host);
-			OMAP_HSMMC_WRITE(host->base, HCTL,
-				OMAP_HSMMC_READ(host->base, HCTL) & ~SDBP);
-			if (host->got_dbclk)
-				clk_disable(host->dbclk);
-		} else {
+		if (ret) {
 			host->suspended = 0;
 			if (host->pdata->resume) {
 				ret = host->pdata->resume(&pdev->dev,
@@ -2189,9 +2183,20 @@ static int omap_hsmmc_suspend(struct device *dev)
 					dev_dbg(mmc_dev(host->mmc),
 						"Unmask interrupt failed\n");
 			}
+			goto err;
 		}
-		pm_runtime_put_sync(host->dev);
+
+		if (!(host->mmc->pm_flags & MMC_PM_KEEP_POWER)) {
+			omap_hsmmc_disable_irq(host);
+			OMAP_HSMMC_WRITE(host->base, HCTL,
+				OMAP_HSMMC_READ(host->base, HCTL) & ~SDBP);
+		}
+		if (host->got_dbclk)
+			clk_disable(host->dbclk);
+
 	}
+err:
+	pm_runtime_put_sync(host->dev);
 	return ret;
 }
 
@@ -2211,7 +2216,8 @@ static int omap_hsmmc_resume(struct device *dev)
 		if (host->got_dbclk)
 			clk_enable(host->dbclk);
 
-		omap_hsmmc_conf_bus_power(host);
+		if (!(host->mmc->pm_flags & MMC_PM_KEEP_POWER))
+			omap_hsmmc_conf_bus_power(host);
 
 		if (host->pdata->resume) {
 			ret = host->pdata->resume(&pdev->dev, host->slot_id);
-- 
1.7.6.401.g6a319

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2011-12-09  0:28 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-22 14:02 [PATCH 1/3] omap_hsmmc: consider MMC_PM_KEEP_POWER on suspend/resume Eliad Peller
2011-11-22 14:02 ` [PATCH 2/3] omap_hsmmc: add pm_caps field Eliad Peller
2011-11-28  9:15   ` Igor Grinberg
2011-11-28  9:23     ` Eliad Peller
2011-11-28 10:01       ` Igor Grinberg
2011-11-28 10:07         ` Eliad Peller
2011-11-28 10:39           ` Igor Grinberg
2011-11-22 14:02 ` [PATCH 3/3] omap: board-sdp4430: declare support for MMC_PM_KEEP_POWER Eliad Peller
2011-11-28  7:50   ` Coelho, Luciano
2011-11-28  8:26     ` Eliad Peller
2011-11-28  9:08       ` Luciano Coelho
2011-11-28  9:26         ` Igor Grinberg
2011-11-28  9:58           ` Luciano Coelho
2011-11-28 10:12             ` Eliad Peller
2011-11-28 10:18               ` Luciano Coelho
2011-12-01 18:16 ` [PATCH 1/3] omap_hsmmc: consider MMC_PM_KEEP_POWER on suspend/resume Chris Ball
2011-12-09  0:28   ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).