Commit 13ab2a66 authored by Kishon Vijay Abraham I's avatar Kishon Vijay Abraham I Committed by Ulf Hansson

mmc: host: omap_hsmmc: use mmc_regulator_get_supply() to get regulators

In preparation for using the generic mmc binding for io regulator
("vqmmc"), use mmc_regulator_get_supply() to get vmmc and vqmmc regulators.
Only if "vqmmc" regulator isn't found, fallback to use "vmmc_aux"
regulator.
Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 86d79da0
...@@ -466,28 +466,20 @@ static int omap_hsmmc_disable_boot_regulators(struct omap_hsmmc_host *host) ...@@ -466,28 +466,20 @@ static int omap_hsmmc_disable_boot_regulators(struct omap_hsmmc_host *host)
static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
{ {
int ocr_value = 0;
int ret; int ret;
struct mmc_host *mmc = host->mmc; struct mmc_host *mmc = host->mmc;
if (mmc_pdata(host)->set_power) if (mmc_pdata(host)->set_power)
return 0; return 0;
mmc->supply.vmmc = devm_regulator_get_optional(host->dev, "vmmc"); ret = mmc_regulator_get_supply(mmc);
if (IS_ERR(mmc->supply.vmmc)) { if (ret == -EPROBE_DEFER)
ret = PTR_ERR(mmc->supply.vmmc);
if ((ret != -ENODEV) && host->dev->of_node)
return ret; return ret;
dev_dbg(host->dev, "unable to get vmmc regulator %ld\n",
PTR_ERR(mmc->supply.vmmc));
} else {
ocr_value = mmc_regulator_get_ocrmask(mmc->supply.vmmc);
if (ocr_value > 0)
mmc_pdata(host)->ocr_mask = ocr_value;
}
/* Allow an aux regulator */ /* Allow an aux regulator */
mmc->supply.vqmmc = devm_regulator_get_optional(host->dev, "vmmc_aux"); if (IS_ERR(mmc->supply.vqmmc)) {
mmc->supply.vqmmc = devm_regulator_get_optional(host->dev,
"vmmc_aux");
if (IS_ERR(mmc->supply.vqmmc)) { if (IS_ERR(mmc->supply.vqmmc)) {
ret = PTR_ERR(mmc->supply.vqmmc); ret = PTR_ERR(mmc->supply.vqmmc);
if ((ret != -ENODEV) && host->dev->of_node) if ((ret != -ENODEV) && host->dev->of_node)
...@@ -495,6 +487,7 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) ...@@ -495,6 +487,7 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
dev_dbg(host->dev, "unable to get vmmc_aux regulator %ld\n", dev_dbg(host->dev, "unable to get vmmc_aux regulator %ld\n",
PTR_ERR(mmc->supply.vqmmc)); PTR_ERR(mmc->supply.vqmmc));
} }
}
host->pbias = devm_regulator_get_optional(host->dev, "pbias"); host->pbias = devm_regulator_get_optional(host->dev, "pbias");
if (IS_ERR(host->pbias)) { if (IS_ERR(host->pbias)) {
...@@ -2143,6 +2136,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev) ...@@ -2143,6 +2136,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
if (ret) if (ret)
goto err_irq; goto err_irq;
if (!mmc->ocr_avail)
mmc->ocr_avail = mmc_pdata(host)->ocr_mask; mmc->ocr_avail = mmc_pdata(host)->ocr_mask;
omap_hsmmc_disable_irq(host); omap_hsmmc_disable_irq(host);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment