mmc: meson-gx: enable input clocks
[oweals/u-boot.git] / drivers / mmc / meson_gx_mmc.c
index b5f5122b1b7bb91220bd0010c4f3b5a0cb95648d..86c1a7164a93e26e378d8154c9a270634c5aa249 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <clk.h>
 #include <cpu_func.h>
 #include <dm.h>
 #include <fdtdec.h>
@@ -241,12 +242,23 @@ static int meson_mmc_probe(struct udevice *dev)
        struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev);
        struct mmc *mmc = &pdata->mmc;
        struct mmc_config *cfg = &pdata->cfg;
+       struct clk_bulk clocks;
        uint32_t val;
+       int ret;
+
 #ifdef CONFIG_PWRSEQ
        struct udevice *pwr_dev;
-       int ret;
 #endif
 
+       /* Enable the clocks feeding the MMC controller */
+       ret = clk_get_bulk(dev, &clocks);
+       if (ret)
+               return ret;
+
+       ret = clk_enable_bulk(&clocks);
+       if (ret)
+               return ret;
+
        cfg->voltages = MMC_VDD_33_34 | MMC_VDD_32_33 |
                        MMC_VDD_31_32 | MMC_VDD_165_195;
        cfg->host_caps = MMC_MODE_8BIT | MMC_MODE_4BIT |