diff mbox series

[U-Boot,14/23] mmc: omap_hsmmc: update mmc->clock with the actual bus speed

Message ID 1506007346-10037-15-git-send-email-jjhiblot@ti.com
State Changes Requested
Delegated to: Tom Rini
Headers show
Series mmc: omap5: Add support for UHS and HS200 modes | expand

Commit Message

Jean-Jacques Hiblot Sept. 21, 2017, 3:22 p.m. UTC
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@ti.com>
---
 drivers/mmc/omap_hsmmc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
index 615eb4c..82ec69e 100644
--- a/drivers/mmc/omap_hsmmc.c
+++ b/drivers/mmc/omap_hsmmc.c
@@ -1143,7 +1143,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);
 }