mbox series

[0/3] Add PMI8998 VBUS Regulator Support

Message ID 20250211194918.2517593-1-james.a.macinnes@gmail.com
Headers show
Series Add PMI8998 VBUS Regulator Support | expand

Message

James A. MacInnes Feb. 11, 2025, 7:49 p.m. UTC
Hello,

This patch series adds support for the PMI8998 VBUS regulator in the Qualcomm USB VBUS regulator driver and the device tree. These changes enable proper VBUS current limit configuration and ensure compatibility across multiple Qualcomm PMICs.

Summary of Changes:
- Patch 1/3: Updates the Device Tree Schema bindings to include "qcom,pmi8998-vbus-reg" for PMI8998 support.
- Patch 2/3: Extends the Qualcomm USB VBUS regulator driver to support PMI8998, dynamically configuring the regulator based on the PMIC type.
- Patch 3/3: Adds the VBUS regulator node to pmi8998.dtsi, enabling USB Type-C VBUS support.

Motivation:
A long time ago, in a conference room far, far away, I promised that USB Type-C capability would work on the SDM845 when we chose this chip for our instrument.

That day never came.

So I wrote it myself.

This patch series finally adds the missing support for USB Type-C VBUS regulation on PMI8998-based platforms. Future generations of engineers will no longer have to mutter "Why doesn’t this work?" while digging through device trees.

Kernel Version & Testing:
- These patches were developed and tested on Linux 6.13.
- Attempting to run Linux 6.14-rc2 on our Lantronix SOM resulted in a crash, making it unsuitable for validation.
- Validation was performed using a modified device tree, confirming proper regulator configuration.
- No regressions were observed on existing PMIC configurations.

Next Steps:
If there are any suggestions or required changes, please let me know. I will be happy to revise and address any concerns.

Thanks again,
James A. MacInnes
james.a.macinnes@gmail.com

James A. MacInnes (3):
  regulator: qcom_usb_vbus: Update DTS binding for PMI8998 support
  regulator: qcom_usb_vbus: Add support for PMI8998 VBUS
  arm64: boot: dts: pmi8998.dtsi: Add VBUS regulator

 .../regulator/qcom,usb-vbus-regulator.yaml    |  1 +
 arch/arm64/boot/dts/qcom/pmi8998.dtsi         |  6 ++++
 drivers/regulator/qcom_usb_vbus-regulator.c   | 33 ++++++++++++++++---
 3 files changed, 35 insertions(+), 5 deletions(-)

Comments

Dmitry Baryshkov Feb. 11, 2025, 11:32 p.m. UTC | #1
On Tue, Feb 11, 2025 at 11:49:16AM -0800, James A. MacInnes wrote:
> This patch adds support for the USB Type-C VBUS regulator to the
> PMI8998 PMIC device tree.

"In order to enable USB Type-C VBUS support on the SDM845 platform add
device node for the USB Vbus regulator to the PMI8998 PMIC device tree."

Drop the rest of the commit message.

> 
> Key changes:
> - Defined the `usb-vbus-regulator` node for VBUS handling, enabling
>   control over USB power delivery.
> 
> This addition enable USB Type-C VBUS support on sdm845 platforms.
> 
> Signed-off-by: James A. MacInnes <james.a.macinnes@gmail.com>
> ---
>  arch/arm64/boot/dts/qcom/pmi8998.dtsi | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/pmi8998.dtsi b/arch/arm64/boot/dts/qcom/pmi8998.dtsi
> index cd3f0790fd42..8cb1d851b5a3 100644
> --- a/arch/arm64/boot/dts/qcom/pmi8998.dtsi
> +++ b/arch/arm64/boot/dts/qcom/pmi8998.dtsi
> @@ -29,6 +29,12 @@ pmi8998_charger: charger@1000 {
>  			status = "disabled";
>  		};
>  
> +		pmi8998_vbus: usb-vbus-regulator@1100 {
> +			compatible = "qcom,pmi8998-vbus-reg";
> +			status = "disabled";
> +			reg = <0x1100>;
> +		};
> +
>  		pmi8998_gpios: gpio@c000 {
>  			compatible = "qcom,pmi8998-gpio", "qcom,spmi-gpio";
>  			reg = <0xc000>;
> -- 
> 2.43.0
>