[RFC PATCH 1/9] drivers: regulator: qcom_spmi: enable linear range info

From: Niklas Cassel
Date: Thu Apr 04 2019 - 01:10:02 EST


From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@xxxxxxxxxx>

Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@xxxxxxxxxx>
---
drivers/regulator/qcom_spmi-regulator.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/drivers/regulator/qcom_spmi-regulator.c b/drivers/regulator/qcom_spmi-regulator.c
index 3193506eac6f..f2edf510b0df 100644
--- a/drivers/regulator/qcom_spmi-regulator.c
+++ b/drivers/regulator/qcom_spmi-regulator.c
@@ -1907,6 +1907,7 @@ MODULE_DEVICE_TABLE(of, qcom_spmi_regulator_match);
static int qcom_spmi_regulator_probe(struct platform_device *pdev)
{
const struct spmi_regulator_data *reg;
+ const struct spmi_voltage_range *range;
const struct of_device_id *match;
struct regulator_config config = { };
struct regulator_dev *rdev;
@@ -1996,6 +1997,12 @@ static int qcom_spmi_regulator_probe(struct platform_device *pdev)
}
}

+ if (vreg->logical_type == SPMI_REGULATOR_LOGICAL_TYPE_HFS430) {
+ /* since there is only one range */
+ range = spmi_regulator_find_range(vreg);
+ vreg->desc.uV_step = range->step_uV;
+ }
+
config.dev = dev;
config.driver_data = vreg;
config.regmap = regmap;
--
2.20.1