[U-Boot] [PATCH v2 14/24] mmc: omap_hsmmc: update mmc->clock with the actual bus speed

Jean-Jacques Hiblot jjhiblot at ti.com
Thu Jan 25 10:51:40 UTC 2018


When the clock is applied, compute the actual value of the clock. It may be
slightly different from the requested value (max freq, divisor threshold)

Signed-off-by: Jean-Jacques Hiblot <jjhiblot at ti.com>
---

 drivers/mmc/omap_hsmmc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
index 052162b..28fac9b 100644
--- a/drivers/mmc/omap_hsmmc.c
+++ b/drivers/mmc/omap_hsmmc.c
@@ -1147,7 +1147,8 @@ static void omap_hsmmc_set_clock(struct mmc *mmc)
 		}
 	}
 
-	priv->clock = mmc->clock;
+	priv->clock = MMC_CLOCK_REFERENCE * 1000000 / dsor;
+	mmc->clock = priv->clock;
 	omap_hsmmc_start_clock(mmc_base);
 }
 
-- 
1.9.1



More information about the U-Boot mailing list