Devicetree
 help / color / mirror / Atom feed
* [PATCH v4 0/2] arm64: dts: qcom: qrb2210-rb1: enable Type-C support
@ 2024-03-04  9:26 Dmitry Baryshkov
  2024-03-04  9:26 ` [PATCH v4 1/2] dt-bindings: usb: qcom,pmic-typec: add support for the PM4125 block Dmitry Baryshkov
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Dmitry Baryshkov @ 2024-03-04  9:26 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Liam Girdwood, Mark Brown,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Wesley Cheng,
	Bryan O'Donoghue, Greg Kroah-Hartman
  Cc: linux-arm-msm, devicetree, linux-usb, Dmitry Baryshkov,
	Krzysztof Kozlowski

Reuse Type-C support implemented for the PMI632 PMIC (found on Qualcomm
Robotics RB2 platform) and implement Type-C handling for the Qualcomm
Robotics RB1 platform.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
Changes in v4:
- Rebased on top of linux-next, dropping applied patches
- Link to v3: https://lore.kernel.org/r/20240221-pm4125-typec-v3-0-fdd0ee0465b8@linaro.org

Changes in v3:
- Fixed the commit subject for the regulators patch (Mark Brown)
- Rebased on top of linux-next, dropping applied patches
- Link to v2: https://lore.kernel.org/r/20240202-pm4125-typec-v2-0-12771d85700d@linaro.org

Changes in v2:
- Removed unnecessary conditional expansion, covered by existing compat
  string (Krzysztof)
- Link to v1: https://lore.kernel.org/r/20240130-pm4125-typec-v1-0-e8d0097e2991@linaro.org

---
Dmitry Baryshkov (2):
      dt-bindings: usb: qcom,pmic-typec: add support for the PM4125 block
      arm64: dts: qcom: qrb2210-rb1: enable USB-C port handling

 .../devicetree/bindings/usb/qcom,pmic-typec.yaml   |  5 ++
 arch/arm64/boot/dts/qcom/qcm2290.dtsi              | 42 +++++++++++++++
 arch/arm64/boot/dts/qcom/qrb2210-rb1.dts           | 60 +++++++++++++++++++---
 3 files changed, 99 insertions(+), 8 deletions(-)
---
base-commit: 67908bf6954b7635d33760ff6dfc189fc26ccc89
change-id: 20240117-pm4125-typec-8800d9c09aec

Best regards,
-- 
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v4 1/2] dt-bindings: usb: qcom,pmic-typec: add support for the PM4125 block
  2024-03-04  9:26 [PATCH v4 0/2] arm64: dts: qcom: qrb2210-rb1: enable Type-C support Dmitry Baryshkov
@ 2024-03-04  9:26 ` Dmitry Baryshkov
  2024-03-04  9:26 ` [PATCH v4 2/2] arm64: dts: qcom: qrb2210-rb1: enable USB-C port handling Dmitry Baryshkov
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Dmitry Baryshkov @ 2024-03-04  9:26 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Liam Girdwood, Mark Brown,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Wesley Cheng,
	Bryan O'Donoghue, Greg Kroah-Hartman
  Cc: linux-arm-msm, devicetree, linux-usb, Dmitry Baryshkov,
	Krzysztof Kozlowski

The PM4125 PMIC has the same Type-C register block as the PMI632.
Likewise it doesn't support USB Power Delivery. Define the compatible
for the TypeC block found on PM4125, using PMI632 as a compatible.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml b/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml
index 976d1732137b..d9694570c419 100644
--- a/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml
+++ b/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml
@@ -22,6 +22,11 @@ properties:
           - enum:
               - qcom,pm6150-typec
           - const: qcom,pm8150b-typec
+      - items:
+          - enum:
+              - qcom,pm4125-typec
+          - const: qcom,pmi632-typec
+
 
   connector:
     type: object

-- 
2.39.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v4 2/2] arm64: dts: qcom: qrb2210-rb1: enable USB-C port handling
  2024-03-04  9:26 [PATCH v4 0/2] arm64: dts: qcom: qrb2210-rb1: enable Type-C support Dmitry Baryshkov
  2024-03-04  9:26 ` [PATCH v4 1/2] dt-bindings: usb: qcom,pmic-typec: add support for the PM4125 block Dmitry Baryshkov
