Enable the PM8150B Type-C controller in sink mode with PDO_VAR up to
9V/3A, and connect the OF graph endpoints for USB DWC3 and SuperSpeed
QMP PHY orientation switching.

Signed-off-by: Abdur Rofik <[email protected]>
---
 arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts | 47 +++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts 
b/arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts
index 160b6f4c98b17..3ce8161574a95 100644
--- a/arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts
+++ b/arch/arm64/boot/dts/qcom/sm8250-lg-timelm.dts
@@ -9,6 +9,7 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
+#include <dt-bindings/usb/pd.h>
 #include "sm8250.dtsi"
 #include "pm8150.dtsi"
 #include "pm8150b.dtsi"
@@ -556,6 +557,44 @@ volume_down_state: volume-down-state {
        };
 };
 
+&pm8150b_typec {
+       status = "okay";
+
+       vdd-pdphy-supply = <&vreg_l2a_3p1>;
+
+       connector {
+               compatible = "usb-c-connector";
+
+               power-role = "sink";
+               data-role = "device";
+               self-powered;
+
+               op-sink-microwatt = <15000000>;
+               sink-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)
+                            PDO_VAR(5000, 9000, 3000)>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+
+                               pm8150b_hs_in: endpoint {
+                                       remote-endpoint = <&usb_1_dwc3_hs_out>;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+
+                               pm8150b_typec_mux: endpoint {
+                                       remote-endpoint = <&usb_1_qmpphy_out>;
+                               };
+                       };
+               };
+       };
+};
 &pon_pwrkey {
        status = "okay";
 };
@@ -660,6 +699,10 @@ &usb_1_dwc3 {
        dr_mode = "peripheral";
 };
 
+&usb_1_dwc3_hs_out {
+       remote-endpoint = <&pm8150b_hs_in>;
+};
+
 &usb_1_hsphy {
        status = "okay";
 
@@ -674,3 +717,7 @@ &usb_1_qmpphy {
        vdda-phy-supply = <&vreg_l18a_0p9>;
        vdda-pll-supply = <&vreg_l9a_1p2>;
 };
+
+&usb_1_qmpphy_out {
+       remote-endpoint = <&pm8150b_typec_mux>;
+};
-- 
2.39.5

Reply via email to