|
@@ -839,14 +839,14 @@ static void cvm_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
|
|
cvm_mmc_reset_bus(slot);
|
|
cvm_mmc_reset_bus(slot);
|
|
if (host->global_pwr_gpiod)
|
|
if (host->global_pwr_gpiod)
|
|
host->set_shared_power(host, 0);
|
|
host->set_shared_power(host, 0);
|
|
- else
|
|
|
|
|
|
+ else if (!IS_ERR(mmc->supply.vmmc))
|
|
mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0);
|
|
mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0);
|
|
break;
|
|
break;
|
|
|
|
|
|
case MMC_POWER_UP:
|
|
case MMC_POWER_UP:
|
|
if (host->global_pwr_gpiod)
|
|
if (host->global_pwr_gpiod)
|
|
host->set_shared_power(host, 1);
|
|
host->set_shared_power(host, 1);
|
|
- else
|
|
|
|
|
|
+ else if (!IS_ERR(mmc->supply.vmmc))
|
|
mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd);
|
|
mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -968,20 +968,15 @@ static int cvm_mmc_of_parse(struct device *dev, struct cvm_mmc_slot *slot)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
|
|
|
|
- mmc->supply.vmmc = devm_regulator_get_optional(dev, "vmmc");
|
|
|
|
- if (IS_ERR(mmc->supply.vmmc)) {
|
|
|
|
- if (PTR_ERR(mmc->supply.vmmc) == -EPROBE_DEFER)
|
|
|
|
- return -EPROBE_DEFER;
|
|
|
|
- /*
|
|
|
|
- * Legacy Octeon firmware has no regulator entry, fall-back to
|
|
|
|
- * a hard-coded voltage to get a sane OCR.
|
|
|
|
- */
|
|
|
|
|
|
+ ret = mmc_regulator_get_supply(mmc);
|
|
|
|
+ if (ret == -EPROBE_DEFER)
|
|
|
|
+ return ret;
|
|
|
|
+ /*
|
|
|
|
+ * Legacy Octeon firmware has no regulator entry, fall-back to
|
|
|
|
+ * a hard-coded voltage to get a sane OCR.
|
|
|
|
+ */
|
|
|
|
+ if (IS_ERR(mmc->supply.vmmc))
|
|
mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
|
|
mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
|
|
- } else {
|
|
|
|
- ret = mmc_regulator_get_ocrmask(mmc->supply.vmmc);
|
|
|
|
- if (ret > 0)
|
|
|
|
- mmc->ocr_avail = ret;
|
|
|
|
- }
|
|
|
|
|
|
|
|
/* Common MMC bindings */
|
|
/* Common MMC bindings */
|
|
ret = mmc_of_parse(mmc);
|
|
ret = mmc_of_parse(mmc);
|