mmc: fsl_esdhc_imx: use mmc_of_parse to set host_caps
authorPeng Fan <peng.fan@nxp.com>
Wed, 10 Jul 2019 09:35:24 +0000 (09:35 +0000)
committerPeng Fan <peng.fan@nxp.com>
Mon, 15 Jul 2019 02:30:09 +0000 (10:30 +0800)
Use mmc_of_parse to set host_caps.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
drivers/mmc/fsl_esdhc_imx.c

index 49382026f1e23072217fb2fa211dc2b14258b586..0d2587982cddff0fe5ab28e51e4f90eb5560a53a 100644 (file)
@@ -101,7 +101,6 @@ struct fsl_esdhc_plat {
 
 struct esdhc_soc_data {
        u32 flags;
-       u32 caps;
 };
 
 /**
@@ -1426,10 +1425,8 @@ static int fsl_esdhc_probe(struct udevice *dev)
        priv->esdhc_regs = (struct fsl_esdhc *)addr;
        priv->dev = dev;
        priv->mode = -1;
-       if (data) {
+       if (data)
                priv->flags = data->flags;
-               priv->caps = data->caps;
-       }
 
        val = dev_read_u32_default(dev, "bus-width", -1);
        if (val == 8)
@@ -1490,9 +1487,6 @@ static int fsl_esdhc_probe(struct udevice *dev)
        }
 #endif
 
-       if (fdt_get_property(fdt, node, "no-1-8-v", NULL))
-               priv->caps &= ~(UHS_CAPS | MMC_MODE_HS200 | MMC_MODE_HS400);
-
        /*
         * TODO:
         * Because lack of clk driver, if SDHC clk is not enabled,
@@ -1543,6 +1537,10 @@ static int fsl_esdhc_probe(struct udevice *dev)
                return ret;
        }
 
+       ret = mmc_of_parse(dev, &plat->cfg);
+       if (ret)
+               return ret;
+
        mmc = &plat->mmc;
        mmc->cfg = &plat->cfg;
        mmc->dev = dev;
@@ -1610,8 +1608,6 @@ static struct esdhc_soc_data usdhc_imx7d_data = {
        .flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING
                        | ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200
                        | ESDHC_FLAG_HS400,
-       .caps = UHS_CAPS | MMC_MODE_HS200 | MMC_MODE_DDR_52MHz |
-               MMC_MODE_HS_52MHz | MMC_MODE_HS,
 };
 
 static const struct udevice_id fsl_esdhc_ids[] = {