aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2010-12-12 09:06:51 -0500
committerLiam Girdwood <lrg@slimlogic.co.uk>2011-01-12 09:33:04 -0500
commitc24516a1d674b1d9d847fd736feca444bc249b12 (patch)
tree87ac81c0e7999073c4c204a0e75e9104a6828705
parent4d7071f1fdc9c27e15e8aaede27bef9f4feccafe (diff)
regulator: Convert WM835x to use get_voltage_sel()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
-rw-r--r--drivers/regulator/wm8350-regulator.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c
index 7e45b0ddd710..1bcb22c44095 100644
--- a/drivers/regulator/wm8350-regulator.c
+++ b/drivers/regulator/wm8350-regulator.c
@@ -405,11 +405,10 @@ static int wm8350_dcdc_set_voltage(struct regulator_dev *rdev, int min_uV,
405 return 0; 405 return 0;
406} 406}
407 407
408static int wm8350_dcdc_get_voltage(struct regulator_dev *rdev) 408static int wm8350_dcdc_get_voltage_sel(struct regulator_dev *rdev)
409{ 409{
410 struct wm8350 *wm8350 = rdev_get_drvdata(rdev); 410 struct wm8350 *wm8350 = rdev_get_drvdata(rdev);
411 int volt_reg, dcdc = rdev_get_id(rdev); 411 int volt_reg, dcdc = rdev_get_id(rdev);
412 u16 val;
413 412
414 switch (dcdc) { 413 switch (dcdc) {
415 case WM8350_DCDC_1: 414 case WM8350_DCDC_1:
@@ -431,8 +430,7 @@ static int wm8350_dcdc_get_voltage(struct regulator_dev *rdev)
431 } 430 }
432 431
433 /* all DCDCs have same mV bits */ 432 /* all DCDCs have same mV bits */
434 val = wm8350_reg_read(wm8350, volt_reg) & WM8350_DC1_VSEL_MASK; 433 return wm8350_reg_read(wm8350, volt_reg) & WM8350_DC1_VSEL_MASK;
435 return wm8350_dcdc_val_to_mvolts(val) * 1000;
436} 434}
437 435
438static int wm8350_dcdc_list_voltage(struct regulator_dev *rdev, 436static int wm8350_dcdc_list_voltage(struct regulator_dev *rdev,
@@ -807,11 +805,10 @@ static int wm8350_ldo_set_voltage(struct regulator_dev *rdev, int min_uV,
807 return 0; 805 return 0;
808} 806}
809 807
810static int wm8350_ldo_get_voltage(struct regulator_dev *rdev) 808static int wm8350_ldo_get_voltage_sel(struct regulator_dev *rdev)
811{ 809{
812 struct wm8350 *wm8350 = rdev_get_drvdata(rdev); 810 struct wm8350 *wm8350 = rdev_get_drvdata(rdev);
813 int volt_reg, ldo = rdev_get_id(rdev); 811 int volt_reg, ldo = rdev_get_id(rdev);
814 u16 val;
815 812
816 switch (ldo) { 813 switch (ldo) {
817 case WM8350_LDO_1: 814 case WM8350_LDO_1:
@@ -831,8 +828,7 @@ static int wm8350_ldo_get_voltage(struct regulator_dev *rdev)
831 } 828 }
832 829
833 /* all LDOs have same mV bits */ 830 /* all LDOs have same mV bits */
834 val = wm8350_reg_read(wm8350, volt_reg) & WM8350_LDO1_VSEL_MASK; 831 return wm8350_reg_read(wm8350, volt_reg) & WM8350_LDO1_VSEL_MASK;
835 return wm8350_ldo_val_to_mvolts(val) * 1000;
836} 832}
837 833
838static int wm8350_ldo_list_voltage(struct regulator_dev *rdev, 834static int wm8350_ldo_list_voltage(struct regulator_dev *rdev,
@@ -1229,7 +1225,7 @@ static int wm8350_ldo_is_enabled(struct regulator_dev *rdev)
1229 1225
1230static struct regulator_ops wm8350_dcdc_ops = { 1226static struct regulator_ops wm8350_dcdc_ops = {
1231 .set_voltage = wm8350_dcdc_set_voltage, 1227 .set_voltage = wm8350_dcdc_set_voltage,
1232 .get_voltage = wm8350_dcdc_get_voltage, 1228 .get_voltage_sel = wm8350_dcdc_get_voltage_sel,
1233 .list_voltage = wm8350_dcdc_list_voltage, 1229 .list_voltage = wm8350_dcdc_list_voltage,
1234 .enable = wm8350_dcdc_enable, 1230 .enable = wm8350_dcdc_enable,
1235 .disable = wm8350_dcdc_disable, 1231 .disable = wm8350_dcdc_disable,
@@ -1253,7 +1249,7 @@ static struct regulator_ops wm8350_dcdc2_5_ops = {
1253 1249
1254static struct regulator_ops wm8350_ldo_ops = { 1250static struct regulator_ops wm8350_ldo_ops = {
1255 .set_voltage = wm8350_ldo_set_voltage, 1251 .set_voltage = wm8350_ldo_set_voltage,
1256 .get_voltage = wm8350_ldo_get_voltage, 1252 .get_voltage_sel = wm8350_ldo_get_voltage_sel,
1257 .list_voltage = wm8350_ldo_list_voltage, 1253 .list_voltage = wm8350_ldo_list_voltage,
1258 .enable = wm8350_ldo_enable, 1254 .enable = wm8350_ldo_enable,
1259 .disable = wm8350_ldo_disable, 1255 .disable = wm8350_ldo_disable,