summaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorMikko Perttunen <mperttunen@nvidia.com>2015-07-28 10:34:11 +0200
committerMark Brown <broonie@kernel.org>2015-07-29 15:55:51 +0200
commitb10c7f3cc948107fb992d3a14eeaa0fdfb5c95da (patch)
tree13f1735df49cfcda47215ae08479564e0109b9e3 /drivers/regulator
parentregulator: max8973: add support to configure ETR based on rail load (diff)
downloadlinux-b10c7f3cc948107fb992d3a14eeaa0fdfb5c95da.tar.xz
linux-b10c7f3cc948107fb992d3a14eeaa0fdfb5c95da.zip
regulator: max8973: Set VSEL regmap ops if DVS GPIO is not set
Use regmap helpers for get_voltage_sel and set_voltage_sel ops if the DVS GPIO is not set. The DVS GPIO allows on the fly selection of the VSEL register from two choices. However, if it is not set, the VSEL register will stay fixed and we can use the regmap ops. This allows use of the *hardware_vsel* regulator APIs. Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/max8973-regulator.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/regulator/max8973-regulator.c b/drivers/regulator/max8973-regulator.c
index f67365962b67..8857cc02d9a8 100644
--- a/drivers/regulator/max8973-regulator.c
+++ b/drivers/regulator/max8973-regulator.c
@@ -637,6 +637,15 @@ static int max8973_probe(struct i2c_client *client,
max->lru_index[i] = i;
max->lru_index[0] = max->curr_vout_reg;
max->lru_index[max->curr_vout_reg] = 0;
+ } else {
+ /*
+ * If there is no DVS GPIO, the VOUT register
+ * address is fixed.
+ */
+ max->ops.set_voltage_sel = regulator_set_voltage_sel_regmap;
+ max->ops.get_voltage_sel = regulator_get_voltage_sel_regmap;
+ max->desc.vsel_reg = max->curr_vout_reg;
+ max->desc.vsel_mask = MAX8973_VOUT_MASK;
}
if (pdata_from_dt)