diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-12-10 12:28:08 -0500 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2011-01-12 09:33:02 -0500 |
commit | afb8bb805bb9336ec1f7b74e7b5c0e9baceb42c1 (patch) | |
tree | ac5dd878db9a4253ebfcd811523165793af62008 | |
parent | 476c2d83c7ffb2429b2a504fbdb4326fc8a9d0e8 (diff) |
regulator: Convert WM831x drivers 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/wm831x-dcdc.c | 14 | ||||
-rw-r--r-- | drivers/regulator/wm831x-ldo.c | 18 |
2 files changed, 16 insertions, 16 deletions
diff --git a/drivers/regulator/wm831x-dcdc.c b/drivers/regulator/wm831x-dcdc.c index 71da6b2ad863..8b0d2c4bde91 100644 --- a/drivers/regulator/wm831x-dcdc.c +++ b/drivers/regulator/wm831x-dcdc.c | |||
@@ -377,14 +377,14 @@ static int wm831x_buckv_set_suspend_voltage(struct regulator_dev *rdev, | |||
377 | return wm831x_set_bits(wm831x, reg, WM831X_DC1_SLP_VSEL_MASK, vsel); | 377 | return wm831x_set_bits(wm831x, reg, WM831X_DC1_SLP_VSEL_MASK, vsel); |
378 | } | 378 | } |
379 | 379 | ||
380 | static int wm831x_buckv_get_voltage(struct regulator_dev *rdev) | 380 | static int wm831x_buckv_get_voltage_sel(struct regulator_dev *rdev) |
381 | { | 381 | { |
382 | struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev); | 382 | struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev); |
383 | 383 | ||
384 | if (dcdc->dvs_gpio && dcdc->dvs_gpio_state) | 384 | if (dcdc->dvs_gpio && dcdc->dvs_gpio_state) |
385 | return wm831x_buckv_list_voltage(rdev, dcdc->dvs_vsel); | 385 | return dcdc->dvs_vsel; |
386 | else | 386 | else |
387 | return wm831x_buckv_list_voltage(rdev, dcdc->on_vsel); | 387 | return dcdc->on_vsel; |
388 | } | 388 | } |
389 | 389 | ||
390 | /* Current limit options */ | 390 | /* Current limit options */ |
@@ -426,7 +426,7 @@ static int wm831x_buckv_get_current_limit(struct regulator_dev *rdev) | |||
426 | 426 | ||
427 | static struct regulator_ops wm831x_buckv_ops = { | 427 | static struct regulator_ops wm831x_buckv_ops = { |
428 | .set_voltage = wm831x_buckv_set_voltage, | 428 | .set_voltage = wm831x_buckv_set_voltage, |
429 | .get_voltage = wm831x_buckv_get_voltage, | 429 | .get_voltage_sel = wm831x_buckv_get_voltage_sel, |
430 | .list_voltage = wm831x_buckv_list_voltage, | 430 | .list_voltage = wm831x_buckv_list_voltage, |
431 | .set_suspend_voltage = wm831x_buckv_set_suspend_voltage, | 431 | .set_suspend_voltage = wm831x_buckv_set_suspend_voltage, |
432 | .set_current_limit = wm831x_buckv_set_current_limit, | 432 | .set_current_limit = wm831x_buckv_set_current_limit, |
@@ -678,7 +678,7 @@ static int wm831x_buckp_set_suspend_voltage(struct regulator_dev *rdev, | |||
678 | return wm831x_buckp_set_voltage_int(rdev, reg, uV, uV, &selector); | 678 | return wm831x_buckp_set_voltage_int(rdev, reg, uV, uV, &selector); |
679 | } | 679 | } |
680 | 680 | ||
681 | static int wm831x_buckp_get_voltage(struct regulator_dev *rdev) | 681 | static int wm831x_buckp_get_voltage_sel(struct regulator_dev *rdev) |
682 | { | 682 | { |
683 | struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev); | 683 | struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev); |
684 | struct wm831x *wm831x = dcdc->wm831x; | 684 | struct wm831x *wm831x = dcdc->wm831x; |
@@ -689,12 +689,12 @@ static int wm831x_buckp_get_voltage(struct regulator_dev *rdev) | |||
689 | if (val < 0) | 689 | if (val < 0) |
690 | return val; | 690 | return val; |
691 | 691 | ||
692 | return wm831x_buckp_list_voltage(rdev, val & WM831X_DC3_ON_VSEL_MASK); | 692 | return val & WM831X_DC3_ON_VSEL_MASK; |
693 | } | 693 | } |
694 | 694 | ||
695 | static struct regulator_ops wm831x_buckp_ops = { | 695 | static struct regulator_ops wm831x_buckp_ops = { |
696 | .set_voltage = wm831x_buckp_set_voltage, | 696 | .set_voltage = wm831x_buckp_set_voltage, |
697 | .get_voltage = wm831x_buckp_get_voltage, | 697 | .get_voltage_sel = wm831x_buckp_get_voltage_sel, |
698 | .list_voltage = wm831x_buckp_list_voltage, | 698 | .list_voltage = wm831x_buckp_list_voltage, |
699 | .set_suspend_voltage = wm831x_buckp_set_suspend_voltage, | 699 | .set_suspend_voltage = wm831x_buckp_set_suspend_voltage, |
700 | 700 | ||
diff --git a/drivers/regulator/wm831x-ldo.c b/drivers/regulator/wm831x-ldo.c index 9594e7161b4d..c94fc5b7cd5b 100644 --- a/drivers/regulator/wm831x-ldo.c +++ b/drivers/regulator/wm831x-ldo.c | |||
@@ -160,7 +160,7 @@ static int wm831x_gp_ldo_set_suspend_voltage(struct regulator_dev *rdev, | |||
160 | return wm831x_gp_ldo_set_voltage_int(rdev, reg, uV, uV, &selector); | 160 | return wm831x_gp_ldo_set_voltage_int(rdev, reg, uV, uV, &selector); |
161 | } | 161 | } |
162 | 162 | ||
163 | static int wm831x_gp_ldo_get_voltage(struct regulator_dev *rdev) | 163 | static int wm831x_gp_ldo_get_voltage_sel(struct regulator_dev *rdev) |
164 | { | 164 | { |
165 | struct wm831x_ldo *ldo = rdev_get_drvdata(rdev); | 165 | struct wm831x_ldo *ldo = rdev_get_drvdata(rdev); |
166 | struct wm831x *wm831x = ldo->wm831x; | 166 | struct wm831x *wm831x = ldo->wm831x; |
@@ -173,7 +173,7 @@ static int wm831x_gp_ldo_get_voltage(struct regulator_dev *rdev) | |||
173 | 173 | ||
174 | ret &= WM831X_LDO1_ON_VSEL_MASK; | 174 | ret &= WM831X_LDO1_ON_VSEL_MASK; |
175 | 175 | ||
176 | return wm831x_gp_ldo_list_voltage(rdev, ret); | 176 | return ret; |
177 | } | 177 | } |
178 | 178 | ||
179 | static unsigned int wm831x_gp_ldo_get_mode(struct regulator_dev *rdev) | 179 | static unsigned int wm831x_gp_ldo_get_mode(struct regulator_dev *rdev) |
@@ -293,7 +293,7 @@ static unsigned int wm831x_gp_ldo_get_optimum_mode(struct regulator_dev *rdev, | |||
293 | 293 | ||
294 | static struct regulator_ops wm831x_gp_ldo_ops = { | 294 | static struct regulator_ops wm831x_gp_ldo_ops = { |
295 | .list_voltage = wm831x_gp_ldo_list_voltage, | 295 | .list_voltage = wm831x_gp_ldo_list_voltage, |
296 | .get_voltage = wm831x_gp_ldo_get_voltage, | 296 | .get_voltage_sel = wm831x_gp_ldo_get_voltage_sel, |
297 | .set_voltage = wm831x_gp_ldo_set_voltage, | 297 | .set_voltage = wm831x_gp_ldo_set_voltage, |
298 | .set_suspend_voltage = wm831x_gp_ldo_set_suspend_voltage, | 298 | .set_suspend_voltage = wm831x_gp_ldo_set_suspend_voltage, |
299 | .get_mode = wm831x_gp_ldo_get_mode, | 299 | .get_mode = wm831x_gp_ldo_get_mode, |
@@ -465,7 +465,7 @@ static int wm831x_aldo_set_suspend_voltage(struct regulator_dev *rdev, | |||
465 | return wm831x_aldo_set_voltage_int(rdev, reg, uV, uV, &selector); | 465 | return wm831x_aldo_set_voltage_int(rdev, reg, uV, uV, &selector); |
466 | } | 466 | } |
467 | 467 | ||
468 | static int wm831x_aldo_get_voltage(struct regulator_dev *rdev) | 468 | static int wm831x_aldo_get_voltage_sel(struct regulator_dev *rdev) |
469 | { | 469 | { |
470 | struct wm831x_ldo *ldo = rdev_get_drvdata(rdev); | 470 | struct wm831x_ldo *ldo = rdev_get_drvdata(rdev); |
471 | struct wm831x *wm831x = ldo->wm831x; | 471 | struct wm831x *wm831x = ldo->wm831x; |
@@ -478,7 +478,7 @@ static int wm831x_aldo_get_voltage(struct regulator_dev *rdev) | |||
478 | 478 | ||
479 | ret &= WM831X_LDO7_ON_VSEL_MASK; | 479 | ret &= WM831X_LDO7_ON_VSEL_MASK; |
480 | 480 | ||
481 | return wm831x_aldo_list_voltage(rdev, ret); | 481 | return ret; |
482 | } | 482 | } |
483 | 483 | ||
484 | static unsigned int wm831x_aldo_get_mode(struct regulator_dev *rdev) | 484 | static unsigned int wm831x_aldo_get_mode(struct regulator_dev *rdev) |
@@ -559,7 +559,7 @@ static int wm831x_aldo_get_status(struct regulator_dev *rdev) | |||
559 | 559 | ||
560 | static struct regulator_ops wm831x_aldo_ops = { | 560 | static struct regulator_ops wm831x_aldo_ops = { |
561 | .list_voltage = wm831x_aldo_list_voltage, | 561 | .list_voltage = wm831x_aldo_list_voltage, |
562 | .get_voltage = wm831x_aldo_get_voltage, | 562 | .get_voltage_sel = wm831x_aldo_get_voltage_sel, |
563 | .set_voltage = wm831x_aldo_set_voltage, | 563 | .set_voltage = wm831x_aldo_set_voltage, |
564 | .set_suspend_voltage = wm831x_aldo_set_suspend_voltage, | 564 | .set_suspend_voltage = wm831x_aldo_set_suspend_voltage, |
565 | .get_mode = wm831x_aldo_get_mode, | 565 | .get_mode = wm831x_aldo_get_mode, |
@@ -718,7 +718,7 @@ static int wm831x_alive_ldo_set_suspend_voltage(struct regulator_dev *rdev, | |||
718 | return wm831x_alive_ldo_set_voltage_int(rdev, reg, uV, uV, &selector); | 718 | return wm831x_alive_ldo_set_voltage_int(rdev, reg, uV, uV, &selector); |
719 | } | 719 | } |
720 | 720 | ||
721 | static int wm831x_alive_ldo_get_voltage(struct regulator_dev *rdev) | 721 | static int wm831x_alive_ldo_get_voltage_sel(struct regulator_dev *rdev) |
722 | { | 722 | { |
723 | struct wm831x_ldo *ldo = rdev_get_drvdata(rdev); | 723 | struct wm831x_ldo *ldo = rdev_get_drvdata(rdev); |
724 | struct wm831x *wm831x = ldo->wm831x; | 724 | struct wm831x *wm831x = ldo->wm831x; |
@@ -731,7 +731,7 @@ static int wm831x_alive_ldo_get_voltage(struct regulator_dev *rdev) | |||
731 | 731 | ||
732 | ret &= WM831X_LDO11_ON_VSEL_MASK; | 732 | ret &= WM831X_LDO11_ON_VSEL_MASK; |
733 | 733 | ||
734 | return wm831x_alive_ldo_list_voltage(rdev, ret); | 734 | return ret; |
735 | } | 735 | } |
736 | 736 | ||
737 | static int wm831x_alive_ldo_get_status(struct regulator_dev *rdev) | 737 | static int wm831x_alive_ldo_get_status(struct regulator_dev *rdev) |
@@ -753,7 +753,7 @@ static int wm831x_alive_ldo_get_status(struct regulator_dev *rdev) | |||
753 | 753 | ||
754 | static struct regulator_ops wm831x_alive_ldo_ops = { | 754 | static struct regulator_ops wm831x_alive_ldo_ops = { |
755 | .list_voltage = wm831x_alive_ldo_list_voltage, | 755 | .list_voltage = wm831x_alive_ldo_list_voltage, |
756 | .get_voltage = wm831x_alive_ldo_get_voltage, | 756 | .get_voltage_sel = wm831x_alive_ldo_get_voltage_sel, |
757 | .set_voltage = wm831x_alive_ldo_set_voltage, | 757 | .set_voltage = wm831x_alive_ldo_set_voltage, |
758 | .set_suspend_voltage = wm831x_alive_ldo_set_suspend_voltage, | 758 | .set_suspend_voltage = wm831x_alive_ldo_set_suspend_voltage, |
759 | .get_status = wm831x_alive_ldo_get_status, | 759 | .get_status = wm831x_alive_ldo_get_status, |