summaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorJoonyoung Shim <jy0922.shim@samsung.com>2016-11-25 12:47:15 +0900
committerUlf Hansson <ulf.hansson@linaro.org>2016-12-05 10:31:15 +0100
commitdf9bcc2bc0a1f8d2963bd916698268fb2470713b (patch)
tree699019edd12d2ee8cc228bae14e7122f77768b56 /drivers/mmc
parent9b93d392fdbd336b0f1558592010c0169801afa5 (diff)
downloadlinux-df9bcc2bc0a1f8d2963bd916698268fb2470713b.tar.bz2
mmc: dw_mmc: add missing codes for runtime resume
The commit 64997de4fd17 ("mmc: dw_mmc: remove system PM callback") is missing to call dw_mci_ctrl_reset(). This adds to call dw_mci_ctrl_reset() and to handle error of clocks. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/dw_mmc.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index d400afc74719..0aa4bcd85bb7 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -3296,7 +3296,13 @@ int dw_mci_runtime_resume(struct device *dev)
ret = clk_prepare_enable(host->ciu_clk);
if (ret)
- return ret;
+ goto err;
+
+ if (!dw_mci_ctrl_reset(host, SDMMC_CTRL_ALL_RESET_FLAGS)) {
+ clk_disable_unprepare(host->ciu_clk);
+ ret = -ENODEV;
+ goto err;
+ }
if (host->use_dma && host->dma_ops->init)
host->dma_ops->init(host);
@@ -3331,6 +3337,14 @@ int dw_mci_runtime_resume(struct device *dev)
/* Now that slots are all setup, we can enable card detect */
dw_mci_enable_cd(host);
+ return 0;
+
+err:
+ if (host->cur_slot &&
+ (mmc_can_gpio_cd(host->cur_slot->mmc) ||
+ !mmc_card_is_removable(host->cur_slot->mmc)))
+ clk_disable_unprepare(host->biu_clk);
+
return ret;
}
EXPORT_SYMBOL(dw_mci_runtime_resume);