regulator: core: Add support for disabling ramp delay
Some hardwares support disabling ramp delay, so adding ramp_disable flag to constraints. It will be used to figure out whether ramp_delay in constraints is explicitly set to zero or its unintialized (zero by default). And we don't need to call set_voltage_time_sel() for regulators for whom ramp delay is disabled in constraints. Signed-off-by: Yadwinder Singh Brar <yadi.brar@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
committed by
Mark Brown
parent
ad81f0545e
commit
1653ccf4c5
@ -984,7 +984,8 @@ static int set_machine_constraints(struct regulator_dev *rdev,
|
||||
}
|
||||
}
|
||||
|
||||
if (rdev->constraints->ramp_delay && ops->set_ramp_delay) {
|
||||
if ((rdev->constraints->ramp_delay || rdev->constraints->ramp_disable)
|
||||
&& ops->set_ramp_delay) {
|
||||
ret = ops->set_ramp_delay(rdev, rdev->constraints->ramp_delay);
|
||||
if (ret < 0) {
|
||||
rdev_err(rdev, "failed to set ramp_delay\n");
|
||||
@ -2438,7 +2439,8 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev,
|
||||
}
|
||||
|
||||
/* Call set_voltage_time_sel if successfully obtained old_selector */
|
||||
if (ret == 0 && _regulator_is_enabled(rdev) && old_selector >= 0 &&
|
||||
if (ret == 0 && !rdev->constraints->ramp_disable &&
|
||||
_regulator_is_enabled(rdev) && old_selector >= 0 &&
|
||||
old_selector != selector && rdev->desc->ops->set_voltage_time_sel) {
|
||||
|
||||
delay = rdev->desc->ops->set_voltage_time_sel(rdev,
|
||||
|
Reference in New Issue
Block a user