@ 2024-03-04  9:26 ` Dmitry Baryshkov
  2024-03-04  9:49 ` [PATCH v4 0/2] arm64: dts: qcom: qrb2210-rb1: enable Type-C support Greg Kroah-Hartman
  2024-03-19  2:48 ` (subset) " Bjorn Andersson
  3 siblings, 0 replies; 8+ messages in thread
From: Dmitry Baryshkov @ 2024-03-04  9:26 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Liam Girdwood, Mark Brown,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Wesley Cheng,
	Bryan O'Donoghue, Greg Kroah-Hartman
  Cc: linux-arm-msm, devicetree, linux-usb, Dmitry Baryshkov

Plug in USB-C related bits and pieces to enable USB role switching and
USB-C orientation handling for the Qualcomm RB1 board.

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 arch/arm64/boot/dts/qcom/qcm2290.dtsi    | 42 ++++++++++++++++++++++
 arch/arm64/boot/dts/qcom/qrb2210-rb1.dts | 60 +++++++++++++++++++++++++++-----
 2 files changed, 94 insertions(+), 8 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/qcm2290.dtsi b/arch/arm64/boot/dts/qcom/qcm2290.dtsi
index 89beac833d43..967bc98d02dd 100644
--- a/arch/arm64/boot/dts/qcom/qcm2290.dtsi
+++ b/arch/arm64/boot/dts/qcom/qcm2290.dtsi
@@ -694,10 +694,31 @@ usb_qmpphy: phy@1615000 {
 			clock-output-names = "usb3_phy_pipe_clk_src";
 
 			#phy-cells = <0>;
+			orientation-switch;
 
 			qcom,tcsr-reg = <&tcsr_regs 0xb244>;
 
 			status = "disabled";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+
+					usb_qmpphy_out: endpoint {
+					};
+				};
+
+				port@1 {
+					reg = <1>;
+
+					usb_qmpphy_usb_ss_in: endpoint {
+						remote-endpoint = <&usb_dwc3_ss>;
+					};
+				};
+			};
 		};
 
 		system_noc: interconnect@1880000 {
@@ -1380,6 +1401,27 @@ usb_dwc3: usb@4e00000 {
 				snps,usb3_lpm_capable;
 				maximum-speed = "super-speed";
 				dr_mode = "otg";
+				usb-role-switch;
+
+				ports {
+					#address-cells = <1>;
+					#size-cells = <0>;
+
+					port@0 {
+						reg = <0>;
+
+						usb_dwc3_hs: endpoint {
+						};
+					};
+
+					port@1 {
+						reg = <1>;
+
+						usb_dwc3_ss: endpoint {
+							remote-endpoint = <&usb_qmpphy_usb_ss_in>;
+						};
+					};
+				};
 			};
 		};
 
diff --git a/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts b/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts
index 6e9dd0312adc..fca341300521 100644
--- a/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts
+++ b/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts
@@ -262,6 +262,46 @@ &pm4125_resin {
 	status = "okay";
 };
 
+&pm4125_typec {
+	status = "okay";
+
+	connector {
+		compatible = "usb-c-connector";
+
+		power-role = "dual";
+		data-role = "dual";
+		self-powered;
+
+		typec-power-opmode = "default";
+		pd-disable;
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+				pm4125_hs_in: endpoint {
+					remote-endpoint = <&usb_dwc3_hs>;
+				};
+			};
+
+			port@1 {
+				reg = <1>;
+				pm4125_ss_in: endpoint {
+					remote-endpoint = <&usb_qmpphy_out>;
+				};
+			};
+		};
+	};
+};
+
+&pm4125_vbus {
+	regulator-min-microamp = <500000>;
+	regulator-max-microamp = <500000>;
+	status = "okay";
+};
+
 &qupv3_id_0 {
 	status = "okay";
 };
@@ -535,14 +575,8 @@ &usb {
 	status = "okay";
 };
 
-&usb_qmpphy {
-	vdda-phy-supply = <&pm4125_l12>;
-	vdda-pll-supply = <&pm4125_l13>;
-	status = "okay";
-};
-
-&usb_dwc3 {
-	dr_mode = "host";
+&usb_dwc3_hs {
+	remote-endpoint = <&pm4125_hs_in>;
 };
 
 &usb_hsphy {
@@ -552,6 +586,16 @@ &usb_hsphy {
 	status = "okay";
 };
 
+&usb_qmpphy {
+	vdda-phy-supply = <&pm4125_l12>;
+	vdda-pll-supply = <&pm4125_l13>;
+	status = "okay";
+};
+
+&usb_qmpphy_out {
+	remote-endpoint = <&pm4125_ss_in>;
+};
+
 &wifi {
 	vdd-0.8-cx-mx-supply = <&pm4125_l7>;
 	vdd-1.8-xo-supply = <&pm4125_l13>;

-- 
2.39.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v4 0/2] arm64: dts: qcom: qrb2210-rb1: enable Type-C support
  2024-03-04  9:26 [PATCH v4 0/2] arm64: dts: qcom: qrb2210-rb1: enable Type-C support Dmitry Baryshkov
  2024-03-04  9:26 ` [PATCH v4 1/2] dt-bindings: usb: qcom,pmic-typec: add support for the PM4125 block Dmitry Baryshkov
  2024-03-04  9:26 ` [PATCH v4 2/2] arm64: dts: qcom: qrb2210-rb1: enable USB-C port handling Dmitry Baryshkov
@ 2024-03-04  9:49 ` Greg Kroah-Hartman
  2024-03-04  9:51   ` Dmitry Baryshkov
  2024-03-19  2:48 ` (subset) " Bjorn Andersson
  3 siblings, 1 reply; 8+ messages in thread
