]> git.sur5r.net Git - u-boot/commitdiff
mmc: sdhci: move broken voltage quirk handling to sdhci_setup_cfg()
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 25 Aug 2016 07:07:36 +0000 (16:07 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Mon, 19 Sep 2016 21:46:01 +0000 (06:46 +0900)
If CONFIG_BLK is enabled, add_sdhci() is never called.  Move this
quirk handling to sdhci_setup_cfg(), which is now the central place
for hardware capability checks.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
drivers/mmc/sdhci.c

index d886777f9f46469f3ff7e6b0530c1006492d32bf..c66151c8cf6ea4624bcfd2d48ee59779dec52fd6 100644 (file)
@@ -557,6 +557,9 @@ int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host,
        if (caps & SDHCI_CAN_VDD_180)
                cfg->voltages |= MMC_VDD_165_195;
 
+       if (host->quirks & SDHCI_QUIRK_BROKEN_VOLTAGE)
+               cfg->voltages |= host->voltages;
+
        cfg->host_caps = MMC_MODE_HS | MMC_MODE_HS_52MHz | MMC_MODE_4BIT;
        if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300) {
                if (caps & SDHCI_CAN_DO_8BIT)
@@ -597,9 +600,6 @@ int add_sdhci(struct sdhci_host *host, u32 max_clk, u32 min_clk)
        if (ret)
                return ret;
 
-       if (host->quirks & SDHCI_QUIRK_BROKEN_VOLTAGE)
-               host->cfg.voltages |= host->voltages;
-
        host->mmc = mmc_create(&host->cfg, host);
        if (host->mmc == NULL) {
                printf("%s: mmc create fail!\n", __func__);