linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] arm64: qcom: sm8650: add support for USB-C Altmode
@ 2023-12-18 10:26 Neil Armstrong
  2023-12-18 10:26 ` [PATCH 1/2] arm64: dts: qcom: sm8650-qrd: add USB-C Altmode Support Neil Armstrong
  2023-12-18 10:26 ` [PATCH 2/2] arm64: defconfig: enable WCD939x USBSS driver as module Neil Armstrong
  0 siblings, 2 replies; 5+ messages in thread
From: Neil Armstrong @ 2023-12-18 10:26 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Catalin Marinas, Will Deacon
  Cc: linux-arm-msm, devicetree, linux-kernel, linux-arm-kernel,
	Neil Armstrong

This adds the missing bits to support Display Port external
display over the USB-C Altmode support using the Redriver/Retimer
and WCD939x USBSS Mux/Switch to provide the correct switching.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
Neil Armstrong (2):
      arm64: dts: qcom: sm8650-qrd: add USB-C Altmode Support
      arm64: defconfig: enable WCD939x USBSS driver as module

 arch/arm64/boot/dts/qcom/sm8650-qrd.dts | 104 +++++++++++++++++++++++++++++++-
 arch/arm64/configs/defconfig            |   1 +
 2 files changed, 103 insertions(+), 2 deletions(-)
---
base-commit: ceb2fe0d438644e1de06b9a6468a1fb8e2199c70
change-id: 20231218-topic-sm8650-upstream-altmode-3ee141fdccff

Best regards,
-- 
Neil Armstrong <neil.armstrong@linaro.org>


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

* [PATCH 1/2] arm64: dts: qcom: sm8650-qrd: add USB-C Altmode Support
  2023-12-18 10:26 [PATCH 0/2] arm64: qcom: sm8650: add support for USB-C Altmode Neil Armstrong