From: Greg Kroah-Hartman @ 2024-03-04  9:49 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Bjorn Andersson, Konrad Dybcio, Liam Girdwood, Mark Brown,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Wesley Cheng,
	Bryan O'Donoghue, linux-arm-msm, devicetree, linux-usb,
	Krzysztof Kozlowski

On Mon, Mar 04, 2024 at 11:26:09AM +0200, Dmitry Baryshkov wrote:
> Reuse Type-C support implemented for the PMI632 PMIC (found on Qualcomm
> Robotics RB2 platform) and implement Type-C handling for the Qualcomm
> Robotics RB1 platform.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

Patch 1 added, 2 did not apply to my tree :(

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v4 0/2] arm64: dts: qcom: qrb2210-rb1: enable Type-C support
  2024-03-04  9:49 ` [PATCH v4 0/2] arm64: dts: qcom: qrb2210-rb1: enable Type-C support Greg Kroah-Hartman
@ 2024-03-04  9:51   ` Dmitry Baryshkov
  2024-03-04 10:09     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 8+ messages in thread
From: Dmitry Baryshkov @ 2024-03-04  9:51 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Bjorn Andersson, Konrad Dybcio, Liam Girdwood, Mark Brown,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Wesley Cheng,
	Bryan O'Donoghue, linux-arm-msm, devicetree, linux-usb,
	Krzysztof Kozlowski

On Mon, 4 Mar 2024 at 11:49, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Mon, Mar 04, 2024 at 11:26:09AM +0200, Dmitry Baryshkov wrote:
> > Reuse Type-C support implemented for the PMI632 PMIC (found on Qualcomm
> > Robotics RB2 platform) and implement Type-C handling for the Qualcomm
> > Robotics RB1 platform.
> >
> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>
> Patch 1 added, 2 did not apply to my tree :(

Thank you!
Yes, patch 2 should go through arm-soc.


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v4 0/2] arm64: dts: qcom: qrb2210-rb1: enable Type-C support
  2024-03-04  9:51   ` Dmitry Baryshkov
@ 2024-03-04 10:09     ` Greg Kroah-Hartman
  2024-03-04 10:24       ` Dmitry Baryshkov
  0 siblings, 1 reply; 8+ messages in thread
From: Greg Kroah-Hartman @ 2024-03-04 10:09 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Bjorn Andersson, Konrad Dybcio, Liam Girdwood, Mark Brown,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Wesley Cheng,
	Bryan O'Donoghue, linux-arm-msm, devicetree, linux-usb,
	Krzysztof Kozlowski

On Mon, Mar 04, 2024 at 11:51:27AM +0200, Dmitry Baryshkov wrote:
> On Mon, 4 Mar 2024 at 11:49, Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> >
> > On Mon, Mar 04, 2024 at 11:26:09AM +0200, Dmitry Baryshkov wrote:
> > > Reuse Type-C support implemented for the PMI632 PMIC (found on Qualcomm
> > > Robotics RB2 platform) and implement Type-C handling for the Qualcomm
> > > Robotics RB1 platform.
> > >
> > > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> >
> > Patch 1 added, 2 did not apply to my tree :(
> 
> Thank you!
> Yes, patch 2 should go through arm-soc.

Having patch series where each one goes to a different tree makes it
really hard for maintainers to know what to do, and our tools want to
take a whole series, not individual ones.  Next time perhaps split it
up?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v4 0/2] arm64: dts: qcom: qrb2210-rb1: enable Type-C support
  2024-03-04 10:09     ` Greg Kroah-Hartman
