mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v4] arm64: dts: qcom: lemans-evk: Add OTG support for primary USB controller
@ 2025-11-02 16:51 Krishna Kurapati
  2025-11-02 17:18 ` Dmitry Baryshkov
  2025-11-02 17:18 ` Bjorn Andersson
  0 siblings, 2 replies; 3+ messages in thread
From: Krishna Kurapati @ 2025-11-02 16:51 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Dmitry Baryshkov
  Cc: linux-arm-msm, devicetree, linux-kernel, Krishna Kurapati

Enable OTG support for primary USB controller on EVK Platform. Add
HD3SS3220 Type-C port controller present between Type-C port and SoC
that provides role switch notifications to controller.

Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
---
Changes in v4:
- Moved remote endpoints to SoC file.
- Renamed vbus regulator name.
- Moved usb-role-swich property to SoC file.

Changes in v3:
- Moved "usb-role-switch" to lemans dtsi file
- Moved vbus supply to connector node

Link to v3 DT:
https://lore.kernel.org/all/20251024182138.2744861-1-krishna.kurapati@oss.qualcomm.com/

Link to v2:
https://lore.kernel.org/all/20251008180036.1770735-1-krishna.kurapati@oss.qualcomm.com/

Link to v6 bindings and driver changes:
https://lore.kernel.org/all/20251102164819.2798754-1-krishna.kurapati@oss.qualcomm.com/

 arch/arm64/boot/dts/qcom/lemans-evk.dts | 108 +++++++++++++++++++++++-
 arch/arm64/boot/dts/qcom/lemans.dtsi    |  20 +++++
 2 files changed, 126 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/lemans-evk.dts b/arch/arm64/boot/dts/qcom/lemans-evk.dts
index b40fa203e4a2..b96d667f1b40 100644
--- a/arch/arm64/boot/dts/qcom/lemans-evk.dts
+++ b/arch/arm64/boot/dts/qcom/lemans-evk.dts
@@ -38,6 +38,35 @@ chosen {
 		stdout-path = "serial0:115200n8";
 	};
 
+	connector-0 {
+		compatible = "usb-c-connector";
+		label = "USB0-Type-C";
+		data-role = "dual";
+		power-role = "dual";
+
+		vbus-supply = <&vbus_supply_regulator_0>;
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+
+				usb0_con_hs_ep: endpoint {
+					remote-endpoint = <&usb3_0_hs_ep>;
+				};
+			};
+			port@1 {
+				reg = <1>;
+
+				usb0_con_ss_ep: endpoint {
+					remote-endpoint = <&hd3ss3220_in_ep>;
+				};
+			};
+		};
+	};
+
 	edp0-connector {
 		compatible = "dp-connector";
 		label = "EDP0";
@@ -102,6 +131,15 @@ platform {
 		};
 	};
 
+	vbus_supply_regulator_0: regulator-vbus-supply-0 {
+		compatible = "regulator-fixed";
+		regulator-name = "vbus_supply_0";
+		gpio = <&expander1 2 GPIO_ACTIVE_HIGH>;
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		enable-active-high;
+	};
+
 	vmmc_sdc: regulator-vmmc-sdc {
 		compatible = "regulator-fixed";
 
@@ -454,6 +492,53 @@ &gpi_dma2 {
 	status = "okay";
 };
 
+&pmm8654au_2_gpios {
+	usb0_intr_state: usb0-intr-state {
+		pins = "gpio5";
+		function = "normal";
+		input-enable;
+		bias-pull-up;
+		power-source = <0>;
+	};
+};
+
+&i2c11 {
+	status = "okay";
+
+	hd3ss3220@67 {
+		compatible = "ti,hd3ss3220";
+		reg = <0x67>;
+
+		interrupts-extended = <&pmm8654au_2_gpios 5 IRQ_TYPE_EDGE_FALLING>;
+
+		id-gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>;
+
+		pinctrl-0 = <&usb_id>, <&usb0_intr_state>;
+		pinctrl-names = "default";
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+
+				hd3ss3220_in_ep: endpoint {
+					remote-endpoint = <&usb0_con_ss_ep>;
+				};
+			};
+
+			port@1 {
+				reg = <1>;
+
+				hd3ss3220_out_ep: endpoint {
+					remote-endpoint = <&usb3_0_ss_ep>;
+				};
+			};
+		};
+	};
+};
+
 &i2c18 {
 	status = "okay";
 
@@ -746,11 +831,24 @@ wake-pins {
 		};
 	};
 
