提交 d3fe37b1 编写于 作者: O Ohad Ben-Cohen 提交者: Chris Ball

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: NOhad Ben-Cohen <ohad@wizery.com>
Tested-by: NLuciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: NChris Ball <cjb@laptop.org>
上级 12ae637f
......@@ -638,11 +638,29 @@ static int mmc_sdio_resume(struct mmc_host *host)
return err;
}
static int mmc_sdio_power_restore(struct mmc_host *host)
{
int ret;
BUG_ON(!host);
BUG_ON(!host->card);
mmc_claim_host(host);
ret = mmc_sdio_init_card(host, host->ocr, host->card,
(host->pm_flags & MMC_PM_KEEP_POWER));
if (!ret && host->sdio_irqs)
mmc_signal_sdio_irq(host);
mmc_release_host(host);
return ret;
}
static const struct mmc_bus_ops mmc_sdio_ops = {
.remove = mmc_sdio_remove,
.detect = mmc_sdio_detect,
.suspend = mmc_sdio_suspend,
.resume = mmc_sdio_resume,
.power_restore = mmc_sdio_power_restore,
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册