@ 2024-03-04 10:24       ` Dmitry Baryshkov
  0 siblings, 0 replies; 8+ messages in thread
From: Dmitry Baryshkov @ 2024-03-04 10:24 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Bjorn Andersson, Konrad Dybcio, Liam Girdwood, Mark Brown,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Wesley Cheng,
	Bryan O'Donoghue, linux-arm-msm, devicetree, linux-usb,
	Krzysztof Kozlowski

On Mon, 4 Mar 2024 at 12:09, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Mon, Mar 04, 2024 at 11:51:27AM +0200, Dmitry Baryshkov wrote:
> > On Mon, 4 Mar 2024 at 11:49, Greg Kroah-Hartman
> > <gregkh@linuxfoundation.org> wrote:
> > >
> > > On Mon, Mar 04, 2024 at 11:26:09AM +0200, Dmitry Baryshkov wrote:
> > > > Reuse Type-C support implemented for the PMI632 PMIC (found on Qualcomm
> > > > Robotics RB2 platform) and implement Type-C handling for the Qualcomm
> > > > Robotics RB1 platform.
> > > >
> > > > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> > >
> > > Patch 1 added, 2 did not apply to my tree :(
> >
> > Thank you!
> > Yes, patch 2 should go through arm-soc.
>
> Having patch series where each one goes to a different tree makes it
> really hard for maintainers to know what to do, and our tools want to
> take a whole series, not individual ones.  Next time perhaps split it
> up?

Ack, I'll keep this in mind when submitting series against usb-next.
I have always been on the other side, because splitting the series
makes the life of the reviewers and testers harder. With single series
I can review, apply and test it as a whole item. With the feature
being split, I have to collect all the driver changes and also the DT
changes to be able to evaluate whether the approach is sensible or
not.

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: (subset) [PATCH v4 0/2] arm64: dts: qcom: qrb2210-rb1: enable Type-C support
  2024-03-04  9:26 [PATCH v4 0/2] arm64: dts: qcom: qrb2210-rb1: enable Type-C support Dmitry Baryshkov
                   ` (2 preceding siblings ...)
  2024-03-04  9:49 ` [PATCH v4 0/2] arm64: dts: qcom: qrb2210-rb1: enable Type-C support Greg Kroah-Hartman
@ 2024-03-19  2:48 ` Bjorn Andersson
  3 siblings, 0 replies; 8+ messages in thread
From: Bjorn Andersson @ 2024-03-19  2:48 UTC (permalink / raw)
  To: Konrad Dybcio, Liam Girdwood, Mark Brown, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Wesley Cheng,
	Bryan O'Donoghue, Greg Kroah-Hartman, Dmitry Baryshkov
  Cc: linux-arm-msm, devicetree, linux-usb, Krzysztof Kozlowski


On Mon, 04 Mar 2024 11:26:09 +0200, Dmitry Baryshkov wrote:
> Reuse Type-C support implemented for the PMI632 PMIC (found on Qualcomm
> Robotics RB2 platform) and implement Type-C handling for the Qualcomm
> Robotics RB1 platform.
> 
> 

Applied, thanks!

[2/2] arm64: dts: qcom: qrb2210-rb1: enable USB-C port handling
      commit: c39c5aed65d428f2a1c2364851c8b44702e9d7db

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-03-19  2:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-04  9:26 [PATCH v4 0/2] arm64: dts: qcom: qrb2210-rb1: enable Type-C support Dmitry Baryshkov
2024-03-04  9:26 ` [PATCH v4 1/2] dt-bindings: usb: qcom,pmic-typec: add support for the PM4125 block Dmitry Baryshkov
2024-03-04  9:26 ` [PATCH v4 2/2] arm64: dts: qcom: qrb2210-rb1: enable USB-C port handling Dmitry Baryshkov
2024-03-04  9:49 ` [PATCH v4 0/2] arm64: dts: qcom: qrb2210-rb1: enable Type-C support Greg Kroah-Hartman
2024-03-04  9:51   ` Dmitry Baryshkov
2024-03-04 10:09     ` Greg Kroah-Hartman
2024-03-04 10:24       ` Dmitry Baryshkov
2024-03-19  2:48 ` (subset) " Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox