summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/mmc/host/sdhci.c29
1 files changed, 8 insertions, 21 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index f86bf746a6e6..3a440dcf0f24 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -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;
}