diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-12-12 09:07:06 -0500 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2011-01-12 09:33:04 -0500 |
commit | d9f0f287179f76ec71a50a96d553dfd1dbb41711 (patch) | |
tree | 0777971d53372d3f1c059322b577b2045d4ae84c /drivers/regulator | |
parent | c24516a1d674b1d9d847fd736feca444bc249b12 (diff) |
regulator: Convert WM8994 to use get_voltage_sel()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/wm8994-regulator.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/regulator/wm8994-regulator.c b/drivers/regulator/wm8994-regulator.c index 1b162e699368..594f88eb60c3 100644 --- a/drivers/regulator/wm8994-regulator.c +++ b/drivers/regulator/wm8994-regulator.c | |||
@@ -86,7 +86,7 @@ static int wm8994_ldo1_list_voltage(struct regulator_dev *rdev, | |||
86 | return (selector * 100000) + 2400000; | 86 | return (selector * 100000) + 2400000; |
87 | } | 87 | } |
88 | 88 | ||
89 | static int wm8994_ldo1_get_voltage(struct regulator_dev *rdev) | 89 | static int wm8994_ldo1_get_voltage_sel(struct regulator_dev *rdev) |
90 | { | 90 | { |
91 | struct wm8994_ldo *ldo = rdev_get_drvdata(rdev); | 91 | struct wm8994_ldo *ldo = rdev_get_drvdata(rdev); |
92 | int val; | 92 | int val; |
@@ -95,9 +95,7 @@ static int wm8994_ldo1_get_voltage(struct regulator_dev *rdev) | |||
95 | if (val < 0) | 95 | if (val < 0) |
96 | return val; | 96 | return val; |
97 | 97 | ||
98 | val = (val & WM8994_LDO1_VSEL_MASK) >> WM8994_LDO1_VSEL_SHIFT; | 98 | return (val & WM8994_LDO1_VSEL_MASK) >> WM8994_LDO1_VSEL_SHIFT; |
99 | |||
100 | return wm8994_ldo1_list_voltage(rdev, val); | ||
101 | } | 99 | } |
102 | 100 | ||
103 | static int wm8994_ldo1_set_voltage(struct regulator_dev *rdev, | 101 | static int wm8994_ldo1_set_voltage(struct regulator_dev *rdev, |
@@ -125,7 +123,7 @@ static struct regulator_ops wm8994_ldo1_ops = { | |||
125 | .enable_time = wm8994_ldo_enable_time, | 123 | .enable_time = wm8994_ldo_enable_time, |
126 | 124 | ||
127 | .list_voltage = wm8994_ldo1_list_voltage, | 125 | .list_voltage = wm8994_ldo1_list_voltage, |
128 | .get_voltage = wm8994_ldo1_get_voltage, | 126 | .get_voltage_sel = wm8994_ldo1_get_voltage_sel, |
129 | .set_voltage = wm8994_ldo1_set_voltage, | 127 | .set_voltage = wm8994_ldo1_set_voltage, |
130 | }; | 128 | }; |
131 | 129 | ||
@@ -138,7 +136,7 @@ static int wm8994_ldo2_list_voltage(struct regulator_dev *rdev, | |||
138 | return (selector * 100000) + 900000; | 136 | return (selector * 100000) + 900000; |
139 | } | 137 | } |
140 | 138 | ||
141 | static int wm8994_ldo2_get_voltage(struct regulator_dev *rdev) | 139 | static int wm8994_ldo2_get_voltage_sel(struct regulator_dev *rdev) |
142 | { | 140 | { |
143 | struct wm8994_ldo *ldo = rdev_get_drvdata(rdev); | 141 | struct wm8994_ldo *ldo = rdev_get_drvdata(rdev); |
144 | int val; | 142 | int val; |
@@ -147,9 +145,7 @@ static int wm8994_ldo2_get_voltage(struct regulator_dev *rdev) | |||
147 | if (val < 0) | 145 | if (val < 0) |
148 | return val; | 146 | return val; |
149 | 147 | ||
150 | val = (val & WM8994_LDO2_VSEL_MASK) >> WM8994_LDO2_VSEL_SHIFT; | 148 | return (val & WM8994_LDO2_VSEL_MASK) >> WM8994_LDO2_VSEL_SHIFT; |
151 | |||
152 | return wm8994_ldo2_list_voltage(rdev, val); | ||
153 | } | 149 | } |
154 | 150 | ||
155 | static int wm8994_ldo2_set_voltage(struct regulator_dev *rdev, | 151 | static int wm8994_ldo2_set_voltage(struct regulator_dev *rdev, |
@@ -177,7 +173,7 @@ static struct regulator_ops wm8994_ldo2_ops = { | |||
177 | .enable_time = wm8994_ldo_enable_time, | 173 | .enable_time = wm8994_ldo_enable_time, |
178 | 174 | ||
179 | .list_voltage = wm8994_ldo2_list_voltage, | 175 | .list_voltage = wm8994_ldo2_list_voltage, |
180 | .get_voltage = wm8994_ldo2_get_voltage, | 176 | .get_voltage_sel = wm8994_ldo2_get_voltage_sel, |
181 | .set_voltage = wm8994_ldo2_set_voltage, | 177 | .set_voltage = wm8994_ldo2_set_voltage, |
182 | }; | 178 | }; |
183 | 179 | ||