aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mmc/host/sdhci-esdhc-imx.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index ae68bc965ab5..ac6f971b625f 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -220,15 +220,18 @@ static void esdhc_writel_le(struct sdhci_host *host, u32 val, int reg)
220 220
221static u16 esdhc_readw_le(struct sdhci_host *host, int reg) 221static u16 esdhc_readw_le(struct sdhci_host *host, int reg)
222{ 222{
223 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
224 struct pltfm_imx_data *imx_data = pltfm_host->priv;
225
223 if (unlikely(reg == SDHCI_HOST_VERSION)) { 226 if (unlikely(reg == SDHCI_HOST_VERSION)) {
224 u16 val = readw(host->ioaddr + (reg ^ 2)); 227 reg ^= 2;
225 /* 228 if (is_imx6q_usdhc(imx_data)) {
226 * uSDHC supports SDHCI v3.0, but it's encoded as value 229 /*
227 * 0x3 in host controller version register, which violates 230 * The usdhc register returns a wrong host version.
228 * SDHCI_SPEC_300 definition. Work it around here. 231 * Correct it here.
229 */ 232 */
230 if ((val & SDHCI_SPEC_VER_MASK) == 3) 233 return SDHCI_SPEC_300;
231 return --val; 234 }
232 } 235 }
233 236
234 return readw(host->ioaddr + reg); 237 return readw(host->ioaddr + reg);