Kamal Wadhwa and Mark Brown
a45cc646a3
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 >
2026-07-21 22:35:08 +01:00
..
2026-06-02 16:09:24 +01:00
2026-06-02 16:09:23 +01:00
2025-06-22 01:39:51 +02:00
2026-04-09 20:19:34 +01:00
2025-02-06 11:27:24 +00:00
2026-07-03 07:38:17 +02:00
2024-11-12 13:08:35 +00:00
2025-11-17 00:14:20 +00:00
2025-03-19 12:28:26 +00:00
2025-05-22 10:57:46 +01:00
2026-06-02 16:09:24 +01:00
2026-06-02 16:09:24 +01:00
2026-06-02 16:09:24 +01:00
2026-06-02 16:09:24 +01:00
2026-07-03 07:38:17 +02:00
2026-06-02 16:09:24 +01:00
2026-06-04 16:59:39 +01:00
2026-07-21 22:35:08 +01:00
2026-02-26 18:55:37 +00:00
2026-03-23 22:38:55 +00:00
2024-09-10 12:40:38 +01:00
2024-09-10 12:44:03 +01:00
2024-09-10 12:44:04 +01:00
2026-03-12 23:16:17 +00:00
2026-06-24 12:56:37 +01:00
2024-05-27 01:32:50 +01:00
2024-09-09 18:27:02 +01:00
2024-11-12 13:08:35 +00:00
2026-03-30 15:44:06 +01:00
2026-01-12 16:23:16 +00:00
2025-06-16 13:26:23 +01:00
2026-02-21 17:09:51 -08:00
2026-03-23 16:19:53 +00:00
2026-03-17 18:07:36 +00:00
2025-07-03 12:22:35 +01:00
2024-09-13 14:57:08 +01:00
2026-06-02 16:09:25 +01:00
2026-06-02 16:09:25 +01:00
2026-06-02 16:09:25 +01:00
2026-06-02 16:09:25 +01:00
2024-09-30 01:11:41 +02:00
2025-11-07 09:37:49 +00:00
2024-09-30 01:11:42 +02:00
2024-03-25 00:48:18 +00:00
2026-06-16 07:50:31 +05:30
2026-06-02 16:09:24 +01:00
2024-05-27 01:32:50 +01:00
2024-05-27 01:32:50 +01:00
2024-05-27 01:32:50 +01:00
2024-03-06 14:03:32 +00:00
2026-06-02 16:09:24 +01:00
2026-07-16 16:19:07 +01:00
2026-05-28 15:52:44 +01:00
2024-05-27 01:32:50 +01:00
2024-10-10 12:16:58 +01:00
2024-05-27 01:32:50 +01:00
2024-05-27 01:32:50 +01:00
2024-05-27 01:32:50 +01:00
2024-09-13 14:57:07 +01:00
2026-06-02 16:09:23 +01:00
2026-06-02 16:09:24 +01:00
2026-06-02 16:09:24 +01:00
2025-06-08 23:29:48 +01:00
2026-03-05 19:03:51 +00:00
2024-05-29 11:24:22 +01:00
2026-07-03 07:38:17 +02:00
2026-06-02 16:09:25 +01:00
2026-04-09 20:19:32 +01:00
2026-07-03 07:38:17 +02:00
2026-06-02 16:09:23 +01:00
2026-06-02 16:09:24 +01:00
2026-06-02 16:09:23 +01:00
2024-09-10 12:44:11 +01:00
2025-09-15 19:27:50 +01:00
2024-08-01 12:50:10 +01:00
2024-08-13 12:41:44 +01:00
2025-06-30 16:06:40 +01:00
2024-09-09 18:27:01 +01:00
2024-02-26 13:46:55 +00:00
2024-05-27 01:32:50 +01:00
2026-03-30 15:45:37 +01:00
2026-07-08 19:31:41 +01:00
2026-06-02 16:09:23 +01:00
2026-06-02 16:09:23 +01:00
2026-06-02 16:09:23 +01:00
2026-06-02 16:09:24 +01:00
2026-07-20 17:32:39 +01:00
2026-06-09 19:00:42 +01:00
2026-06-02 16:09:23 +01:00
2026-07-08 19:32:24 +01:00
2026-07-03 07:38:17 +02:00
2026-06-02 16:09:23 +01:00
2026-06-02 16:09:23 +01:00
2025-06-23 13:12:31 +01:00
2026-02-21 20:03:00 -08:00
2026-05-05 21:10:01 +09:00
2026-06-19 18:13:48 +01:00
2024-05-27 01:32:50 +01:00
2025-09-05 14:20:37 +01:00
2026-02-22 23:53:49 +00:00
2026-06-02 16:09:24 +01:00
2026-03-02 16:56:59 +00:00
2024-09-10 12:44:14 +01:00
2024-05-27 01:32:50 +01:00
2026-07-03 07:38:17 +02:00
2024-05-27 01:32:50 +01:00
2024-02-19 16:59:34 +00:00
2026-06-09 22:46:05 +01:00
2025-05-19 11:41:48 +01:00
2025-11-20 17:29:07 +00:00
2026-06-02 16:09:24 +01:00
2025-08-13 19:06:29 +01:00
2026-05-24 23:35:39 +01:00
2025-11-18 18:55:22 +00:00
2026-04-09 20:19:31 +01:00
2024-05-16 13:36:42 +01:00
2025-08-07 10:07:06 +02:00
2025-06-17 12:50:30 +01:00
2026-07-03 07:38:17 +02:00
2026-06-02 16:09:23 +01:00
2026-06-02 16:09:24 +01:00
2026-06-02 16:09:23 +01:00
2025-08-19 16:52:47 +01:00
2026-07-03 07:38:17 +02:00
2025-07-16 11:15:26 +01:00
2026-07-03 07:38:17 +02:00
2026-07-03 07:38:17 +02:00
2024-03-25 00:48:23 +00:00
2026-07-03 07:38:17 +02:00
2025-03-17 17:35:52 +00:00
2026-06-02 16:09:24 +01:00
2026-06-02 16:09:23 +01:00
2026-06-02 16:09:24 +01:00
2026-06-02 16:09:23 +01:00
2026-06-02 16:06:18 +01:00
2026-05-24 23:35:38 +01:00
2024-05-27 01:32:50 +01:00
2026-02-22 23:53:44 +00:00
2024-05-27 01:32:22 +01:00
2025-07-04 13:09:53 +01:00
2024-05-09 17:44:01 +02:00
2026-06-02 16:09:24 +01:00
2024-05-27 01:32:50 +01:00
2025-06-30 16:06:39 +01:00
2025-07-07 23:32:39 +01:00
2024-01-23 15:05:13 +00:00
2025-07-14 14:44:05 +01:00
2026-07-03 07:38:17 +02:00
2025-08-11 14:08:52 +01:00
2025-08-11 14:08:51 +01:00
2024-03-25 00:48:25 +00:00
2024-03-25 00:48:26 +00:00
2024-09-10 12:44:09 +01:00
2026-06-02 16:09:24 +01:00
2024-03-25 19:28:27 +00:00
2026-02-23 14:52:16 +00:00
2026-07-03 07:38:17 +02:00
2026-06-02 16:09:24 +01:00
2026-07-03 07:38:17 +02:00
2024-11-12 13:08:35 +00:00
2024-11-12 13:08:35 +00:00
2026-07-03 07:38:17 +02:00
2024-11-12 13:08:35 +00:00
2024-04-10 18:48:59 +01:00
2024-07-29 01:19:04 +01:00
2024-11-12 13:08:35 +00:00
2024-09-09 21:08:42 +01:00