diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2013-01-09 05:15:26 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-01-23 05:16:59 -0500 |
commit | 8259293aee1d44d7ebf0c644ef48db835653ebc3 (patch) | |
tree | 89dbc3ab595a8eb96e7e4a9bab64a77561d977ae | |
parent | 599c1d5c750ddf528c7c6d3cdc466708f0502e66 (diff) |
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>
-rw-r--r-- | drivers/mmc/host/mmci.c | 29 |
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) | |||
1614 | } | 1614 | } |
1615 | #endif | 1615 | #endif |
1616 | 1616 | ||
1617 | #ifdef CONFIG_PM_RUNTIME | ||
1618 | static int mmci_runtime_suspend(struct device *dev) | ||
1619 | { | ||
1620 | struct amba_device *adev = to_amba_device(dev); | ||
1621 | struct mmc_host *mmc = amba_get_drvdata(adev); | ||
1622 | |||
1623 | if (mmc) { | ||
1624 | struct mmci_host *host = mmc_priv(mmc); | ||
1625 | clk_disable_unprepare(host->clk); | ||
1626 | } | ||
1627 | |||
1628 | return 0; | ||
1629 | } | ||
1630 | |||
1631 | static int mmci_runtime_resume(struct device *dev) | ||
1632 | { | ||
1633 | struct amba_device *adev = to_amba_device(dev); | ||
1634 | struct mmc_host *mmc = amba_get_drvdata(adev); | ||
1635 | |||
1636 | if (mmc) { | ||
1637 | struct mmci_host *host = mmc_priv(mmc); | ||
1638 | clk_prepare_enable(host->clk); | ||
1639 | } | ||
1640 | |||
1641 | return 0; | ||
1642 | } | ||
1643 | #endif | ||
1644 | |||
1617 | static const struct dev_pm_ops mmci_dev_pm_ops = { | 1645 | static const struct dev_pm_ops mmci_dev_pm_ops = { |
1618 | SET_SYSTEM_SLEEP_PM_OPS(mmci_suspend, mmci_resume) | 1646 | SET_SYSTEM_SLEEP_PM_OPS(mmci_suspend, mmci_resume) |
1647 | SET_RUNTIME_PM_OPS(mmci_runtime_suspend, mmci_runtime_resume, NULL) | ||
1619 | }; | 1648 | }; |
1620 | 1649 | ||
1621 | static struct amba_id mmci_ids[] = { | 1650 | static struct amba_id mmci_ids[] = { |