aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/pcap-regulator.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/regulator/pcap-regulator.c')
-rw-r--r--drivers/regulator/pcap-regulator.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/regulator/pcap-regulator.c b/drivers/regulator/pcap-regulator.c
index 29d0566379a..31f6e11a7f1 100644
--- a/drivers/regulator/pcap-regulator.c
+++ b/drivers/regulator/pcap-regulator.c
@@ -151,7 +151,8 @@ static struct pcap_regulator vreg_table[] = {
151}; 151};
152 152
153static int pcap_regulator_set_voltage(struct regulator_dev *rdev, 153static int pcap_regulator_set_voltage(struct regulator_dev *rdev,
154 int min_uV, int max_uV) 154 int min_uV, int max_uV,
155 unsigned *selector)
155{ 156{
156 struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)]; 157 struct pcap_regulator *vreg = &vreg_table[rdev_get_id(rdev)];
157 void *pcap = rdev_get_drvdata(rdev); 158 void *pcap = rdev_get_drvdata(rdev);
@@ -170,10 +171,12 @@ static int pcap_regulator_set_voltage(struct regulator_dev *rdev,
170 i = 0; 171 i = 0;
171 172
172 uV = vreg->voltage_table[i] * 1000; 173 uV = vreg->voltage_table[i] * 1000;
173 if (min_uV <= uV && uV <= max_uV) 174 if (min_uV <= uV && uV <= max_uV) {
175 *selector = i;
174 return ezx_pcap_set_bits(pcap, vreg->reg, 176 return ezx_pcap_set_bits(pcap, vreg->reg,
175 (vreg->n_voltages - 1) << vreg->index, 177 (vreg->n_voltages - 1) << vreg->index,
176 i << vreg->index); 178 i << vreg->index);
179 }
177 180
178 if (i == 0 && rdev_get_id(rdev) == V1) 181 if (i == 0 && rdev_get_id(rdev) == V1)
179 i = vreg->n_voltages - 1; 182 i = vreg->n_voltages - 1;