mmc: sdhci: Clear also HS400 1.2V capability if 1.2V is not supported
authorAdrian Hunter <adrian.hunter@intel.com>
Thu, 6 Nov 2014 13:19:05 +0000 (15:19 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 26 Nov 2014 13:30:51 +0000 (14:30 +0100)
1.2V HS200 mode capability is cleared if there is not a voltage
regulator that supports 1.2V.  Do the same for 1.2V HS400 mode.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci.c
include/linux/mmc/host.h

index c2f4754a28b6bfc81605e5ecb9f0d9ce3c0c47a4..5589563761f8fe0755d3e0e038cb2f6c4b4c5ada 100644 (file)
@@ -3115,16 +3115,17 @@ int sdhci_add_host(struct sdhci_host *host)
                /* SD3.0: SDR104 is supported so (for eMMC) the caps2
                 * field can be promoted to support HS200.
                 */
-               if (!(host->quirks2 & SDHCI_QUIRK2_BROKEN_HS200)) {
+               if (!(host->quirks2 & SDHCI_QUIRK2_BROKEN_HS200))
                        mmc->caps2 |= MMC_CAP2_HS200;
-                       if (IS_ERR(mmc->supply.vqmmc) ||
-                                       !regulator_is_supported_voltage
-                                       (mmc->supply.vqmmc, 1100000, 1300000))
-                               mmc->caps2 &= ~MMC_CAP2_HS200_1_2V_SDR;
-               }
        } else if (caps[1] & SDHCI_SUPPORT_SDR50)
                mmc->caps |= MMC_CAP_UHS_SDR50;
 
+       if ((mmc->caps2 & MMC_CAP2_HSX00_1_2V) &&
+           (IS_ERR(mmc->supply.vqmmc) ||
+            !regulator_is_supported_voltage(mmc->supply.vqmmc, 1100000,
+                                            1300000)))
+               mmc->caps2 &= ~MMC_CAP2_HSX00_1_2V;
+
        if ((caps[1] & SDHCI_SUPPORT_DDR50) &&
                !(host->quirks2 & SDHCI_QUIRK2_BROKEN_DDR50))
                mmc->caps |= MMC_CAP_UHS_DDR50;
index df0c15396bbfcce6c01eabe49778c4584d4b2d69..9f322706f7cb26a69c9f7ad4d21c195a8befe1aa 100644 (file)
@@ -289,6 +289,7 @@ struct mmc_host {
 #define MMC_CAP2_HS400_1_2V    (1 << 16)       /* Can support HS400 1.2V */
 #define MMC_CAP2_HS400         (MMC_CAP2_HS400_1_8V | \
                                 MMC_CAP2_HS400_1_2V)
+#define MMC_CAP2_HSX00_1_2V    (MMC_CAP2_HS200_1_2V_SDR | MMC_CAP2_HS400_1_2V)
 #define MMC_CAP2_SDIO_IRQ_NOTHREAD (1 << 17)
 
        mmc_pm_flag_t           pm_caps;        /* supported pm features */