]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
mmc: mmci: Put the device into low power state at system suspend
authorUlf Hansson <ulf.hansson@linaro.org>
Thu, 23 Jan 2014 00:11:33 +0000 (01:11 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 12 May 2014 10:52:35 +0000 (12:52 +0200)
For CONFIG_PM_SLEEP, the device were always left in full power state
after system suspend.

We solely relied on a power domain to put it into low power state,
which is an unreasonable requirement to put on SOCs to implement.
Especially for those SOCs not supporting power domains at all.

Use pm_runtime_force_suspend|resume() as the system suspend callbacks,
to resolve the issue.

Cc: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/mmci.c

index eb23c89b2717c7311d67b50d03cb3cfab6c7de6d..a40bf70170fdd8a88ace5b99b8f81e70357c0ba6 100644 (file)
@@ -1759,36 +1759,6 @@ static int mmci_remove(struct amba_device *dev)
        return 0;
 }
 
-#ifdef CONFIG_SUSPEND
-static int mmci_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);
-               pm_runtime_get_sync(dev);
-               writel(0, host->base + MMCIMASK0);
-       }
-
-       return 0;
-}
-
-static int mmci_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);
-               writel(MCI_IRQENABLE, host->base + MMCIMASK0);
-               pm_runtime_put(dev);
-       }
-
-       return 0;
-}
-#endif
-
 #ifdef CONFIG_PM
 static void mmci_save(struct mmci_host *host)
 {
@@ -1856,7 +1826,8 @@ static int mmci_runtime_resume(struct device *dev)
 #endif
 
 static const struct dev_pm_ops mmci_dev_pm_ops = {
-       SET_SYSTEM_SLEEP_PM_OPS(mmci_suspend, mmci_resume)
+       SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+                               pm_runtime_force_resume)
        SET_PM_RUNTIME_PM_OPS(mmci_runtime_suspend, mmci_runtime_resume, NULL)
 };