Commit dd16b1f8e7814cad47e09951529facaba4350302
Committed by
Mark Brown
1 parent
4eb0645364
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
regulator: Convert twl4030ldo_set_voltage to set_voltage_sel
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Showing 1 changed file with 4 additions and 23 deletions Side-by-side Diff
drivers/regulator/twl-regulator.c
... | ... | @@ -473,31 +473,12 @@ |
473 | 473 | } |
474 | 474 | |
475 | 475 | static int |
476 | -twl4030ldo_set_voltage(struct regulator_dev *rdev, int min_uV, int max_uV, | |
477 | - unsigned *selector) | |
476 | +twl4030ldo_set_voltage_sel(struct regulator_dev *rdev, unsigned selector) | |
478 | 477 | { |
479 | 478 | struct twlreg_info *info = rdev_get_drvdata(rdev); |
480 | - int vsel; | |
481 | 479 | |
482 | - for (vsel = 0; vsel < info->table_len; vsel++) { | |
483 | - int mV = info->table[vsel]; | |
484 | - int uV; | |
485 | - | |
486 | - if (IS_UNSUP(mV)) | |
487 | - continue; | |
488 | - uV = LDO_MV(mV) * 1000; | |
489 | - | |
490 | - /* REVISIT for VAUX2, first match may not be best/lowest */ | |
491 | - | |
492 | - /* use the first in-range value */ | |
493 | - if (min_uV <= uV && uV <= max_uV) { | |
494 | - *selector = vsel; | |
495 | - return twlreg_write(info, TWL_MODULE_PM_RECEIVER, | |
496 | - VREG_VOLTAGE, vsel); | |
497 | - } | |
498 | - } | |
499 | - | |
500 | - return -EDOM; | |
480 | + return twlreg_write(info, TWL_MODULE_PM_RECEIVER, VREG_VOLTAGE, | |
481 | + selector); | |
501 | 482 | } |
502 | 483 | |
503 | 484 | static int twl4030ldo_get_voltage(struct regulator_dev *rdev) |
... | ... | @@ -516,7 +497,7 @@ |
516 | 497 | static struct regulator_ops twl4030ldo_ops = { |
517 | 498 | .list_voltage = twl4030ldo_list_voltage, |
518 | 499 | |
519 | - .set_voltage = twl4030ldo_set_voltage, | |
500 | + .set_voltage_sel = twl4030ldo_set_voltage_sel, | |
520 | 501 | .get_voltage = twl4030ldo_get_voltage, |
521 | 502 | |
522 | 503 | .enable = twl4030reg_enable, |