You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
regulator: Report actual configured voltage to set_voltage()
Change the interface used by set_voltage() to report the selected value to the regulator core in terms of a selector used by list_voltage(). This allows the regulator core to know the voltage that was chosen without having to do an explict get_voltage(), which would be much more expensive as it will generally access hardware. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
This commit is contained in:
committed by
Liam Girdwood
parent
63cee94614
commit
3a93f2a9f4
@@ -101,7 +101,7 @@ static int wm8994_ldo1_get_voltage(struct regulator_dev *rdev)
|
||||
}
|
||||
|
||||
static int wm8994_ldo1_set_voltage(struct regulator_dev *rdev,
|
||||
int min_uV, int max_uV)
|
||||
int min_uV, int max_uV, unsigned *s)
|
||||
{
|
||||
struct wm8994_ldo *ldo = rdev_get_drvdata(rdev);
|
||||
int selector, v;
|
||||
@@ -111,6 +111,7 @@ static int wm8994_ldo1_set_voltage(struct regulator_dev *rdev,
|
||||
if (v < 0 || v > max_uV)
|
||||
return -EINVAL;
|
||||
|
||||
*s = selector;
|
||||
selector <<= WM8994_LDO1_VSEL_SHIFT;
|
||||
|
||||
return wm8994_set_bits(ldo->wm8994, WM8994_LDO_1,
|
||||
@@ -152,7 +153,7 @@ static int wm8994_ldo2_get_voltage(struct regulator_dev *rdev)
|
||||
}
|
||||
|
||||
static int wm8994_ldo2_set_voltage(struct regulator_dev *rdev,
|
||||
int min_uV, int max_uV)
|
||||
int min_uV, int max_uV, unsigned *s)
|
||||
{
|
||||
struct wm8994_ldo *ldo = rdev_get_drvdata(rdev);
|
||||
int selector, v;
|
||||
@@ -162,6 +163,7 @@ static int wm8994_ldo2_set_voltage(struct regulator_dev *rdev,
|
||||
if (v < 0 || v > max_uV)
|
||||
return -EINVAL;
|
||||
|
||||
*s = selector;
|
||||
selector <<= WM8994_LDO2_VSEL_SHIFT;
|
||||
|
||||
return wm8994_set_bits(ldo->wm8994, WM8994_LDO_2,
|
||||
|
||||
Reference in New Issue
Block a user