aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKishon Vijay Abraham I2018-01-30 16:01:45 +0100
committerJaehoon Chung2018-02-19 16:58:55 +0900
commit90321dce0da1ba0844a7066a1034cdf73b8613c6 (patch)
tree01ff706f383a4f00d7afb1e09d8556eeb2cff1a6
parent42182c9b9ca946b68f564936ffc181b75ce3da9f (diff)
mmc: omap_hsmmc: allow mmc clock to be gated
mmc core has defined a new parameter *clk_disable* to gate the clock. Disable the clock here if *clk_disable* is set. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
-rw-r--r--drivers/mmc/omap_hsmmc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
index 71608d18e20..0e80420d8bd 100644
--- a/drivers/mmc/omap_hsmmc.c
+++ b/drivers/mmc/omap_hsmmc.c
@@ -1207,6 +1207,7 @@ static int omap_hsmmc_set_ios(struct udevice *dev)
struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev);
struct mmc *mmc = upriv->mmc;
#endif
+ struct hsmmc *mmc_base = priv->base_addr;
if (priv->bus_width != mmc->bus_width)
omap_hsmmc_set_bus_width(mmc);
@@ -1214,6 +1215,11 @@ static int omap_hsmmc_set_ios(struct udevice *dev)
if (priv->clock != mmc->clock)
omap_hsmmc_set_clock(mmc);
+ if (mmc->clk_disable)
+ omap_hsmmc_stop_clock(mmc_base);
+ else
+ omap_hsmmc_start_clock(mmc_base);
+
#if CONFIG_IS_ENABLED(DM_MMC)
if (priv->mode != mmc->selected_mode)
omap_hsmmc_set_timing(mmc);