Revert "mmc: host: Disable SDIO card clock when idle"
Pavan Kunapuli [Mon, 25 Jun 2012 10:12:55 +0000 (15:12 +0530)]
Without card clock, inband interrupt is not working on
some wifi chips.

Bug 981683

This reverts commit b31946b34507209f26c6d709e23fd1c0cedd25f8.

Change-Id: I2dd86edb2445bd6db7917adf509b7a018d31aaed
Reviewed-on: http://git-master/r/110839

Signed-off-by: Pavan Kunapuli <pkunapuli@nvidia.com>
Change-Id: I6f2266ac5b6bd9585272958b4b8a89af1b3cdffb
Reviewed-on: http://git-master/r/119009
Reviewed-by: Lokesh Pathak <lpathak@nvidia.com>
Tested-by: Lokesh Pathak <lpathak@nvidia.com>

drivers/mmc/host/sdhci.c

index f86bf74..3a440dc 100644 (file)
@@ -1851,19 +1851,13 @@ int sdhci_enable(struct mmc_host *mmc)
        struct sdhci_host *host = mmc_priv(mmc);
        u16 clk;
 
-       if (!mmc->card)
+       if (!mmc->card || mmc->card->type == MMC_TYPE_SDIO)
                return 0;
 
        if (mmc->ios.clock) {
-               if (mmc->card->type != MMC_TYPE_SDIO) {
-                       if (host->ops->set_clock)
-                               host->ops->set_clock(host, mmc->ios.clock);
-                       sdhci_set_clock(host, mmc->ios.clock);
-               } else {
-                       clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL);
-                       clk |= SDHCI_CLOCK_CARD_EN;
-                       sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
-               }
+               if (host->ops->set_clock)
+                       host->ops->set_clock(host, mmc->ios.clock);
+               sdhci_set_clock(host, mmc->ios.clock);
        }
 
        return 0;
@@ -1874,19 +1868,12 @@ int sdhci_disable(struct mmc_host *mmc, int lazy)
        struct sdhci_host *host = mmc_priv(mmc);
        u16 clk;
 
-       if (!mmc->card)
+       if (!mmc->card || mmc->card->type == MMC_TYPE_SDIO)
                return 0;
 
-       /* For SDIO cards, only disable the card clock. */
-       if (mmc->card->type != MMC_TYPE_SDIO) {
-               sdhci_set_clock(host, 0);
-               if (host->ops->set_clock)
-                       host->ops->set_clock(host, 0);
-       } else {
-               clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL);
-               clk &= ~SDHCI_CLOCK_CARD_EN;
-               sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
-       }
+       sdhci_set_clock(host, 0);
+       if (host->ops->set_clock)
+               host->ops->set_clock(host, 0);
 
        return 0;
 }