]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mmc: fsl_esdhc: fix mmc->clock with actual clock
authorYangbo Lu <yangbo.lu@nxp.com>
Tue, 1 Sep 2020 08:58:06 +0000 (16:58 +0800)
committerPeng Fan <peng.fan@nxp.com>
Mon, 12 Oct 2020 07:47:05 +0000 (15:47 +0800)
Fix mmc->clock with actual clock which is divided by the
controller, and record it with priv->clock which was removed
accidentally.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
drivers/mmc/fsl_esdhc.c

index c53751d0bbb00d5aade575aa20021571acd98afa..ce87416f5d946b687b24f5e1e939f8afaeea284d 100644 (file)
@@ -523,6 +523,9 @@ static void set_sysctl(struct fsl_esdhc_priv *priv, struct mmc *mmc, uint clock)
        while (sdhc_clk / (div * pre_div) > clock && div < 16)
                div++;
 
+       mmc->clock = sdhc_clk / pre_div / div;
+       priv->clock = mmc->clock;
+
        pre_div >>= 1;
        div -= 1;