[PATCH 10/12] mmc: sdhci: disable clock control for SD4.0 mode

From: micky_ching
Date: Tue Apr 28 2015 - 21:35:39 EST


From: Micky Ching <micky_ching@xxxxxxxxxxxxxx>

Skip clock control settings for UHSII mode. When card is in UHSII mode,
we only allow poweroff.

Signed-off-by: Micky Ching <micky_ching@xxxxxxxxxxxxxx>
Signed-off-by: Wei Wang <wei_wang@xxxxxxxxxxxxxx>
---
drivers/mmc/host/sdhci.c | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 3c56944..03df58c 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1346,7 +1346,8 @@ void sdhci_set_clock(struct sdhci_host *host, unsigned int clock)

host->mmc->actual_clock = 0;

- sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL);
+ if (!host->uhsii_if_enabled)
+ sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL);

if (clock == 0)
return;
@@ -1686,7 +1687,8 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios)
!(host->quirks2 & SDHCI_QUIRK2_PRESET_VALUE_BROKEN))
sdhci_enable_preset_value(host, false);

- if (!ios->clock || ios->clock != host->clock) {
+ if (!host->uhsii_if_enabled &&
+ (!ios->clock || ios->clock != host->clock)) {
host->ops->set_clock(host, ios->clock);
host->clock = ios->clock;

@@ -1703,7 +1705,8 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios)
}
}

- sdhci_set_power(host, ios->power_mode, ios->vdd);
+ if (!(host->uhsii_if_enabled && (ios->power_mode != MMC_POWER_OFF)))
+ sdhci_set_power(host, ios->power_mode, ios->vdd);

if (host->ops->platform_send_init_74_clocks)
host->ops->platform_send_init_74_clocks(host, ios->power_mode);
@@ -1765,10 +1768,12 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios)
host->ops->set_clock(host, host->clock);
}

- /* Reset SD Clock Enable */
- clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL);
- clk &= ~SDHCI_CLOCK_CARD_EN;
- sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
+ if (!host->uhsii_if_enabled) {
+ /* Reset SD Clock Enable */
+ clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL);
+ clk &= ~SDHCI_CLOCK_CARD_EN;
+ sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
+ }

host->ops->set_uhs_signaling(host, ios->timing);
host->timing = ios->timing;
@@ -1788,7 +1793,8 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios)
}

/* Re-enable SD Clock */
- host->ops->set_clock(host, host->clock);
+ if (!host->uhsii_if_enabled)
+ host->ops->set_clock(host, host->clock);
} else
sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);

--
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/