]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00209686-2:sdio:suspend/resume issue
authorB38613 <B38613@freescale.com>
Fri, 18 May 2012 10:15:56 +0000 (18:15 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:34:39 +0000 (08:34 +0200)
1.add MMC_PM_WAKE_SDIO_IRQ capability, it should be
used together with MMC_PM_KEEP_POWER although not support
SDIO wakeup in function.
2.add MMC_CAP_NONREMOVABLE to describe imx6's three sdhc
devices's removable feature.Now emmc is permanent,sdio and
sd is removable instead of all default were permanent before.
According to this feature, detimine whether reinit card
or not in resume.

Signed-off-by: B38613 <B38613@freescale.com>
drivers/mmc/core/sdio.c
drivers/mmc/host/sdhci-esdhc-imx.c

index 9b18b5416599dc81b5e9a711a6a6050155058a63..16b7484917c7d93fab61a887676872bf5d9327ac 100644 (file)
@@ -652,7 +652,7 @@ static int mmc_sdio_resume(struct mmc_host *host)
        mmc_claim_host(host);
 
        /* No need to reinitialize powered-resumed nonremovable cards */
-       if (mmc_card_is_removable(host) || !mmc_card_keep_power(host))
+       if (mmc_card_is_removable(host) && !mmc_card_keep_power(host))
                err = mmc_sdio_init_card(host, host->ocr, host->card,
                                        mmc_card_keep_power(host));
        else if (mmc_card_keep_power(host) && mmc_card_wake_sdio_irq(host)) {
index c2d416dd30af24da81fd34c9ff789fdc301697ca..00bfc85848dc07d565f8d3b642731ad986033bea 100644 (file)
@@ -722,7 +722,14 @@ static int esdhc_pltfm_init(struct sdhci_host *host, struct sdhci_pltfm_data *pd
        if (boarddata->support_8bit)
                host->mmc->caps |= MMC_CAP_8_BIT_DATA;
        if (boarddata->keep_power_at_suspend)
-               host->mmc->pm_caps |= MMC_PM_KEEP_POWER;
+               host->mmc->pm_caps |= (MMC_PM_KEEP_POWER | \
+                                       MMC_PM_WAKE_SDIO_IRQ);
+       if (boarddata->cd_type == ESDHC_CD_PERMANENT)
+               host->mmc->caps |= MMC_CAP_NONREMOVABLE;
+       else if (boarddata->cd_type == ESDHC_CD_CONTROLLER
+               || boarddata->cd_type == ESDHC_CD_NONE
+               || boarddata->cd_type == ESDHC_CD_GPIO)
+               host->mmc->caps &= ~MMC_CAP_NONREMOVABLE;
        if (cpu_is_mx6()) {
                host->mmc->caps |= MMC_CAP_1_8V_DDR;
                host->tuning_min = SDHCI_TUNE_CTRL_MIN;