mmc: fsl_esdhc_imx: use mmc_of_parse to set host_caps

Use mmc_of_parse to set host_caps.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
This commit is contained in:
Peng Fan 2019-07-10 09:35:24 +00:00
parent 479a8dd6dc
commit b0155ac63c

View 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[] = {