diff options
| author | Kamal Wadhwa <kamal.wadhwa@oss.qualcomm.com> | 2026-07-20 21:25:17 +0530 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-07-21 22:35:08 +0100 |
| commit | a45cc646a3aa83eb4ab4c7ed2685785ea51dc5e6 (patch) | |
| tree | 59878c020e329c0cd7716f1ad0f5abae7de2bed6 /scripts/stackdelta | |
| parent | 1d26f125501f3fbe6c259ab75bf6516299a0bf0e (diff) | |
regulator: core: clamp voltage constraints before applying apply_uV
machine_constraints_voltage() currently applies apply_uV against the
machine-supplied [min_uV, max_uV] range, and only afterwards clamps
that range down to what the regulator can actually supply (via
ops->list_voltage()).
If the machine-supplied range is wider than the regulator's actual
range, apply_uV's rounding can pick a selector outside the (correct)
clamped range, so the regulator ends up programmed outside its clamped
min/max. At bring-up this shows up as a voltage read-back outside the
clamped range.
Fix this by moving the clamping block ahead of the apply_uV block, so
apply_uV always targets an already-clamped range. Whether apply_uV
should run is decided from the unclamped constraints beforehand and
stored in a local bool, since clamping must not itself change whether
apply_uV fires.
No functional change to the clamping logic itself, only its position
relative to apply_uV. Its early return 0 exits become fallthroughs
since the apply_uV logic now follows it.
Assisted-by: Claude:claude-sonnet-5
Signed-off-by: Kamal Wadhwa <kamal.wadhwa@oss.qualcomm.com>
Link: https://patch.msgid.link/20260720-b4-regulator-core-clamp-voltage-v1-1-8e5eec076a8e@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'scripts/stackdelta')
0 files changed, 0 insertions, 0 deletions