@ 2023-12-18 10:26 ` Neil Armstrong
  2023-12-19 12:06   ` Konrad Dybcio
  2023-12-18 10:26 ` [PATCH 2/2] arm64: defconfig: enable WCD939x USBSS driver as module Neil Armstrong
  1 sibling, 1 reply; 5+ messages in thread
From: Neil Armstrong @ 2023-12-18 10:26 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Catalin Marinas, Will Deacon
  Cc: linux-arm-msm, devicetree, linux-kernel, linux-arm-kernel,
	Neil Armstrong

Add the necessary nodes to support the USB-C Altmode path by
adding the following
- WCD939x USBSS Mux I2C device
- nb7vpq904m Redriver I2C device
- Port/Endpoint graph links bettween PMIC-Glink, Mux, Redriver and USB PHY nodes.

WCD939x USBSS port 2 Path to Codec will be added later when Audio support
is added.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 arch/arm64/boot/dts/qcom/sm8650-qrd.dts | 104 +++++++++++++++++++++++++++++++-
 1 file changed, 102 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sm8650-qrd.dts b/arch/arm64/boot/dts/qcom/sm8650-qrd.dts
index 592a67a47c78..121fbbb5d015 100644
--- a/arch/arm64/boot/dts/qcom/sm8650-qrd.dts
+++ b/arch/arm64/boot/dts/qcom/sm8650-qrd.dts
@@ -77,9 +77,17 @@ port@1 {
 					reg = <1>;
 
 					pmic_glink_ss_in: endpoint {
-						remote-endpoint = <&usb_1_dwc3_ss>;
+						remote-endpoint = <&redriver_ss_out>;
 					};
 				};
+
+				port@2 {
+					reg = <2>;
+
+					pmic_glink_sbu: endpoint {
+						remote-endpoint = <&wcd_usbss_sbu_mux>;
+				    };
+				};
 			};
 		};
 	};
@@ -446,6 +454,70 @@ &gpi_dma1 {
 	status = "okay";
 };
 
+&i2c3 {
+       status = "ok";
+
+       wcd_usbss: typec-mux@e {
+		compatible = "qcom,wcd9395-usbss", "qcom,wcd9390-usbss";
+		reg = <0xe>;
+
+		vdd-supply = <&vreg_l15b_1p8>;
+		reset-gpios = <&tlmm 152 GPIO_ACTIVE_HIGH>;
+
+		mode-switch;
+		orientation-switch;
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+
+				wcd_usbss_sbu_mux: endpoint {
+					remote-endpoint = <&pmic_glink_sbu>;
+				};
+			};
+		};
+       };
+};
+
+&i2c6 {
+	status = "ok";
+
+	typec-mux@1c {
+		compatible = "onnn,nb7vpq904m";
+		reg = <0x1c>;
+
+		vcc-supply = <&vreg_l15b_1p8>;
+
+		retimer-switch;
+		orientation-switch;
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+
+				redriver_ss_out: endpoint {
+					remote-endpoint = <&pmic_glink_ss_in>;
+				};
+			};
+
+			port@1 {
+				reg = <1>;
+
+				redriver_ss_in: endpoint {
+					data-lanes = <3 2 1 0>;
+					remote-endpoint = <&usb_dp_qmpphy_out>;
+				};
+			};
+		};
+	};
+};
+
 &ipa {
 	qcom,gsi-loader = "self";
 	memory-region = <&ipa_fw_mem>;
@@ -495,6 +567,15 @@ &mdss_dsi0_phy {
 	status = "okay";
 };
 
+&mdss_dp0 {
+	status = "okay";
+};
+
+&mdss_dp0_out {
+	data-lanes = <0 1>;
+	remote-endpoint = <&usb_dp_qmpphy_dp_in>;
+};
+
 &mdss_mdp {
 	status = "okay";
 };
@@ -600,6 +681,11 @@ &pmk8550_rtc {
 	status = "okay";
 };
 
+&qup_i2c3_data_clk {
+	/* Use internal I2C pull-up */
+	bias-pull-up = <2200>;
+};
+
 &qupv3_id_0 {
 	status = "okay";
 };
@@ -787,7 +873,7 @@ &usb_1_dwc3_hs {
 };
 
 &usb_1_dwc3_ss {
-	remote-endpoint = <&pmic_glink_ss_in>;
+	remote-endpoint = <&usb_dp_qmpphy_usb_ss_in>;
 };
 
 &usb_1_hsphy {
@@ -803,9 +889,23 @@ &usb_dp_qmpphy {
 	vdda-phy-supply = <&vreg_l3i_1p2>;
 	vdda-pll-supply = <&vreg_l3g_0p91>;
 
+	orientation-switch;
+
 	status = "okay";
 };
 
+&usb_dp_qmpphy_dp_in {
+	remote-endpoint = <&mdss_dp0_out>;
+};
+
+&usb_dp_qmpphy_out {
+	remote-endpoint = <&redriver_ss_in>;
+};
+
+&usb_dp_qmpphy_usb_ss_in {
+	remote-endpoint = <&usb_1_dwc3_ss>;
+};
+
 &xo_board {
 	clock-frequency = <76800000>;
 };

-- 
2.34.1


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

* [PATCH 2/2] arm64: defconfig: enable WCD939x USBSS driver as module
  2023-12-18 10:26 [PATCH 0/2] arm64: qcom: sm8650: add support for USB-C Altmode Neil Armstrong
  2023-12-18 10:26 ` [PATCH 1/2] arm64: dts: qcom: sm8650-qrd: add USB-C Altmode Support Neil Armstrong
