diff options
author | Matthias Kaehlcke <mka@chromium.org> | 2017-05-16 11:43:43 -0700 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-05-17 10:49:25 +0100 |
commit | 3ffad468cf1d9825b425733941bdad0d8d20e795 (patch) | |
tree | 8132700ab118a649e9d002c36d941c6c509b5546 /drivers/regulator/core.c | |
parent | 543853de356b8ce95d6d99757501d9d5c916ca09 (diff) | |
download | linux-3ffad468cf1d9825b425733941bdad0d8d20e795.tar.gz linux-3ffad468cf1d9825b425733941bdad0d8d20e795.tar.xz |
regulator: Allow for asymmetric settling times
Some regulators have different settling times for voltage increases and
decreases. To avoid a time penalty on the faster transition allow for
different settings for up- and downward transitions.
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r-- | drivers/regulator/core.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index c0d9ae8d0860..919b7f178209 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -2767,6 +2767,12 @@ static int _regulator_set_voltage_time(struct regulator_dev *rdev, ramp_delay = rdev->desc->ramp_delay; else if (rdev->constraints->settling_time) return rdev->constraints->settling_time; + else if (rdev->constraints->settling_time_up && + (new_uV > old_uV)) + return rdev->constraints->settling_time_up; + else if (rdev->constraints->settling_time_down && + (new_uV < old_uV)) + return rdev->constraints->settling_time_down; if (ramp_delay == 0) { rdev_dbg(rdev, "ramp_delay not set\n"); |