#include <linux/leds.h>
#include <linux/mmc/host.h>
+#include <linux/mmc/card.h>
#include "sdhci.h"
int sdhci_suspend_host(struct sdhci_host *host, pm_message_t state)
{
- int ret;
+ int ret = 0;
+ struct mmc_host *mmc = host->mmc;
sdhci_disable_card_detection(host);
- ret = mmc_suspend_host(host->mmc);
- if (ret)
- return ret;
+ if (mmc->card && (mmc->card->type != MMC_TYPE_SDIO))
+ ret = mmc_suspend_host(host->mmc);
- free_irq(host->irq, host);
+ sdhci_mask_irqs(host, SDHCI_INT_ALL_MASK);
if (host->vmmc)
ret = regulator_disable(host->vmmc);
+ if (host->irq)
+ disable_irq(host->irq);
+
return ret;
}
int sdhci_resume_host(struct sdhci_host *host)
{
- int ret;
+ int ret = 0;
+ struct mmc_host *mmc = host->mmc;
if (host->vmmc) {
int ret = regulator_enable(host->vmmc);
host->ops->enable_dma(host);
}
- ret = request_irq(host->irq, sdhci_irq, IRQF_SHARED,
- mmc_hostname(host->mmc), host);
- if (ret)
- return ret;
+ if (host->irq)
+ enable_irq(host->irq);
sdhci_init(host, (host->mmc->pm_flags & MMC_PM_KEEP_POWER));
mmiowb();
- ret = mmc_resume_host(host->mmc);
+ if (mmc->card && (mmc->card->type != MMC_TYPE_SDIO))
+ ret = mmc_resume_host(host->mmc);
+
sdhci_enable_card_detection(host);
return ret;