]> www.infradead.org Git - linux.git/commitdiff
arm64: dts: qcom: sm8150-hdk: enable DisplayPort and USB-C altmode
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Fri, 15 Dec 2023 17:40:39 +0000 (19:40 +0200)
committerBjorn Andersson <andersson@kernel.org>
Sun, 17 Dec 2023 05:19:15 +0000 (23:19 -0600)
Enable the USB-C related functionality for the USB-C port on this board.
This includes OTG, PowerDelivery and DP AltMode. Also enable the
DisplayPort itself.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20231215174152.315403-8-dmitry.baryshkov@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
arch/arm64/boot/dts/qcom/sm8150-hdk.dts

index ea4d75308ac809f8a54636052e87a72ee5b2f7ad..de670b407ef1425f7de2d2aa822a574a3a7496e3 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/usb/pd.h>
 #include "sm8150.dtsi"
 #include "pm8150.dtsi"
 #include "pm8150b.dtsi"
        status = "okay";
 };
 
+&gpi_dma0 {
+       status = "okay";
+};
+
 &gpi_dma1 {
        status = "okay";
 };
        status = "okay";
 };
 
+&i2c4 {
+       clock-frequency = <100000>;
+
+       status = "okay";
+
+       typec-mux@42 {
+               compatible = "fcs,fsa4480";
+               reg = <0x42>;
+
+               interrupts-extended = <&tlmm 152 IRQ_TYPE_LEVEL_LOW>;
+
+               vcc-supply = <&vreg_bob>;
+               mode-switch;
+               orientation-switch;
+
+               port {
+                       fsa4480_sbu_mux: endpoint {
+                               remote-endpoint = <&pm8150b_typec_sbu_out>;
+                       };
+               };
+       };
+};
+
 &i2c9 {
        status = "okay";
        clock-frequency = <400000>;
        status = "okay";
 };
 
+&mdss_dp {
+       status = "okay";
+};
+
+&mdss_dp_out {
+       data-lanes = <0 1>;
+       remote-endpoint = <&usb_1_qmpphy_dp_in>;
+};
+
 &mdss_dsi0 {
        status = "okay";
        vdda-supply = <&vreg_l3c_1p2>;
        status = "okay";
 };
 
+&pm8150b_vbus {
+       regulator-min-microamp = <500000>;
+       regulator-max-microamp = <3000000>;
+       status = "okay";
+};
+
+&pm8150b_typec {
+       status = "okay";
+
+       vdd-pdphy-supply = <&vreg_l2a_3p1>;
+
+       connector {
+               compatible = "usb-c-connector";
+
+               power-role = "source";
+               data-role = "dual";
+               self-powered;
+
+               source-pdos = <PDO_FIXED(5000, 3000,
+                                        PDO_FIXED_DUAL_ROLE |
+                                        PDO_FIXED_USB_COMM |
+                                        PDO_FIXED_DATA_SWAP)>;
+
+               altmodes {
+                       displayport {
+                               svid = /bits/ 16 <0xff01>;
+                               vdo = <0x00001c46>;
+                       };
+               };
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               pm8150b_role_switch_in: endpoint {
+                                       remote-endpoint = <&usb_1_dwc3_hs>;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                               pm8150b_typec_mux_in: endpoint {
+                                       remote-endpoint = <&usb_1_qmpphy_out>;
+                               };
+                       };
+
+                       port@2 {
+                               reg = <2>;
+
+                               pm8150b_typec_sbu_out: endpoint {
+                                       remote-endpoint = <&fsa4480_sbu_mux>;
+                               };
+                       };
+               };
+       };
+};
+
 &pon_pwrkey {
        status = "okay";
 };
        linux,code = <KEY_VOLUMEDOWN>;
 };
 
+&qupv3_id_0 {
+       status = "okay";
+};
+
 &qupv3_id_1 {
        status = "okay";
 };
        status = "okay";
        vdda-phy-supply = <&vreg_l3c_1p2>;
        vdda-pll-supply = <&vreg_l18a_0p8>;
+       orientation-switch;
+};
+
+&usb_1_qmpphy_dp_in {
+       remote-endpoint = <&mdss_dp_out>;
+};
+
+&usb_1_qmpphy_out {
+       remote-endpoint = <&pm8150b_typec_mux_in>;
+};
+
+&usb_1_qmpphy_usb_ss_in {
+       remote-endpoint = <&usb_1_dwc3_ss>;
 };
 
 &usb_2_qmpphy {
 };
 
 &usb_1_dwc3 {
-       dr_mode = "peripheral";
+       dr_mode = "otg";
+       usb-role-switch;
+};
+
+&usb_1_dwc3_hs {
+       remote-endpoint = <&pm8150b_role_switch_in>;
+};
+
+&usb_1_dwc3_ss {
+       remote-endpoint = <&usb_1_qmpphy_usb_ss_in>;
 };
 
 &usb_2_dwc3 {