regulator: Fix machine constraints apply for min_uV != max_uV
PATCH 1/1 regulator: Fix machine constraints apply for min_uV != max_uV
Constraints are not applied until both min_uV and max_uV are the same. This looks like a typo in the test.
--- drivers/regulator/core.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/regulator/core.c +1 -1
@@ -724,7 +724,7 @@ static int machine_constraints_voltage(struct regulator_dev *rdev,/* do we need to apply the constraint voltage */ if (rdev->constraints->apply_uV && - rdev->constraints->min_uV == rdev->constraints->max_uV && + rdev->constraints->min_uV && rdev->constraints->max_uV && ops->set_voltage) { ret = ops->set_voltage (rdev, rdev->constraints->min_uV, rdev->constraints->max_uV);
Signature · 1 line
1.7.1
Quoted 4 lines · Jarkko Nikula
Constraints are not applied until both
min_uVandmax_uVare the same. This looks like a typo in the test.Signed-off-by Jarkko Nikula <[email protected]>
This is deliberate behaviour, apply_uV can only be used with a fixed voltage at startup in order to avoid issues with handover from the bootloader if we suddenly drop the supply voltage on a device which has not yet been claimed by a driver. The expectation is that if the voltage can vary then something that understands the hardware state needs to be involved in maintaining the voltage.
Quoted 6 lines · On Fri, 3 Sep 2010 15:54:20 +0100 Mark Brown…
This is deliberate behaviour,
apply_uVcan only be used with a fixed voltage at startup in order to avoid issues with handover from the bootloader if we suddenly drop the supply voltage on a device which has not yet been claimed by a driver. The expectation is that if the voltage can vary then something that understands the hardware state needs to be involved in maintaining the voltage.
Ah, true. It could be possible that machine constraints are specified broader, like they include standby state voltage which is not enough to probe & initialize the device etc.
Signature · 1 line
Jarkko