diff options
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/fsl_esdhc_imx.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mmc/fsl_esdhc_imx.c b/drivers/mmc/fsl_esdhc_imx.c index 29a945ed73..697e3c641d 100644 --- a/drivers/mmc/fsl_esdhc_imx.c +++ b/drivers/mmc/fsl_esdhc_imx.c @@ -608,6 +608,8 @@ static void set_sysctl(struct fsl_esdhc_priv *priv, struct mmc *mmc, uint clock) while (sdhc_clk / (div * pre_div * ddr_pre_div) > clock && div < 16) div++; + mmc->clock = sdhc_clk / pre_div / div / ddr_pre_div; + pre_div >>= 1; div -= 1; @@ -629,7 +631,6 @@ static void set_sysctl(struct fsl_esdhc_priv *priv, struct mmc *mmc, uint clock) else esdhc_setbits32(®s->sysctl, SYSCTL_PEREN | SYSCTL_CKEN); - mmc->clock = sdhc_clk / pre_div / div; priv->clock = clock; } |