diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-03-23 21:38:30 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-04-01 06:59:30 -0400 |
commit | 44a7cdabf792028f88de5ecc2baf0c1a8207aa27 (patch) | |
tree | ca9a77f1c1e8340f30b7d49d64928db01bdb53c6 /drivers/regulator/tps6586x-regulator.c | |
parent | 4c60165dcb68f56e97b0a1b8f5233b3a486af353 (diff) |
regulator: Convert tps6586x to get_voltage_sel
This also fixes a bug, LDO0 has minimal voltage 1.2V rather than 1.25V.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/tps6586x-regulator.c')
-rw-r--r-- | drivers/regulator/tps6586x-regulator.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/regulator/tps6586x-regulator.c b/drivers/regulator/tps6586x-regulator.c index 29b615ce3aff..08fcd9d3557d 100644 --- a/drivers/regulator/tps6586x-regulator.c +++ b/drivers/regulator/tps6586x-regulator.c | |||
@@ -124,7 +124,7 @@ static int tps6586x_ldo_set_voltage(struct regulator_dev *rdev, | |||
124 | selector); | 124 | selector); |
125 | } | 125 | } |
126 | 126 | ||
127 | static int tps6586x_ldo_get_voltage(struct regulator_dev *rdev) | 127 | static int tps6586x_get_voltage_sel(struct regulator_dev *rdev) |
128 | { | 128 | { |
129 | struct tps6586x_regulator *ri = rdev_get_drvdata(rdev); | 129 | struct tps6586x_regulator *ri = rdev_get_drvdata(rdev); |
130 | struct device *parent = to_tps6586x_dev(rdev); | 130 | struct device *parent = to_tps6586x_dev(rdev); |
@@ -141,7 +141,7 @@ static int tps6586x_ldo_get_voltage(struct regulator_dev *rdev) | |||
141 | if (val >= ri->desc.n_voltages) | 141 | if (val >= ri->desc.n_voltages) |
142 | BUG(); | 142 | BUG(); |
143 | 143 | ||
144 | return ri->voltages[val] * 1000; | 144 | return val; |
145 | } | 145 | } |
146 | 146 | ||
147 | static int tps6586x_dvm_set_voltage(struct regulator_dev *rdev, | 147 | static int tps6586x_dvm_set_voltage(struct regulator_dev *rdev, |
@@ -193,7 +193,7 @@ static int tps6586x_regulator_is_enabled(struct regulator_dev *rdev) | |||
193 | 193 | ||
194 | static struct regulator_ops tps6586x_regulator_ldo_ops = { | 194 | static struct regulator_ops tps6586x_regulator_ldo_ops = { |
195 | .list_voltage = tps6586x_ldo_list_voltage, | 195 | .list_voltage = tps6586x_ldo_list_voltage, |
196 | .get_voltage = tps6586x_ldo_get_voltage, | 196 | .get_voltage_sel = tps6586x_get_voltage_sel, |
197 | .set_voltage = tps6586x_ldo_set_voltage, | 197 | .set_voltage = tps6586x_ldo_set_voltage, |
198 | 198 | ||
199 | .is_enabled = tps6586x_regulator_is_enabled, | 199 | .is_enabled = tps6586x_regulator_is_enabled, |
@@ -203,7 +203,7 @@ static struct regulator_ops tps6586x_regulator_ldo_ops = { | |||
203 | 203 | ||
204 | static struct regulator_ops tps6586x_regulator_dvm_ops = { | 204 | static struct regulator_ops tps6586x_regulator_dvm_ops = { |
205 | .list_voltage = tps6586x_ldo_list_voltage, | 205 | .list_voltage = tps6586x_ldo_list_voltage, |
206 | .get_voltage = tps6586x_ldo_get_voltage, | 206 | .get_voltage_sel = tps6586x_get_voltage_sel, |
207 | .set_voltage = tps6586x_dvm_set_voltage, | 207 | .set_voltage = tps6586x_dvm_set_voltage, |
208 | 208 | ||
209 | .is_enabled = tps6586x_regulator_is_enabled, | 209 | .is_enabled = tps6586x_regulator_is_enabled, |