mmc: sdhci: fix SDHCI_QUIRK_NO_HISPD_BIT handling
authoryangbo lu <yangbo.lu@nxp.com>
Tue, 15 Aug 2017 02:16:47 +0000 (10:16 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 30 Aug 2017 13:03:36 +0000 (15:03 +0200)
SD controller with SDHCI_QUIRK_NO_HISPD_BIT quirk probably
use high speed enable bit for other purpose. So this bit
shouldn't be changed for high speed enabling for this type of
SD controller.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci.c

index 1fda50855e31c9d1b2415c42704a31ee1fda6c05..5afc72f09a2a4b040f66b3295f9d5ccc9a424638 100644 (file)
@@ -1640,19 +1640,20 @@ void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 
        ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
 
-       if ((ios->timing == MMC_TIMING_SD_HS ||
-            ios->timing == MMC_TIMING_MMC_HS ||
-            ios->timing == MMC_TIMING_MMC_HS400 ||
-            ios->timing == MMC_TIMING_MMC_HS200 ||
-            ios->timing == MMC_TIMING_MMC_DDR52 ||
-            ios->timing == MMC_TIMING_UHS_SDR50 ||
-            ios->timing == MMC_TIMING_UHS_SDR104 ||
-            ios->timing == MMC_TIMING_UHS_DDR50 ||
-            ios->timing == MMC_TIMING_UHS_SDR25)
-           && !(host->quirks & SDHCI_QUIRK_NO_HISPD_BIT))
-               ctrl |= SDHCI_CTRL_HISPD;
-       else
-               ctrl &= ~SDHCI_CTRL_HISPD;
+       if (!(host->quirks & SDHCI_QUIRK_NO_HISPD_BIT)) {
+               if (ios->timing == MMC_TIMING_SD_HS ||
+                    ios->timing == MMC_TIMING_MMC_HS ||
+                    ios->timing == MMC_TIMING_MMC_HS400 ||
+                    ios->timing == MMC_TIMING_MMC_HS200 ||
+                    ios->timing == MMC_TIMING_MMC_DDR52 ||
+                    ios->timing == MMC_TIMING_UHS_SDR50 ||
+                    ios->timing == MMC_TIMING_UHS_SDR104 ||
+                    ios->timing == MMC_TIMING_UHS_DDR50 ||
+                    ios->timing == MMC_TIMING_UHS_SDR25)
+                       ctrl |= SDHCI_CTRL_HISPD;
+               else
+                       ctrl &= ~SDHCI_CTRL_HISPD;
+       }
 
        if (host->version >= SDHCI_SPEC_300) {
                u16 clk, ctrl_2;