diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-06-13 08:27:14 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-06-17 15:59:48 -0400 |
commit | c70ad9dcf08c839b018d8c440bd8c19aabbb08a8 (patch) | |
tree | cb090af9e2b070eb57efd3cfae3567d070bb78a6 /drivers/regulator/wm831x-dcdc.c | |
parent | ec0ab07587f0d2af208366158f5fd487311f1c56 (diff) |
regulator: wm831x-dcdc: Convert wm831x_buckp_ops to regulator_list_voltage_linear
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/wm831x-dcdc.c')
-rw-r--r-- | drivers/regulator/wm831x-dcdc.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/regulator/wm831x-dcdc.c b/drivers/regulator/wm831x-dcdc.c index 099da11e989..fbcff56e011 100644 --- a/drivers/regulator/wm831x-dcdc.c +++ b/drivers/regulator/wm831x-dcdc.c | |||
@@ -599,15 +599,6 @@ static struct platform_driver wm831x_buckv_driver = { | |||
599 | * BUCKP specifics | 599 | * BUCKP specifics |
600 | */ | 600 | */ |
601 | 601 | ||
602 | static int wm831x_buckp_list_voltage(struct regulator_dev *rdev, | ||
603 | unsigned selector) | ||
604 | { | ||
605 | if (selector <= WM831X_BUCKP_MAX_SELECTOR) | ||
606 | return 850000 + (selector * 25000); | ||
607 | else | ||
608 | return -EINVAL; | ||
609 | } | ||
610 | |||
611 | static int wm831x_buckp_set_voltage_int(struct regulator_dev *rdev, int reg, | 602 | static int wm831x_buckp_set_voltage_int(struct regulator_dev *rdev, int reg, |
612 | int min_uV, int max_uV, int *selector) | 603 | int min_uV, int max_uV, int *selector) |
613 | { | 604 | { |
@@ -620,7 +611,7 @@ static int wm831x_buckp_set_voltage_int(struct regulator_dev *rdev, int reg, | |||
620 | else | 611 | else |
621 | return -EINVAL; | 612 | return -EINVAL; |
622 | 613 | ||
623 | if (wm831x_buckp_list_voltage(rdev, vsel) > max_uV) | 614 | if (regulator_list_voltage_linear(rdev, vsel) > max_uV) |
624 | return -EINVAL; | 615 | return -EINVAL; |
625 | 616 | ||
626 | *selector = vsel; | 617 | *selector = vsel; |
@@ -652,7 +643,7 @@ static int wm831x_buckp_set_suspend_voltage(struct regulator_dev *rdev, | |||
652 | static struct regulator_ops wm831x_buckp_ops = { | 643 | static struct regulator_ops wm831x_buckp_ops = { |
653 | .set_voltage = wm831x_buckp_set_voltage, | 644 | .set_voltage = wm831x_buckp_set_voltage, |
654 | .get_voltage_sel = regulator_get_voltage_sel_regmap, | 645 | .get_voltage_sel = regulator_get_voltage_sel_regmap, |
655 | .list_voltage = wm831x_buckp_list_voltage, | 646 | .list_voltage = regulator_list_voltage_linear, |
656 | .set_suspend_voltage = wm831x_buckp_set_suspend_voltage, | 647 | .set_suspend_voltage = wm831x_buckp_set_suspend_voltage, |
657 | 648 | ||
658 | .is_enabled = regulator_is_enabled_regmap, | 649 | .is_enabled = regulator_is_enabled_regmap, |
@@ -715,6 +706,8 @@ static __devinit int wm831x_buckp_probe(struct platform_device *pdev) | |||
715 | dcdc->desc.vsel_mask = WM831X_DC3_ON_VSEL_MASK; | 706 | dcdc->desc.vsel_mask = WM831X_DC3_ON_VSEL_MASK; |
716 | dcdc->desc.enable_reg = WM831X_DCDC_ENABLE; | 707 | dcdc->desc.enable_reg = WM831X_DCDC_ENABLE; |
717 | dcdc->desc.enable_mask = 1 << id; | 708 | dcdc->desc.enable_mask = 1 << id; |
709 | dcdc->desc.min_uV = 850000; | ||
710 | dcdc->desc.uV_step = 25000; | ||
718 | 711 | ||
719 | config.dev = pdev->dev.parent; | 712 | config.dev = pdev->dev.parent; |
720 | if (pdata) | 713 | if (pdata) |