arm64: dts: qcom: qcm6490-fairphone-fp5: Add PMIC GLINK
authorLuca Weiss <luca.weiss@fairphone.com>
Wed, 20 Dec 2023 10:02:58 +0000 (11:02 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Feb 2024 15:50:17 +0000 (16:50 +0100)
Via the PMIC GLINK driver we can get info about fuel gauge, charger and
USB connector events. Add the node to the dts and configure USB so that
role switching works.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20231220-fp5-pmic-glink-v1-3-2a1f8e3c661c@fairphone.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
arch/arm64/boot/dts/qcom/sc7280.dtsi

index 176898c9dbbd72672dce448f4b747aef022820e3..e9076d92ebd1dd2ee69242e82ac1ec18c4f874d6 100644 (file)
                };
        };
 
+       pmic-glink {
+               compatible = "qcom,qcm6490-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_hs_in: endpoint {
+                                               remote-endpoint = <&usb_1_dwc3_hs>;
+                                       };
+                               };
+
+                               port@1 {
+                                       reg = <1>;
+
+                                       pmic_glink_ss_in: endpoint {
+                                               remote-endpoint = <&usb_1_dwc3_ss>;
+                                       };
+                               };
+                       };
+               };
+       };
+
        reserved-memory {
                cont_splash_mem: cont-splash@e1000000 {
                        reg = <0x0 0xe1000000 0x0 0x2300000>;
 };
 
 &usb_1_dwc3 {
-       dr_mode = "peripheral";
+       dr_mode = "otg";
+       usb-role-switch;
+};
+
+&usb_1_dwc3_hs {
+       remote-endpoint = <&pmic_glink_hs_in>;
+};
+
+&usb_1_dwc3_ss {
+       remote-endpoint = <&pmic_glink_ss_in>;
 };
 
 &usb_1_hsphy {
index 83b5b76ba17940e4582a680b039cdb8c17acc19e..f5ca69dd7eeb330196d28024ec8821f459fa4314 100644 (file)
                                phys = <&usb_1_hsphy>, <&usb_1_qmpphy QMP_USB43DP_USB3_PHY>;
                                phy-names = "usb2-phy", "usb3-phy";
                                maximum-speed = "super-speed";
+
+                               ports {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       port@0 {
+                                               reg = <0>;
+
+                                               usb_1_dwc3_hs: endpoint {
+                                               };
+                                       };
+
+                                       port@1 {
+                                               reg = <1>;
+
+                                               usb_1_dwc3_ss: endpoint {
+                                               };
+                                       };
+                               };
                        };
                };