aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core
diff options
context:
space:
mode:
authorOhad Ben-Cohen <ohad@wizery.com>2010-10-02 07:54:07 -0400
committerChris Ball <cjb@laptop.org>2010-10-23 09:11:18 -0400
commitd3fe37b1a1d98f060279bfa32fcf5a134851a91a (patch)
treeec12b9f05efdf9145f1d5f3a47976e586bef1b1b /drivers/mmc/core
parent12ae637f081a7a05144af65802a7b492b9162660 (diff)
mmc: sdio: add power_restore support
Add a power_restore handler to the SDIO bus ops, in order to support waking up SDIO cards that were powered off by runtime pm. Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com> Tested-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/core')
-rw-r--r--drivers/mmc/core/sdio.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 3be1571e4a51..f17e0e0bd9d1 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -638,11 +638,29 @@ static int mmc_sdio_resume(struct mmc_host *host)
638 return err; 638 return err;
639} 639}
640 640
641static int mmc_sdio_power_restore(struct mmc_host *host)
642{
643 int ret;
644
645 BUG_ON(!host);
646 BUG_ON(!host->card);
647
648 mmc_claim_host(host);
649 ret = mmc_sdio_init_card(host, host->ocr, host->card,
650 (host->pm_flags & MMC_PM_KEEP_POWER));
651 if (!ret && host->sdio_irqs)
652 mmc_signal_sdio_irq(host);
653 mmc_release_host(host);
654
655 return ret;
656}
657
641static const struct mmc_bus_ops mmc_sdio_ops = { 658static const struct mmc_bus_ops mmc_sdio_ops = {
642 .remove = mmc_sdio_remove, 659 .remove = mmc_sdio_remove,
643 .detect = mmc_sdio_detect, 660 .detect = mmc_sdio_detect,
644 .suspend = mmc_sdio_suspend, 661 .suspend = mmc_sdio_suspend,
645 .resume = mmc_sdio_resume, 662 .resume = mmc_sdio_resume,
663 .power_restore = mmc_sdio_power_restore,
646}; 664};
647 665
648 666