Skip to content

Conversation

@QUIC-kamalw
Copy link

RPMH regulator change to support the reading the RPMH regulator params from the RPMH hardware

QUIC-kamalw and others added 4 commits November 25, 2025 20:14
Currently, when `rpmh_regulator_set_mode_bypass()` helper function
is called to set bypass mode, it sends PMIC4's BOB bypass mode
value for even if its a PMIC5 BOB.

To fix this, introduce new hw_data parameters:
 - `bypass_supported` to check if bypass is supported.
 - `pmic_bypass_mode` to store bypass mode value.

Use these 2 parameters to send correct PMIC bypass mode that
corresponds to PMIC4/5 BOB regulators from the helper function.

Change-Id: I1db3d91f24a33aa6dcd7dfed0acbc26910a90edd
Signed-off-by: Kamal Wadhwa <[email protected]>
Reviewed-by: Konrad Dybcio <[email protected]>
Link: https://lore.kernel.org/r/20251022-add-rpmh-read-support-v2-1-5c7a8e4df601@oss.qualcomm.com
All rpmh_*() APIs so far have supported placing votes for various
resource settings but the H/W also have option to read resource
settings.

This change adds a new rpmh_read() API to allow clients
to read back resource setting from H/W. This will be useful for
clients like regulators, which currently don't have a way to know
the settings applied during bootloader stage.

Change-Id: I65e4925b3e0df0136c6b755dee0be752d4214a9a
Link: https://lore.kernel.org/r/20250623-add-rpmh-read-support-v1-1-ae583d260195@oss.qualcomm.com
Signed-off-by: Maulik Shah <[email protected]>
Signed-off-by: Kamal Wadhwa <[email protected]>
Link: https://lore.kernel.org/r/20251022-add-rpmh-read-support-v2-2-5c7a8e4df601@oss.qualcomm.com
Currently, the RPMH regulator's `get_voltage_sel()` function only
returns cached values from the last `set_voltage_sel()` operation.
This limitation prevents the regulator framework from accurately
reflecting the regulator configurations set during the bootloader
stage. As a result, the regulator framework may trigger an
unnecessary `set_voltage_sel()` call with the `min_uV` value
specified in the regulator's device tree settings, which can
cause issues for consumers like the display and UFS that require
a consistent voltage setting from the bootloader state until
their drivers are probed.

To address this issue, enhance the `get_voltage_sel()`, and also
add new `get_status()` callbacks to read the regulator settings
directly from the RPMH hardware using the `rpmh_read()`function.
This change ensures that the regulator framework accurately
reflects the actual state of the regulators, avoiding unnecessary
voltage adjustments and maintaining consistent power settings
across the transition from bootloader to kernel.

Change-Id: Ia3ac5a0a3e110181688c2ad548651a02917b78bd
Signed-off-by: David Collins <[email protected]>
Signed-off-by: Kamal Wadhwa <[email protected]>
Link: https://lore.kernel.org/r/20250623-add-rpmh-read-support-v1-2-ae583d260195@oss.qualcomm.com
Link: https://lore.kernel.org/r/20251022-add-rpmh-read-support-v2-3-5c7a8e4df601@oss.qualcomm.com
Fix the code style/format issues reported by checkpatch.pl
script.

Change-Id: I9c398588c9ad473788be56c588ef16a54c6d37a2
Signed-off-by: Kamal Wadhwa <[email protected]>
Link: https://lore.kernel.org/r/20251022-add-rpmh-read-support-v2-4-5c7a8e4df601@oss.qualcomm.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants