arm64: dts: qcom: sdm632-fairphone-fp3: enable USB-C port handling
authorLuca Weiss <luca.weiss@fairphone.com>
Tue, 20 Feb 2024 12:01:22 +0000 (13:01 +0100)
committerBjorn Andersson <andersson@kernel.org>
Mon, 18 Mar 2024 03:24:50 +0000 (22:24 -0500)
Add the definition for the USB-C connector found on this phone and hook
up the relevant bits. This enables USB role switching.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Link: https://lore.kernel.org/r/20240220-fp3-typec-v1-1-1930cad81139@fairphone.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
arch/arm64/boot/dts/qcom/msm8953.dtsi
arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts

index f1011bb641c619c2331fcca2b920151241ead05b..5d818fe057ddb419f89f26363fbc61132ce3dc6d 100644 (file)
                                snps,hird-threshold = /bits/ 8 <0x00>;
 
                                maximum-speed = "high-speed";
+
+                               usb-role-switch;
+
+                               ports {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       port@0 {
+                                               reg = <0>;
+
+                                               usb_dwc3_hs: endpoint {
+                                               };
+                                       };
+                               };
                        };
                };
 
index 057579ae30138d343477e8cc4db5ccca46d3b128..e2708c74e95afd2f199306a9e868f2bbd6f26de3 100644 (file)
        };
 };
 
+&pmi632_typec {
+       status = "okay";
+
+       connector {
+               compatible = "usb-c-connector";
+
+               power-role = "dual";
+               data-role = "dual";
+               self-powered;
+
+               typec-power-opmode = "default";
+               pd-disable;
+
+               port {
+                       pmi632_hs_in: endpoint {
+                               remote-endpoint = <&usb_dwc3_hs>;
+                       };
+               };
+       };
+};
+
+&pmi632_vbus {
+       regulator-min-microamp = <500000>;
+       regulator-max-microamp = <1000000>;
+       status = "okay";
+};
+
 &sdhc_1 {
        status = "okay";
        vmmc-supply = <&pm8953_l8>;
        status = "okay";
 };
 
-&usb3_dwc3 {
-       dr_mode = "peripheral";
+&usb_dwc3_hs {
+       remote-endpoint = <&pmi632_hs_in>;
 };
 
 &wcnss {