mmc: sdhci-esdhc-imx: manually reset MIX_CTRL for usdhc
authorShawn Guo <shawn.guo@linaro.org>
Mon, 21 Jan 2013 11:02:25 +0000 (19:02 +0800)
committerChris Ball <cjb@laptop.org>
Sun, 24 Feb 2013 19:37:01 +0000 (14:37 -0500)
It's another violation to SDHC spec that software reset on usdhc
does not reset MIX_CTRL register.  Have to do it manually, otherwise
the preserving of the register bits (e.g. AC23EN) may cause mmc card
fail to be initialized.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Tested-by: Dirk Behme <dirk.behme@de.bosch.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/host/sdhci-esdhc-imx.c

index 48832c567f720061ad6a7449e43683b00dd31c6d..968a70f1a42033dc332dae9650a521a7edb325a2 100644 (file)
@@ -318,8 +318,15 @@ static void esdhc_writeb_le(struct sdhci_host *host, u8 val, int reg)
         * circuit relies on.  To work around it, we turn the clocks on back
         * to keep card detection circuit functional.
         */
-       if ((reg == SDHCI_SOFTWARE_RESET) && (val & 1))
+       if ((reg == SDHCI_SOFTWARE_RESET) && (val & 1)) {
                esdhc_clrset_le(host, 0x7, 0x7, ESDHC_SYSTEM_CONTROL);
+               /*
+                * The reset on usdhc fails to clear MIX_CTRL register.
+                * Do it manually here.
+                */
+               if (is_imx6q_usdhc(imx_data))
+                       writel(0, host->ioaddr + ESDHC_MIX_CTRL);
+       }
 }
 
 static unsigned int esdhc_pltfm_get_max_clock(struct sdhci_host *host)