diff options
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r-- | drivers/mmc/host/mx_sdhci.c | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/drivers/mmc/host/mx_sdhci.c b/drivers/mmc/host/mx_sdhci.c index f79fab00120b..4b7e4b857337 100644 --- a/drivers/mmc/host/mx_sdhci.c +++ b/drivers/mmc/host/mx_sdhci.c @@ -1,5 +1,5 @@ /* - * Copyright 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved. */ /* @@ -1139,6 +1139,7 @@ static void sdhci_tasklet_finish(unsigned long param) { struct sdhci_host *host; unsigned long flags; + int req_done; struct mmc_request *mrq; host = (struct sdhci_host *)param; @@ -1194,25 +1195,21 @@ static void sdhci_tasklet_finish(unsigned long param) return; } - flags = SDHCI_DATA_ACTIVE | SDHCI_DOING_WRITE | SDHCI_DOING_READ; - if (machine_is_mx35_3ds()) { - /* Do not disable the eSDHC clk on MX35 3DS board, - * since SYSTEM can't boot up after the reset key - * is pressed when the SD/MMC boot mode is used. - * The root cause is that the ROM code don't ensure - * the SD/MMC clk is running when boot system. - * */ - mmc_request_done(host->mmc, mrq); - } else { - if (!(readl(host->ioaddr + SDHCI_PRESENT_STATE) & flags)) { - if (host->plat_data->clk_flg) { - clk_disable(host->clk); - host->plat_data->clk_flg = 0; - } - } - - mmc_request_done(host->mmc, mrq); + req_done = !(readl(host->ioaddr + SDHCI_PRESENT_STATE) & + (SDHCI_DATA_ACTIVE | SDHCI_DOING_WRITE | SDHCI_DOING_READ)); + /* Do not disable the eSDHC clk on MX35 3DS board, + * since SYSTEM can't boot up after the reset key + * is pressed when the SD/MMC boot mode is used. + * The root cause is that the ROM code don't ensure + * the SD/MMC clk is running when boot system. + * */ + if (!machine_is_mx35_3ds() && req_done && host->plat_data->clk_flg && + !(host->mmc && host->mmc->card && mmc_card_sdio(host->mmc->card))) { + clk_disable(host->clk); + host->plat_data->clk_flg = 0; } + mmc_request_done(host->mmc, mrq); + } static void sdhci_timeout_timer(unsigned long data) |