@ 2023-12-18 10:26 ` Neil Armstrong
  1 sibling, 0 replies; 5+ messages in thread
From: Neil Armstrong @ 2023-12-18 10:26 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Catalin Marinas, Will Deacon
  Cc: linux-arm-msm, devicetree, linux-kernel, linux-arm-kernel,
	Neil Armstrong

Enable the Qualcomm WCD939x USBSS Type-C mux as module as
is now used on the SM8650 QRD platform.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index 0e67a4849b91..c9ba75f1b248 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -1067,6 +1067,7 @@ CONFIG_TYPEC_QCOM_PMIC=m
 CONFIG_TYPEC_UCSI=m
 CONFIG_TYPEC_MUX_FSA4480=m
 CONFIG_TYPEC_MUX_NB7VPQ904M=m
+CONFIG_TYPEC_MUX_WCD939X_USBSS=m
 CONFIG_UCSI_CCG=m
 CONFIG_TYPEC_MUX_GPIO_SBU=m
 CONFIG_TYPEC_DP_ALTMODE=m

-- 
2.34.1


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

* Re: [PATCH 1/2] arm64: dts: qcom: sm8650-qrd: add USB-C Altmode Support
  2023-12-18 10:26 ` [PATCH 1/2] arm64: dts: qcom: sm8650-qrd: add USB-C Altmode Support Neil Armstrong
@ 2023-12-19 12:06   ` Konrad Dybcio
  2023-12-19 12:20     ` Neil Armstrong
  0 siblings, 1 reply; 5+ messages in thread
From: Konrad Dybcio @ 2023-12-19 12:06 UTC (permalink / raw)
  To: Neil Armstrong, Bjorn Andersson, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Catalin Marinas, Will Deacon
  Cc: linux-arm-msm, devicetree, linux-kernel, linux-arm-kernel

On 18.12.2023 11:26, Neil Armstrong wrote:
> Add the necessary nodes to support the USB-C Altmode path by
> adding the following
> - WCD939x USBSS Mux I2C device
> - nb7vpq904m Redriver I2C device
> - Port/Endpoint graph links bettween PMIC-Glink, Mux, Redriver and USB PHY nodes.
> 
> WCD939x USBSS port 2 Path to Codec will be added later when Audio support
> is added.
> 
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> ---
[...]

> +&i2c3 {
> +       status = "ok";
"okay"
[...]

> +&i2c6 {
> +	status = "ok";
"okay"


Konrad

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

* Re: [PATCH 1/2] arm64: dts: qcom: sm8650-qrd: add USB-C Altmode Support
  2023-12-19 12:06   ` Konrad Dybcio
@ 2023-12-19 12:20     ` Neil Armstrong
  0 siblings, 0 replies; 5+ messages in thread
From: Neil Armstrong @ 2023-12-19 12:20 UTC (permalink / raw)
  To: Konrad Dybcio, Bjorn Andersson, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Catalin Marinas, Will Deacon
  Cc: linux-arm-msm, devicetree, linux-kernel, linux-arm-kernel

On 19/12/2023 13:06, Konrad Dybcio wrote:
> On 18.12.2023 11:26, Neil Armstrong wrote:
>> Add the necessary nodes to support the USB-C Altmode path by
>> adding the following
>> - WCD939x USBSS Mux I2C device
>> - nb7vpq904m Redriver I2C device
>> - Port/Endpoint graph links bettween PMIC-Glink, Mux, Redriver and USB PHY nodes.
>>
>> WCD939x USBSS port 2 Path to Codec will be added later when Audio support
>> is added.
>>
>> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
>> ---
> [...]
> 
>> +&i2c3 {
>> +       status = "ok";
> "okay"
> [...]
> 
>> +&i2c6 {
>> +	status = "ok";
> "okay"

Thanks, I should have passed DTBS_CHECK first...

> 
> 
> Konrad


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

end of thread, other threads:[~2023-12-19 12:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-18 10:26 [PATCH 0/2] arm64: qcom: sm8650: add support for USB-C Altmode Neil Armstrong
2023-12-18 10:26 ` [PATCH 1/2] arm64: dts: qcom: sm8650-qrd: add USB-C Altmode Support Neil Armstrong
2023-12-19 12:06   ` Konrad Dybcio
2023-12-19 12:20     ` Neil Armstrong
2023-12-18 10:26 ` [PATCH 2/2] arm64: defconfig: enable WCD939x USBSS driver as module Neil Armstrong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).