arm64: dts: qcom: sc8280xp-crd: Introduce pmic_glink
authorBjorn Andersson <bjorn.andersson@linaro.org>
Mon, 13 Feb 2023 21:56:17 +0000 (13:56 -0800)
committerBjorn Andersson <andersson@kernel.org>
Mon, 13 Feb 2023 22:14:38 +0000 (14:14 -0800)
The SC8280XP CRD control over battery management and its two USB Type-C
port using pmic_glink and two GPIO-based SBU muxes.

Enable the two DisplayPort instances, GPIO SBU mux instance and
pmic_glink with the two connectors on the CRD.

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230213215619.1362566-3-quic_bjorande@quicinc.com
arch/arm64/boot/dts/qcom/sc8280xp-crd.dts
arch/arm64/boot/dts/qcom/sc8280xp.dtsi

index 2179c06b4e3bb722e6e7373a738ed0a52e36d6ad..98a0f1f9f01ec84fdf6fb2b3228aa5ad18772e9b 100644 (file)
                stdout-path = "serial0:115200n8";
        };
 
+       pmic-glink {
+               compatible = "qcom,sc8280xp-pmic-glink", "qcom,pmic-glink";
+
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               connector@0 {
+                       compatible = "usb-c-connector";
+                       reg = <0>;
+                       power-role = "dual";
+                       data-role = "dual";
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               port@0 {
+                                       reg = <0>;
+
+                                       pmic_glink_con0_hs: endpoint {
+                                               remote-endpoint = <&usb_0_role_switch>;
+                                       };
+                               };
+
+                               port@1 {
+                                       reg = <1>;
+
+                                       pmic_glink_con0_ss: endpoint {
+                                               remote-endpoint = <&mdss0_dp0_out>;
+                                       };
+                               };
+
+                               port@2 {
+                                       reg = <2>;
+
+                                       pmic_glink_con0_sbu: endpoint {
+                                               remote-endpoint = <&usb0_sbu_mux>;
+                                       };
+                               };
+                       };
+               };
+
+               connector@1 {
+                       compatible = "usb-c-connector";
+                       reg = <1>;
+                       power-role = "dual";
+                       data-role = "dual";
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               port@0 {
+                                       reg = <0>;
+
+                                       pmic_glink_con1_hs: endpoint {
+                                               remote-endpoint = <&usb_1_role_switch>;
+                                       };
+                               };
+
+                               port@1 {
+                                       reg = <1>;
+
+                                       pmic_glink_con1_ss: endpoint {
+                                               remote-endpoint = <&mdss0_dp1_out>;
+                                       };
+                               };
+
+                               port@2 {
+                                       reg = <2>;
+
+                                       pmic_glink_con1_sbu: endpoint {
+                                               remote-endpoint = <&usb1_sbu_mux>;
+                                       };
+                               };
+                       };
+               };
+       };
+
        vreg_edp_3p3: regulator-edp-3p3 {
                compatible = "regulator-fixed";
 
                        linux,cma-default;
                };
        };
+
+       usb0-sbu-mux {
+               compatible = "pericom,pi3usb102", "gpio-sbu-mux";
+
+               enable-gpios = <&tlmm 101 GPIO_ACTIVE_LOW>;
+               select-gpios = <&tlmm 164 GPIO_ACTIVE_HIGH>;
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&usb0_sbu_default>;
+
+               mode-switch;
+               orientation-switch;
+               svid = /bits/ 16 <0xff01>;
+
+               port {
+                       usb0_sbu_mux: endpoint {
+                               remote-endpoint = <&pmic_glink_con0_sbu>;
+                       };
+               };
+       };
+
+       usb1-sbu-mux {
+               compatible = "pericom,pi3usb102", "gpio-sbu-mux";
+
+               enable-gpios = <&tlmm 48 GPIO_ACTIVE_LOW>;
+               select-gpios = <&tlmm 47 GPIO_ACTIVE_HIGH>;
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&usb1_sbu_default>;
+
+               mode-switch;
+               orientation-switch;
+               svid = /bits/ 16 <0xff01>;
+
+               port {
+                       usb1_sbu_mux: endpoint {
+                               remote-endpoint = <&pmic_glink_con1_sbu>;
+                       };
+               };
+       };
 };
 
 &apps_rsc {
        status = "okay";
 };
 
