aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/ab8500-ext.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/regulator/ab8500-ext.c')
-rw-r--r--drivers/regulator/ab8500-ext.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/regulator/ab8500-ext.c b/drivers/regulator/ab8500-ext.c
index b4d45472aae6..e4975bc61e81 100644
--- a/drivers/regulator/ab8500-ext.c
+++ b/drivers/regulator/ab8500-ext.c
@@ -229,6 +229,28 @@ static unsigned int ab8500_ext_regulator_get_mode(struct regulator_dev *rdev)
229 return ret; 229 return ret;
230} 230}
231 231
232static int ab8500_ext_set_voltage(struct regulator_dev *rdev, int min_uV,
233 int max_uV, unsigned *selector)
234{
235 struct regulation_constraints *regu_constraints = rdev->constraints;
236
237 if (!regu_constraints) {
238 dev_err(rdev_get_dev(rdev), "No regulator constraints\n");
239 return -EINVAL;
240 }
241
242 if (regu_constraints->min_uV == min_uV &&
243 regu_constraints->max_uV == max_uV)
244 return 0;
245
246 dev_err(rdev_get_dev(rdev),
247 "Requested min %duV max %duV != constrained min %duV max %duV\n",
248 min_uV, max_uV,
249 regu_constraints->min_uV, regu_constraints->max_uV);
250
251 return -EINVAL;
252}
253
232static int ab8500_ext_list_voltage(struct regulator_dev *rdev, 254static int ab8500_ext_list_voltage(struct regulator_dev *rdev,
233 unsigned selector) 255 unsigned selector)
234{ 256{
@@ -252,6 +274,7 @@ static struct regulator_ops ab8500_ext_regulator_ops = {
252 .is_enabled = ab8500_ext_regulator_is_enabled, 274 .is_enabled = ab8500_ext_regulator_is_enabled,
253 .set_mode = ab8500_ext_regulator_set_mode, 275 .set_mode = ab8500_ext_regulator_set_mode,
254 .get_mode = ab8500_ext_regulator_get_mode, 276 .get_mode = ab8500_ext_regulator_get_mode,
277 .set_voltage = ab8500_ext_set_voltage,
255 .list_voltage = ab8500_ext_list_voltage, 278 .list_voltage = ab8500_ext_list_voltage,
256}; 279};
257 280