[PATCH] mci: cadence: fix device tree override of host_caps

Ahmad Fatoum a.fatoum at pengutronix.de
Fri Apr 10 00:19:16 PDT 2026


On 4/9/26 4:15 PM, Michael Tretter wrote:
> The host_caps setting in the device tree shall override the default
> host_caps set by the driver to allow board specific overrides.
> 
> Move the configuration of the driver default host_caps before the call
> to mci_of_parse().
> 
> mci_of_parse() still has to be called in the middle of the mci
> configuration, because f_max may be set in the device tree, but is used
> to calculate f_min.
> 
> Signed-off-by: Michael Tretter <m.tretter at pengutronix.de>

Reviewed-by: Ahmad Fatoum <a.fatoum at pengutronix.de>

> ---
>  drivers/mci/cadence-sdhci.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mci/cadence-sdhci.c b/drivers/mci/cadence-sdhci.c
> index ccd0f36cb033..b76c04f5e087 100644
> --- a/drivers/mci/cadence-sdhci.c
> +++ b/drivers/mci/cadence-sdhci.c
> @@ -471,13 +471,14 @@ static int sdhci_cdns_probe(struct device *dev)
>  
>  	dev->priv = priv;
>  
> +	priv->mci.voltages = MMC_VDD_32_33 | MMC_VDD_33_34;
> +	priv->mci.host_caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA;
> +	priv->mci.host_caps |= MMC_CAP_MMC_HIGHSPEED_52MHZ;
> +
>  	priv->mci.f_max = clk_get_rate(priv->biu_clk);
>  	mci_of_parse(mci);
>  	priv->mci.f_min = priv->mci.f_max / SDHCI_MAX_DIV_SPEC_300;
>  
> -	priv->mci.voltages = MMC_VDD_32_33 | MMC_VDD_33_34;
> -	priv->mci.host_caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA;
> -	priv->mci.host_caps |= MMC_CAP_MMC_HIGHSPEED_52MHZ;
>  	if (is_sd4hc) {
>  		ret = sdhci_cdns4_phy_probe(dev, priv);
>  	} else {
> 
> ---
> base-commit: 86269eff785a915cfb96f09d9c7ec81a89d33012
> change-id: 20260409-socfpga-agilex5-sdhci-d4179764d02f
> 
> Best regards,

-- 
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |




More information about the barebox mailing list