aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhangfei Gao <zhangfei.gao@linaro.org>2013-04-01 22:56:16 +0800
committerZhangfei Gao <zhangfei.gao@linaro.org>2013-04-25 11:10:59 +0800
commit6a55e756a0ca30231b7a692cf6f3fdbc22436cd7 (patch)
treec02a470838c62d4efce4550da967adee9738518f
parentbb48ef89ea45a186b1396fe9f6e01df54d2e9d2d (diff)
mmc: dw_mmc-hisilicon: define dw_mci_hs_pmopstouch_4.24
dw_mci_hs_tun has to be re-tuned after resume, so define dw_mci_hs_pmops instead Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
-rw-r--r--drivers/mmc/host/dw_mmc-hisilicon.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/drivers/mmc/host/dw_mmc-hisilicon.c b/drivers/mmc/host/dw_mmc-hisilicon.c
index 85c4271e2bd3..c09746689848 100644
--- a/drivers/mmc/host/dw_mmc-hisilicon.c
+++ b/drivers/mmc/host/dw_mmc-hisilicon.c
@@ -361,13 +361,51 @@ int dw_mci_hs_probe(struct platform_device *pdev)
return dw_mci_pltfm_register(pdev, drv_data);
}
+#ifdef CONFIG_PM_SLEEP
+static int dw_mci_hs_suspend(struct device *dev)
+{
+ int ret;
+ struct dw_mci *host = dev_get_drvdata(dev);
+
+ ret = dw_mci_suspend(host);
+ if (ret)
+ return ret;
+
+ return 0;
+}
+
+static int dw_mci_hs_resume(struct device *dev)
+{
+ int ret;
+ struct dw_mci *host = dev_get_drvdata(dev);
+ struct dw_mci_hs_priv_data *priv = host->priv;
+
+ if (priv->type == DW_MCI_TYPE_HI4511) {
+ int id = priv->id;
+
+ dw_mci_hs_tun(host, id, MMC_TIMING_LEGACY);
+ }
+
+ ret = dw_mci_resume(host);
+ if (ret)
+ return ret;
+
+ return 0;
+}
+#else
+#define dw_mci_hs_suspend NULL
+#define dw_mci_hs_resume NULL
+#endif /* CONFIG_PM_SLEEP */
+
+SIMPLE_DEV_PM_OPS(dw_mci_hs_pmops, dw_mci_hs_suspend, dw_mci_hs_resume);
+
static struct platform_driver dw_mci_hs_pltfm_driver = {
.probe = dw_mci_hs_probe,
.remove = dw_mci_pltfm_remove,
.driver = {
.name = DRIVER_NAME,
.of_match_table = of_match_ptr(dw_mci_hs_match),
- .pm = &dw_mci_pltfm_pmops,
+ .pm = &dw_mci_hs_pmops,
},
};