+	qup_i2c11_default: qup-i2c11-state {
+		pins = "gpio48", "gpio49";
+		function = "qup1_se4";
+		drive-strength = <2>;
+		bias-pull-up;
+	};
+
 	sd_cd: sd-cd-state {
 		pins = "gpio36";
 		function = "gpio";
 		bias-pull-up;
 	};
+
+	usb_id: usb-id-state {
+		pins = "gpio50";
+		function = "gpio";
+		bias-pull-up;
+	};
 };
 
 &uart10 {
@@ -779,11 +877,17 @@ &ufs_mem_phy {
 };
 
 &usb_0 {
-	dr_mode = "peripheral";
-
 	status = "okay";
 };
 
+&usb3_0_hs_ep {
+	remote-endpoint = <&usb0_con_hs_ep>;
+};
+
+&usb3_0_ss_ep {
+	remote-endpoint = <&hd3ss3220_out_ep>;
+};
+
 &usb_0_hsphy {
 	vdda-pll-supply = <&vreg_l7a>;
 	vdda18-supply = <&vreg_l6c>;
diff --git a/arch/arm64/boot/dts/qcom/lemans.dtsi b/arch/arm64/boot/dts/qcom/lemans.dtsi
index 0b154d57ba24..5fa4a43a7350 100644
--- a/arch/arm64/boot/dts/qcom/lemans.dtsi
+++ b/arch/arm64/boot/dts/qcom/lemans.dtsi
@@ -4026,7 +4026,27 @@ usb_0: usb@a600000 {
 			snps,dis-u1-entry-quirk;
 			snps,dis-u2-entry-quirk;
 
+			usb-role-switch;
 			status = "disabled";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+
+					usb3_0_hs_ep: endpoint {
+					};
+				};
+
+				port@1 {
+					reg = <1>;
+
+					usb3_0_ss_ep: endpoint {
+					};
+				};
+			};
 		};
 
 		usb_1: usb@a800000 {
-- 
2.34.1


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

* Re: [PATCH v4] arm64: dts: qcom: lemans-evk: Add OTG support for primary USB controller
  2025-11-02 16:51 [PATCH v4] arm64: dts: qcom: lemans-evk: Add OTG support for primary USB controller Krishna Kurapati
  2025-11-02 17:18 ` Dmitry Baryshkov
@ 2025-11-02 17:18 ` Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Andersson @ 2025-11-02 17:18 UTC (permalink / raw)
  To: Krishna Kurapati
  Cc: Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Dmitry Baryshkov, linux-arm-msm, devicetree, linux-kernel

On Sun, Nov 02, 2025 at 10:21:26PM +0530, Krishna Kurapati wrote:
> Enable OTG support for primary USB controller on EVK Platform. Add
> HD3SS3220 Type-C port controller present between Type-C port and SoC
> that provides role switch notifications to controller.
> 
> Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
> ---
> Changes in v4:
> - Moved remote endpoints to SoC file.
> - Renamed vbus regulator name.
> - Moved usb-role-swich property to SoC file.
> 
> Changes in v3:
> - Moved "usb-role-switch" to lemans dtsi file
> - Moved vbus supply to connector node
> 
> Link to v3 DT:
> https://lore.kernel.org/all/20251024182138.2744861-1-krishna.kurapati@oss.qualcomm.com/
> 
> Link to v2:
> https://lore.kernel.org/all/20251008180036.1770735-1-krishna.kurapati@oss.qualcomm.com/

"Link to v3 DT", "Link to v2", no link to v1? No changelog for v2?

There is a clean and easy to follow format for how to write the
changelog, which b4 implements entirely for free (free as in both cost
and effort on your behalf).

Please stop doing your own thing...and adopt b4.

> 
> Link to v6 bindings and driver changes:
> https://lore.kernel.org/all/20251102164819.2798754-1-krishna.kurapati@oss.qualcomm.com/
> 

Another way to say this would be: "this patch can not be merged", but
you didn't say that, you gave me the opportunity to apply the patch, run
dtbs_check, and then go look at this link to determine why there is a
check failure in your patch.

This also means that you have now sent me 4 versions of this patch, none
of which I could have merged, each time suggesting that I should figure
that out myself.

Please stop sending me patches that can't be merged!


To be clear, I'm rejecting this patch and expect you to send v5 once the
dependencies are in linux-next.

Regards,
Bjorn

>  arch/arm64/boot/dts/qcom/lemans-evk.dts | 108 +++++++++++++++++++++++-
>  arch/arm64/boot/dts/qcom/lemans.dtsi    |  20 +++++
>  2 files changed, 126 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/qcom/lemans-evk.dts b/arch/arm64/boot/dts/qcom/lemans-evk.dts
> index b40fa203e4a2..b96d667f1b40 100644
> --- a/arch/arm64/boot/dts/qcom/lemans-evk.dts
> +++ b/arch/arm64/boot/dts/qcom/lemans-evk.dts
> @@ -38,6 +38,35 @@ chosen {
>  		stdout-path = "serial0:115200n8";
>  	};
>  
> +	connector-0 {
> +		compatible = "usb-c-connector";
> +		label = "USB0-Type-C";
> +		data-role = "dual";
> +		power-role = "dual";
> +
> +		vbus-supply = <&vbus_supply_regulator_0>;
> +
> +		ports {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +
> +			port@0 {
> +				reg = <0>;
> +
> +				usb0_con_hs_ep: endpoint {
> +					remote-endpoint = <&usb3_0_hs_ep>;
> +				};
> +			};
> +			port@1 {
> +				reg = <1>;
> +
> +				usb0_con_ss_ep: endpoint {
> +					remote-endpoint = <&hd3ss3220_in_ep>;
> +				};
> +			};
> +		};
> +	};
> +
>  	edp0-connector {
>  		compatible = "dp-connector";
>  		label = "EDP0";
> @@ -102,6 +131,15 @@ platform {
>  		};
>  	};
>  
> +	vbus_supply_regulator_0: regulator-vbus-supply-0 {
> +		compatible = "regulator-fixed";
> +		regulator-name = "vbus_supply_0";
> +		gpio = <&expander1 2 GPIO_ACTIVE_HIGH>;
> +		regulator-min-microvolt = <5000000>;
> +		regulator-max-microvolt = <5000000>;
> +		enable-active-high;
> +	};
> +
>  	vmmc_sdc: regulator-vmmc-sdc {
>  		compatible = "regulator-fixed";
>  
> @@ -454,6 +492,53 @@ &gpi_dma2 {
>  	status = "okay";
>  };
>  
> +&pmm8654au_2_gpios {
> +	usb0_intr_state: usb0-intr-state {
> +		pins = "gpio5";
> +		function = "normal";
> +		input-enable;
> +		bias-pull-up;
> +		power-source = <0>;
> +	};
> +};
> +
> +&i2c11 {
> +	status = "okay";
> +
> +	hd3ss3220@67 {
> +		compatible = "ti,hd3ss3220";
> +		reg = <0x67>;
> +
> +		interrupts-extended = <&pmm8654au_2_gpios 5 IRQ_TYPE_EDGE_FALLING>;
> +
> +		id-gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>;
> +
> +		pinctrl-0 = <&usb_id>, <&usb0_intr_state>;
> +		pinctrl-names = "default";
> +
> +		ports {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +
> +			port@0 {
> +				reg = <0>;
> +
> +				hd3ss3220_in_ep: endpoint {
> +					remote-endpoint = <&usb0_con_ss_ep>;
> +				};
> +			};
> +
> +			port@1 {
> +				reg = <1>;
> +
> +				hd3ss3220_out_ep: endpoint {
> +					remote-endpoint = <&usb3_0_ss_ep>;
> +				};
> +			};
> +		};
> +	};
> +};
> +
>  &i2c18 {
>  	status = "okay";
>  
> @@ -746,11 +831,24 @@ wake-pins {
>  		};
>  	};
>  
> +	qup_i2c11_default: qup-i2c11-state {
> +		pins = "gpio48", "gpio49";
> +		function = "qup1_se4";
> +		drive-strength = <2>;
> +		bias-pull-up;
> +	};
> +
>  	sd_cd: sd-cd-state {
>  		pins = "gpio36";
>  		function = "gpio";
>  		bias-pull-up;
>  	};
> +
> +	usb_id: usb-id-state {
> +		pins = "gpio50";
> +		function = "gpio";
> +		bias-pull-up;
> +	};
>  };
>  
>  &uart10 {
> @@ -779,11 +877,17 @@ &ufs_mem_phy {
>  };
>  
>  &usb_0 {
> -	dr_mode = "peripheral";
> -
>  	status = "okay";
>  };
>  
> +&usb3_0_hs_ep {
> +	remote-endpoint = <&usb0_con_hs_ep>;
> +};
> +
> +&usb3_0_ss_ep {
> +	remote-endpoint = <&hd3ss3220_out_ep>;
> +};
> +
>  &usb_0_hsphy {
>  	vdda-pll-supply = <&vreg_l7a>;
>  	vdda18-supply = <&vreg_l6c>;
> diff --git a/arch/arm64/boot/dts/qcom/lemans.dtsi b/arch/arm64/boot/dts/qcom/lemans.dtsi
> index 0b154d57ba24..5fa4a43a7350 100644
> --- a/arch/arm64/boot/dts/qcom/lemans.dtsi
> +++ b/arch/arm64/boot/dts/qcom/lemans.dtsi
> @@ -4026,7 +4026,27 @@ usb_0: usb@a600000 {
>  			snps,dis-u1-entry-quirk;
>  			snps,dis-u2-entry-quirk;
>  
> +			usb-role-switch;
>  			status = "disabled";
> +
> +			ports {
> +				#address-cells = <1>;
> +				#size-cells = <0>;
> +
> +				port@0 {
> +					reg = <0>;
> +
> +					usb3_0_hs_ep: endpoint {
> +					};
> +				};
> +
> +				port@1 {
> +					reg = <1>;
> +
> +					usb3_0_ss_ep: endpoint {
> +					};
> +				};
> +			};
>  		};
>  
>  		usb_1: usb@a800000 {
> -- 
> 2.34.1
> 

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

* Re: [PATCH v4] arm64: dts: qcom: lemans-evk: Add OTG support for primary USB controller
  2025-11-02 16:51 [PATCH v4] arm64: dts: qcom: lemans-evk: Add OTG support for primary USB controller Krishna Kurapati
@ 2025-11-02 17:18 ` Dmitry Baryshkov
  2025-11-02 17:18 ` Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Baryshkov @ 2025-11-02 17:18 UTC (permalink / raw)
  To: Krishna Kurapati, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-arm-msm, devicetree, linux-kernel

On 02/11/2025 18:51, Krishna Kurapati wrote:
> Enable OTG support for primary USB controller on EVK Platform. Add
> HD3SS3220 Type-C port controller present between Type-C port and SoC
> that provides role switch notifications to controller.
> 
> Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
> ---
> Changes in v4:
> - Moved remote endpoints to SoC file.
> - Renamed vbus regulator name.
> - Moved usb-role-swich property to SoC file.
> 
> Changes in v3:
> - Moved "usb-role-switch" to lemans dtsi file
> - Moved vbus supply to connector node
> 
> Link to v3 DT:
> https://lore.kernel.org/all/20251024182138.2744861-1-krishna.kurapati@oss.qualcomm.com/
> 
> Link to v2:
> https://lore.kernel.org/all/20251008180036.1770735-1-krishna.kurapati@oss.qualcomm.com/
> 
> Link to v6 bindings and driver changes:
> https://lore.kernel.org/all/20251102164819.2798754-1-krishna.kurapati@oss.qualcomm.com/
> 
>   arch/arm64/boot/dts/qcom/lemans-evk.dts | 108 +++++++++++++++++++++++-
>   arch/arm64/boot/dts/qcom/lemans.dtsi    |  20 +++++
>   2 files changed, 126 insertions(+), 2 deletions(-)
> 

> @@ -454,6 +492,53 @@ &gpi_dma2 {
>   	status = "okay";
>   };
>   
> +&pmm8654au_2_gpios {
> +	usb0_intr_state: usb0-intr-state {
> +		pins = "gpio5";
> +		function = "normal";
> +		input-enable;
> +		bias-pull-up;
> +		power-source = <0>;
> +	};
> +};

Why is this chunk here? Please check that the DTB is sorted.

> +
> +&i2c11 {
> +	status = "okay";
> +
-- 
With best wishes
Dmitry

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

end of thread, other threads:[~2025-11-02 17:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-02 16:51 [PATCH v4] arm64: dts: qcom: lemans-evk: Add OTG support for primary USB controller Krishna Kurapati
2025-11-02 17:18 ` Dmitry Baryshkov
2025-11-02 17:18 ` Bjorn Andersson

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

all inboxes | Powered by JetHome®