aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/sdio.c
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2013-05-02 08:02:37 -0400
committerChris Ball <cjb@laptop.org>2013-05-26 14:23:15 -0400
commit12d01d0b813b93e7bde1b5f468b5c85aa8b33590 (patch)
treefc53d379c37f5c5f156ba0f2b263ae057b35ca64 /drivers/mmc/core/sdio.c
parent39b9431b0f371294dd2d1a492cf77f2f17390a1f (diff)
mmc: core: Add bus_ops for runtime pm callbacks
SDIO is the only protocol that uses runtime pm for the card device right now. To provide the option for sd and mmc to use runtime pm as well the bus_ops callback are extended with two new functions. One for runtime_suspend and one for runtime_resume. This patch will also implement the callbacks for SDIO to make sure existing functionality is maintained. It also prepares to move away from using the mmc_power_restore_host API, since it is not needed when using runtime PM. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/core/sdio.c')
-rw-r--r--drivers/mmc/core/sdio.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 444668c210b2..1fbbd1bc55ec 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -1059,11 +1059,27 @@ out:
1059 return ret; 1059 return ret;
1060} 1060}
1061 1061
1062static int mmc_sdio_runtime_suspend(struct mmc_host *host)
1063{
1064 /* No references to the card, cut the power to it. */
1065 mmc_power_off(host);
1066 return 0;
1067}
1068
1069static int mmc_sdio_runtime_resume(struct mmc_host *host)
1070{
1071 /* Restore power and re-initialize. */
1072 mmc_power_up(host);
1073 return mmc_sdio_power_restore(host);
1074}
1075
1062static const struct mmc_bus_ops mmc_sdio_ops = { 1076static const struct mmc_bus_ops mmc_sdio_ops = {
1063 .remove = mmc_sdio_remove, 1077 .remove = mmc_sdio_remove,
1064 .detect = mmc_sdio_detect, 1078 .detect = mmc_sdio_detect,
1065 .suspend = mmc_sdio_suspend, 1079 .suspend = mmc_sdio_suspend,
1066 .resume = mmc_sdio_resume, 1080 .resume = mmc_sdio_resume,
1081 .runtime_suspend = mmc_sdio_runtime_suspend,
1082 .runtime_resume = mmc_sdio_runtime_resume,
1067 .power_restore = mmc_sdio_power_restore, 1083 .power_restore = mmc_sdio_power_restore,
1068 .alive = mmc_sdio_alive, 1084 .alive = mmc_sdio_alive,
1069}; 1085};