diff options
author | Matthias Kaehlcke <mka@chromium.org> | 2016-09-14 09:52:08 -0700 |
---|---|---|
committer | Tao Huang <huangtao@rock-chips.com> | 2018-03-22 11:14:38 +0800 |
commit | 7256fb26c9279d10d5a5eeea6a8b399e7f51e413 (patch) | |
tree | f0392803a2853cb3260afad48632ed7aed9da7f3 /include | |
parent | d8b6c0af6972a5211e074f10163df37e65d971c6 (diff) |
UPSTREAM: regulator: core: Add set_voltage_time op
The new op is analogous to set_voltage_time_sel. It can be used by
regulators which don't have a table of discrete voltages. The function
returns the time for the regulator output voltage to stabilize after
being set to a new value, in microseconds. If the op is not set a
default implementation is used to calculate the delay.
This change also removes the ramp_delay calculation in the PWM
regulator, since the driver now uses the core code for the calculation
of the delay.
Change-Id: I401ace81648be8e8eab2e4bd3a0f41ed9766fae1
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 73e705bf81ceb84b39ef9cf6ffb8d12ca0c58a23)
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/regulator/driver.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index 02e98d28de6f..2f890c611ecb 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h @@ -110,10 +110,14 @@ struct regulator_linear_range { * stabilise after being enabled, in microseconds. * @set_ramp_delay: Set the ramp delay for the regulator. The driver should * select ramp delay equal to or less than(closest) ramp_delay. + * @set_voltage_time: Time taken for the regulator voltage output voltage + * to stabilise after being set to a new value, in microseconds. + * The function receives the from and to voltage as input, it + * should return the worst case. * @set_voltage_time_sel: Time taken for the regulator voltage output voltage * to stabilise after being set to a new value, in microseconds. - * The function provides the from and to voltage selector, the - * function should return the worst case. + * The function receives the from and to voltage selector as + * input, it should return the worst case. * @set_soft_start: Enable soft start for the regulator. * * @set_suspend_voltage: Set the voltage for the regulator when the system @@ -165,6 +169,8 @@ struct regulator_ops { /* Time taken to enable or set voltage on the regulator */ int (*enable_time) (struct regulator_dev *); int (*set_ramp_delay) (struct regulator_dev *, int ramp_delay); + int (*set_voltage_time) (struct regulator_dev *, int old_uV, + int new_uV); int (*set_voltage_time_sel) (struct regulator_dev *, unsigned int old_selector, unsigned int new_selector); |