mmc: msm_sdcc: Check if voltages can be set or not on a regulator
Use regulator framework to figure out if voltage can be set or not on a
regulator by software or if the regulator would be at a fixed voltage.
Change-Id: I1f67dbd7c2d16f998190341db3124b44593b1127
Signed-off-by: Krishna Konda <kkonda@codeaurora.org>
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index e639815..b0ec0e8 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -1716,7 +1716,12 @@
rc = PTR_ERR(vreg->reg);
pr_err("%s: regulator_get(%s) failed. rc=%d\n",
__func__, vreg->name, rc);
+ goto out;
}
+
+ if (regulator_count_voltages(vreg->reg) > 0)
+ vreg->set_voltage_sup = 1;
+
out:
return rc;
}