Skip to content

regulator: qcom_usb_vbus: Add PM4125 VBUS regulator support with register abstraction#1493

Open
JeevanPallapothu999 wants to merge 4 commits into
qualcomm-linux:tech/hwe/unoqfrom
JeevanPallapothu999:for-unoq
Open

regulator: qcom_usb_vbus: Add PM4125 VBUS regulator support with register abstraction#1493
JeevanPallapothu999 wants to merge 4 commits into
qualcomm-linux:tech/hwe/unoqfrom
JeevanPallapothu999:for-unoq

Conversation

@JeevanPallapothu999

Copy link
Copy Markdown

This PR adds USB VBUS regulator support for the PM4125 PMIC in the
qcom_usb_vbus driver.

The PM4125 uses a different register layout compared to PM8150B —
CMD_OTG at offset 0x50, OTG_CFG at 0x56, and a 2-bit VBOOST voltage
selector at offset 0x52 supporting 4.25V, 4.5V, 4.75V, and 5.0V.

To accommodate this, a per-compatible register abstraction
(qcom_usb_vbus_reg_data) is introduced, allowing the driver to
dynamically handle different PMIC register layouts.

CRs-Fixed: 4523456

kotarake added 4 commits July 10, 2026 13:45
…m4125-vbus-reg

The pm4125 PMIC uses a different USB VBUS register layout than pm8150b.
It uses a 2-bit VBOOST voltage selector supporting output voltages of
4.25 V, 4.5 V, 4.75 V and 5.0 V, instead of a current-limit selector.

Move qcom,pm4125-vbus-reg from the pm8150b fallback items list into the
standalone enum since the driver handles it with its own match-data and
register layout.

Make regulator-min/max-microamp conditional so they are only required
for current-limit variants (pm8150b, pm6150, pm7250b, pmi632). Add an
if/then condition for qcom,pm4125-vbus-reg requiring regulator-min/
max-microvolt instead, and update the pm4125 example accordingly.

Link: https://lore.kernel.org/all/20260706-add_pm4125-vbus-reg-v3-1-999d78a87b81@oss.qualcomm.com/
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Rakesh Kota <rakesh.kota@oss.qualcomm.com>
…50B support

Introduce per-compatible regulator descriptor data via struct
qcom_usb_vbus_reg_data to abstract register layout differences between
PMICs. This allows the probe function to dynamically populate the
regulator_desc fields rather than relying on compile-time constants.

Refactor the existing PM8150B support to use this abstraction, wiring in
its CMD_OTG, OTG_CFG, and current-limit registers through pm8150b_data.
No functional change is intended for PM8150B.

Link: https://lore.kernel.org/all/20260706-add_pm4125-vbus-reg-v3-2-999d78a87b81@oss.qualcomm.com/
Signed-off-by: Rakesh Kota <rakesh.kota@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
The PM4125 PMIC uses a different register layout for USB VBUS control
compared to PM8150B. On PM4125, CMD_OTG is at offset 0x50, OTG_CFG is
at 0x56, and offset 0x52 is a 2-bit VBOOST voltage selector rather than
a current-limit selector.

Add pm4125_data using the abstraction introduced for PM8150B, along with
dedicated voltage-selector ops and the pm4125_vboost_table covering the
four supported boost voltages: 4.25 V, 4.5 V, 4.75 V, and 5.0 V.

Link: https://lore.kernel.org/all/20260706-add_pm4125-vbus-reg-v3-3-999d78a87b81@oss.qualcomm.com/
Signed-off-by: Rakesh Kota <rakesh.kota@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
…constraints

Remove pm8150b fallback compatible from pm4125_vbus and fix regulator
constraints in qrb2210 DTS files to use microvolt instead of
microamp.

List: https://lore.kernel.org/all/20260706-add_pm4125-vbus-reg-v3-4-999d78a87b81@oss.qualcomm.com/
Signed-off-by: Rakesh Kota <rakesh.kota@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@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