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.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index b91abedcfdca..95bc1014b7a2 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -897,11 +897,10 @@ static int mmc_sdio_pre_suspend(struct mmc_host *host)
897 */ 897 */
898static int mmc_sdio_suspend(struct mmc_host *host) 898static int mmc_sdio_suspend(struct mmc_host *host)
899{ 899{
900 if (mmc_card_keep_power(host) && mmc_card_wake_sdio_irq(host)) { 900 mmc_claim_host(host);
901 mmc_claim_host(host); 901
902 if (mmc_card_keep_power(host) && mmc_card_wake_sdio_irq(host))
902 sdio_disable_wide(host->card); 903 sdio_disable_wide(host->card);
903 mmc_release_host(host);
904 }
905 904
906 if (!mmc_card_keep_power(host)) { 905 if (!mmc_card_keep_power(host)) {
907 mmc_power_off(host); 906 mmc_power_off(host);
@@ -910,6 +909,8 @@ static int mmc_sdio_suspend(struct mmc_host *host)
910 mmc_retune_needed(host); 909 mmc_retune_needed(host);
911 } 910 }
912 911
912 mmc_release_host(host);
913
913 return 0; 914 return 0;
914} 915}
915 916
@@ -1018,15 +1019,24 @@ out:
1018static int mmc_sdio_runtime_suspend(struct mmc_host *host) 1019static int mmc_sdio_runtime_suspend(struct mmc_host *host)
1019{ 1020{
1020 /* No references to the card, cut the power to it. */ 1021 /* No references to the card, cut the power to it. */
1022 mmc_claim_host(host);
1021 mmc_power_off(host); 1023 mmc_power_off(host);
1024 mmc_release_host(host);
1025
1022 return 0; 1026 return 0;
1023} 1027}
1024 1028
1025static int mmc_sdio_runtime_resume(struct mmc_host *host) 1029static int mmc_sdio_runtime_resume(struct mmc_host *host)
1026{ 1030{
1031 int ret;
1032
1027 /* Restore power and re-initialize. */ 1033 /* Restore power and re-initialize. */
1034 mmc_claim_host(host);
1028 mmc_power_up(host, host->card->ocr); 1035 mmc_power_up(host, host->card->ocr);
1029 return mmc_sdio_power_restore(host); 1036 ret = mmc_sdio_power_restore(host);
1037 mmc_release_host(host);
1038
1039 return ret;
1030} 1040}
1031 1041
1032static int mmc_sdio_reset(struct mmc_host *host) 1042static int mmc_sdio_reset(struct mmc_host *host)