+&mdss0_dp0 {
+       status = "okay";
+};
+
+&mdss0_dp0_out {
+       data-lanes = <0 1>;
+       remote-endpoint = <&pmic_glink_con0_ss>;
+};
+
+&mdss0_dp1 {
+       status = "okay";
+};
+
+&mdss0_dp1_out {
+       data-lanes = <0 1>;
+       remote-endpoint = <&pmic_glink_con1_ss>;
+};
+
 &mdss0_dp3 {
        compatible = "qcom,sc8280xp-edp";
        /delete-property/ #sound-dai-cells;
 };
 
 &usb_0_dwc3 {
-       /* TODO: Define USB-C connector properly */
        dr_mode = "host";
 };
 
        status = "okay";
 };
 
+&usb_0_role_switch {
+       remote-endpoint = <&pmic_glink_con0_hs>;
+};
+
 &usb_1 {
        status = "okay";
 };
 
 &usb_1_dwc3 {
-       /* TODO: Define USB-C connector properly */
        dr_mode = "host";
 };
 
        status = "okay";
 };
 
+&usb_1_role_switch {
+       remote-endpoint = <&pmic_glink_con1_hs>;
+};
+
 &xo_board_clk {
        clock-frequency = <38400000>;
 };
                        drive-strength = <16>;
                };
        };
+
+       usb0_sbu_default: usb0-sbu-state {
+               oe-n-pins {
+                       pins = "gpio101";
+                       function = "gpio";
+                       bias-disable;
+                       drive-strengh = <16>;
+                       output-high;
+               };
+
+               sel-pins {
+                       pins = "gpio164";
+                       function = "gpio";
+                       bias-disable;
+                       drive-strength = <16>;
+               };
+
+               mode-pins {
+                       pins = "gpio167";
+                       function = "gpio";
+                       bias-disable;
+                       drive-strength = <16>;
+                       output-high;
+               };
+       };
+
+       usb1_sbu_default: usb1-sbu-state {
+               oe-n-pins {
+                       pins = "gpio48";
+                       function = "gpio";
+                       bias-disable;
+                       drive-strengh = <16>;
+                       output-high;
+               };
+
+               sel-pins {
+                       pins = "gpio47";
+                       function = "gpio";
+                       bias-disable;
+                       drive-strength = <16>;
+               };
+
+               mode-pins {
+                       pins = "gpio50";
+                       function = "gpio";
+                       bias-disable;
+                       drive-strength = <16>;
+                       output-high;
+               };
+       };
 };
index 92d5b5e21e50f5c0c273f6b5faeaf8eb20c2ed7b..0d02599d8867227eb22c7594dbfeb4da34fc12b3 100644 (file)
                                iommus = <&apps_smmu 0x820 0x0>;
                                phys = <&usb_0_hsphy>, <&usb_0_qmpphy QMP_USB43DP_USB3_PHY>;
                                phy-names = "usb2-phy", "usb3-phy";
+
+                               port {
+                                       usb_0_role_switch: endpoint {
+                                       };
+                               };
                        };
                };
 
                                iommus = <&apps_smmu 0x860 0x0>;
                                phys = <&usb_1_hsphy>, <&usb_1_qmpphy QMP_USB43DP_USB3_PHY>;
                                phy-names = "usb2-phy", "usb3-phy";
+
+                               port {
+                                       usb_1_role_switch: endpoint {
+                                       };
+                               };
                        };
                };
 
 
                                        port@0 {
                                                reg = <0>;
+
                                                mdss0_dp0_in: endpoint {
                                                        remote-endpoint = <&mdss0_intf0_out>;
                                                };
 
                                        port@1 {
                                                reg = <1>;
+
+                                               mdss0_dp0_out: endpoint {
+                                               };
                                        };
                                };
 
 
                                        port@1 {
                                                reg = <1>;
+
+                                               mdss0_dp1_out: endpoint {
+                                               };
                                        };
                                };