Commit 90321dce0da1ba0844a7066a1034cdf73b8613c6
Committed by
Jaehoon Chung
1 parent
42182c9b9c
Exists in
smarc_8mq_lf_v2020.04
and in
17 other branches
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>
Showing 1 changed file with 6 additions and 0 deletions Side-by-side Diff
drivers/mmc/omap_hsmmc.c
... | ... | @@ -1207,12 +1207,18 @@ |
1207 | 1207 | struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev); |
1208 | 1208 | struct mmc *mmc = upriv->mmc; |
1209 | 1209 | #endif |
1210 | + struct hsmmc *mmc_base = priv->base_addr; | |
1210 | 1211 | |
1211 | 1212 | if (priv->bus_width != mmc->bus_width) |
1212 | 1213 | omap_hsmmc_set_bus_width(mmc); |
1213 | 1214 | |
1214 | 1215 | if (priv->clock != mmc->clock) |
1215 | 1216 | omap_hsmmc_set_clock(mmc); |
1217 | + | |
1218 | + if (mmc->clk_disable) | |
1219 | + omap_hsmmc_stop_clock(mmc_base); | |
1220 | + else | |
1221 | + omap_hsmmc_start_clock(mmc_base); | |
1216 | 1222 | |
1217 | 1223 | #if CONFIG_IS_ENABLED(DM_MMC) |
1218 | 1224 | if (priv->mode != mmc->selected_mode) |