aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/sdio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/core/sdio.c')
-rw-r--r--drivers/mmc/core/sdio.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 1fbbd1bc55ec..be8cca8d3024 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -910,11 +910,11 @@ out:
910} 910}
911 911
912/* 912/*
913 * SDIO suspend. We need to suspend all functions separately. 913 * SDIO pre_suspend. We need to suspend all functions separately.
914 * Therefore all registered functions must have drivers with suspend 914 * Therefore all registered functions must have drivers with suspend
915 * and resume methods. Failing that we simply remove the whole card. 915 * and resume methods. Failing that we simply remove the whole card.
916 */ 916 */
917static int mmc_sdio_suspend(struct mmc_host *host) 917static int mmc_sdio_pre_suspend(struct mmc_host *host)
918{ 918{
919 int i, err = 0; 919 int i, err = 0;
920 920
@@ -925,8 +925,26 @@ static int mmc_sdio_suspend(struct mmc_host *host)
925 if (!pmops || !pmops->suspend || !pmops->resume) { 925 if (!pmops || !pmops->suspend || !pmops->resume) {
926 /* force removal of entire card in that case */ 926 /* force removal of entire card in that case */
927 err = -ENOSYS; 927 err = -ENOSYS;
928 } else 928 break;
929 err = pmops->suspend(&func->dev); 929 }
930 }
931 }
932
933 return err;
934}
935
936/*
937 * SDIO suspend. Suspend all functions separately.
938 */
939static int mmc_sdio_suspend(struct mmc_host *host)
940{
941 int i, err = 0;
942
943 for (i = 0; i < host->card->sdio_funcs; i++) {
944 struct sdio_func *func = host->card->sdio_func[i];
945 if (func && sdio_func_present(func) && func->dev.driver) {
946 const struct dev_pm_ops *pmops = func->dev.driver->pm;
947 err = pmops->suspend(&func->dev);
930 if (err) 948 if (err)
931 break; 949 break;
932 } 950 }
@@ -1076,6 +1094,7 @@ static int mmc_sdio_runtime_resume(struct mmc_host *host)
1076static const struct mmc_bus_ops mmc_sdio_ops = { 1094static const struct mmc_bus_ops mmc_sdio_ops = {
1077 .remove = mmc_sdio_remove, 1095 .remove = mmc_sdio_remove,
1078 .detect = mmc_sdio_detect, 1096 .detect = mmc_sdio_detect,
1097 .pre_suspend = mmc_sdio_pre_suspend,
1079 .suspend = mmc_sdio_suspend, 1098 .suspend = mmc_sdio_suspend,
1080 .resume = mmc_sdio_resume, 1099 .resume = mmc_sdio_resume,
1081 .runtime_suspend = mmc_sdio_runtime_suspend, 1100 .runtime_suspend = mmc_sdio_runtime_suspend,