aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/core/core.c')
-rw-r--r--drivers/mmc/core/core.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 75333a2461df..72c7cf4a9f9d 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -677,14 +677,19 @@ int mmc_suspend_host(struct mmc_host *host, pm_message_t state)
677 677
678 mmc_bus_get(host); 678 mmc_bus_get(host);
679 if (host->bus_ops && !host->bus_dead) { 679 if (host->bus_ops && !host->bus_dead) {
680 if (host->bus_ops->remove) 680 if (host->bus_ops->suspend)
681 host->bus_ops->remove(host); 681 host->bus_ops->suspend(host);
682 mmc_detach_bus(host); 682 if (!host->bus_ops->resume) {
683 if (host->bus_ops->remove)
684 host->bus_ops->remove(host);
685
686 mmc_claim_host(host);
687 mmc_detach_bus(host);
688 mmc_release_host(host);
689 }
683 } 690 }
684 mmc_bus_put(host); 691 mmc_bus_put(host);
685 692
686 BUG_ON(host->card);
687
688 mmc_power_off(host); 693 mmc_power_off(host);
689 694
690 return 0; 695 return 0;
@@ -698,7 +703,19 @@ EXPORT_SYMBOL(mmc_suspend_host);
698 */ 703 */
699int mmc_resume_host(struct mmc_host *host) 704int mmc_resume_host(struct mmc_host *host)
700{ 705{
701 mmc_rescan(&host->detect.work); 706 mmc_bus_get(host);
707 if (host->bus_ops && !host->bus_dead) {
708 mmc_power_up(host);
709 BUG_ON(!host->bus_ops->resume);
710 host->bus_ops->resume(host);
711 }
712 mmc_bus_put(host);
713
714 /*
715 * We add a slight delay here so that resume can progress
716 * in parallel.
717 */
718 mmc_detect_change(host, 1);
702 719
703 return 0; 720 return 0;
704} 721}