Skip to content

Commit 81dce14

Browse files
Haibo Chenstorulf
authored andcommitted
mmc: sdhci-esdhc-imx: make "no-mmc-hs400" works
After commit 1ed5c3b ("mmc: sdhci-esdhc-imx: Propagate ESDHC_FLAG_HS400* only on 8bit bus"), the property "no-mmc-hs400" from device tree file do not work any more. This patch reorder the code, which can avoid the warning message "drop HS400 support since no 8-bit bus" and also make the property "no-mmc-hs400" from dts file works. Fixes: 1ed5c3b ("mmc: sdhci-esdhc-imx: Propagate ESDHC_FLAG_HS400* only on 8bit bus") Signed-off-by: Haibo Chen <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent e5bce3c commit 81dce14

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

drivers/mmc/host/sdhci-esdhc-imx.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,6 +1634,10 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
16341634
if (ret)
16351635
return ret;
16361636

1637+
/* HS400/HS400ES require 8 bit bus */
1638+
if (!(host->mmc->caps & MMC_CAP_8_BIT_DATA))
1639+
host->mmc->caps2 &= ~(MMC_CAP2_HS400 | MMC_CAP2_HS400_ES);
1640+
16371641
if (mmc_gpio_get_cd(host->mmc) >= 0)
16381642
host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
16391643

@@ -1724,26 +1728,20 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
17241728
host->mmc_host_ops.init_card = usdhc_init_card;
17251729
}
17261730

1727-
err = sdhci_esdhc_imx_probe_dt(pdev, host, imx_data);
1728-
if (err)
1729-
goto disable_ahb_clk;
1730-
17311731
if (imx_data->socdata->flags & ESDHC_FLAG_MAN_TUNING)
17321732
sdhci_esdhc_ops.platform_execute_tuning =
17331733
esdhc_executing_tuning;
17341734

17351735
if (imx_data->socdata->flags & ESDHC_FLAG_ERR004536)
17361736
host->quirks |= SDHCI_QUIRK_BROKEN_ADMA;
17371737

1738-
if (host->mmc->caps & MMC_CAP_8_BIT_DATA &&
1739-
imx_data->socdata->flags & ESDHC_FLAG_HS400)
1738+
if (imx_data->socdata->flags & ESDHC_FLAG_HS400)
17401739
host->mmc->caps2 |= MMC_CAP2_HS400;
17411740

17421741
if (imx_data->socdata->flags & ESDHC_FLAG_BROKEN_AUTO_CMD23)
17431742
host->quirks2 |= SDHCI_QUIRK2_ACMD23_BROKEN;
17441743

1745-
if (host->mmc->caps & MMC_CAP_8_BIT_DATA &&
1746-
imx_data->socdata->flags & ESDHC_FLAG_HS400_ES) {
1744+
if (imx_data->socdata->flags & ESDHC_FLAG_HS400_ES) {
17471745
host->mmc->caps2 |= MMC_CAP2_HS400_ES;
17481746
host->mmc_host_ops.hs400_enhanced_strobe =
17491747
esdhc_hs400_enhanced_strobe;
@@ -1765,6 +1763,10 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
17651763
goto disable_ahb_clk;
17661764
}
17671765

1766+
err = sdhci_esdhc_imx_probe_dt(pdev, host, imx_data);
1767+
if (err)
1768+
goto disable_ahb_clk;
1769+
17681770
sdhci_esdhc_imx_hwinit(host);
17691771

17701772
err = sdhci_add_host(host);

0 commit comments

Comments
 (0)