diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2021-06-07 12:44:04 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-06-10 15:16:13 +0200 |
commit | a035d2404e9bb4ba95806dd2a45e37c2a73dee12 (patch) | |
tree | 630aaae5ff949ec1a732d074613ff8c1abea326d /drivers | |
parent | 6fb9b51fcaa302e935a31b7fce269589427b7aa0 (diff) | |
download | barebox-a035d2404e9bb4ba95806dd2a45e37c2a73dee12.tar.gz barebox-a035d2404e9bb4ba95806dd2a45e37c2a73dee12.tar.xz |
mci: sdhci: imx: Use sdhci_setup_host()
sdhci_setup_host() handles reading the caps. Call it instead of doing it
in the driver.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.barebox.org/20210607104411.23071-6-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mci/imx-esdhc.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/drivers/mci/imx-esdhc.c b/drivers/mci/imx-esdhc.c index fa858a9853..12e98ce26a 100644 --- a/drivers/mci/imx-esdhc.c +++ b/drivers/mci/imx-esdhc.c @@ -230,7 +230,6 @@ static int fsl_esdhc_probe(struct device_d *dev) struct resource *iores; struct fsl_esdhc_host *host; struct mci_host *mci; - u32 caps; int ret; unsigned long rate; struct esdhc_platform_data *pdata = dev->platform_data; @@ -269,29 +268,22 @@ static int fsl_esdhc_probe(struct device_d *dev) esdhc_populate_sdhci(host); - caps = sdhci_read32(&host->sdhci, SDHCI_CAPABILITIES); - - if (caps & SDHCI_CAN_VDD_180) - mci->voltages |= MMC_VDD_165_195; - if (caps & SDHCI_CAN_VDD_300) - mci->voltages |= MMC_VDD_29_30 | MMC_VDD_30_31; - if (caps & SDHCI_CAN_VDD_330) - mci->voltages |= MMC_VDD_32_33 | MMC_VDD_33_34; - if (pdata) { mci->host_caps = pdata->caps; if (pdata->devname) mci->devname = pdata->devname; } - if (caps & SDHCI_CAN_DO_HISPD) - mci->host_caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED; - host->mci.send_cmd = esdhc_send_cmd; host->mci.set_ios = esdhc_set_ios; host->mci.init = esdhc_init; host->mci.card_present = esdhc_card_present; host->mci.hw_dev = dev; + host->sdhci.mci = &host->mci; + + ret = sdhci_setup_host(&host->sdhci); + if (ret) + goto err_clk_disable; rate = clk_get_rate(host->clk); host->mci.f_min = rate >> 12; |