aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2013-01-09 11:15:26 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2013-01-23 10:16:59 +0000
commit8259293aee1d44d7ebf0c644ef48db835653ebc3 (patch)
tree89dbc3ab595a8eb96e7e4a9bab64a77561d977ae /drivers/mmc
parentARM: 7620/1: mmc: mmci: Convert to use mmc_regulator_get_supply (diff)
downloadlinux-dev-8259293aee1d44d7ebf0c644ef48db835653ebc3.tar.xz
linux-dev-8259293aee1d44d7ebf0c644ef48db835653ebc3.zip
ARM: 7622/1: mmc: mmci: Gate the clock in runtime suspend to save power
The amba bus is already performing same actions but for the apb_pclk. So here we just make sure the clock to card is gated as well to save more power. At runtime resume we will thus restore the clock again. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Kevin Liu <kliu5@marvell.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/mmci.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 3094ea3ed722..b43e1ab5cb5c 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -1614,8 +1614,37 @@ static int mmci_resume(struct device *dev)
}
#endif
+#ifdef CONFIG_PM_RUNTIME
+static int mmci_runtime_suspend(struct device *dev)
+{
+ struct amba_device *adev = to_amba_device(dev);
+ struct mmc_host *mmc = amba_get_drvdata(adev);
+
+ if (mmc) {
+ struct mmci_host *host = mmc_priv(mmc);
+ clk_disable_unprepare(host->clk);
+ }
+
+ return 0;
+}
+
+static int mmci_runtime_resume(struct device *dev)
+{
+ struct amba_device *adev = to_amba_device(dev);
+ struct mmc_host *mmc = amba_get_drvdata(adev);
+
+ if (mmc) {
+ struct mmci_host *host = mmc_priv(mmc);
+ clk_prepare_enable(host->clk);
+ }
+
+ return 0;
+}
+#endif
+
static const struct dev_pm_ops mmci_dev_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(mmci_suspend, mmci_resume)
+ SET_RUNTIME_PM_OPS(mmci_runtime_suspend, mmci_runtime_resume, NULL)
};
static struct amba_id mmci_ids[] = {