]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
arm64: dts: qcom: lemans-evk: Add OTG support for primary USB controller
authorKrishna Kurapati <krishna.kurapati@oss.qualcomm.com>
Fri, 28 Nov 2025 10:25:07 +0000 (15:55 +0530)
committerBjorn Andersson <andersson@kernel.org>
Sat, 3 Jan 2026 18:42:36 +0000 (12:42 -0600)
Enable OTG support for primary USB controller on EVK Platform. Add
HD3SS3220 Type-C port controller present between Type-C port and SoC
that provides role switch notifications to controller.

Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20251128102507.3206169-1-krishna.kurapati@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
arch/arm64/boot/dts/qcom/lemans-evk.dts
arch/arm64/boot/dts/qcom/lemans.dtsi

index 02f886e0d2ce82b90630ca5cc99c2ef947a86f34..90fce947ca7e5c4af49952b012647664cffbb687 100644 (file)
                stdout-path = "serial0:115200n8";
        };
 
+       connector-0 {
+               compatible = "usb-c-connector";
+               label = "USB0-Type-C";
+               data-role = "dual";
+               power-role = "dual";
+
+               vbus-supply = <&vbus_supply_regulator_0>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+
+                               usb0_con_hs_ep: endpoint {
+                                       remote-endpoint = <&usb_0_dwc3_hs>;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+
+                               usb0_con_ss_ep: endpoint {
+                                       remote-endpoint = <&hd3ss3220_in_ep>;
+                               };
+                       };
+               };
+       };
+
        edp0-connector {
                compatible = "dp-connector";
                label = "EDP0";
                };
        };
 
+       vbus_supply_regulator_0: regulator-vbus-supply-0 {
+               compatible = "regulator-fixed";
+               regulator-name = "vbus_supply_0";
+               gpio = <&expander1 2 GPIO_ACTIVE_HIGH>;
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               enable-active-high;
+       };
+
        vmmc_sdc: regulator-vmmc-sdc {
                compatible = "regulator-fixed";
 
        firmware-name = "qcom/sa8775p/a663_zap.mbn";
 };
 
+&i2c11 {
+       status = "okay";
+
+       usb-typec@67 {
+               compatible = "ti,hd3ss3220";
+               reg = <0x67>;
+
+               interrupts-extended = <&pmm8654au_2_gpios 5 IRQ_TYPE_EDGE_FALLING>;
+
+               id-gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>;
+
+               pinctrl-0 = <&usb_id>, <&usb0_intr_state>;
+               pinctrl-names = "default";
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+
+                               hd3ss3220_in_ep: endpoint {
+                                       remote-endpoint = <&usb0_con_ss_ep>;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+
+                               hd3ss3220_out_ep: endpoint {
+                                       remote-endpoint = <&usb_0_dwc3_ss>;
+                               };
+                       };
+               };
+       };
+};
+
 &i2c18 {
        status = "okay";
 
        status = "okay";
 };
 
+&pmm8654au_2_gpios {
+       usb0_intr_state: usb0-intr-state {
+               pins = "gpio5";
+               function = "normal";
+               input-enable;
+               bias-pull-up;
+               power-source = <0>;
+       };
+};
+
 &qup_i2c19_default {
        drive-strength = <2>;
        bias-pull-up;
                };
        };
 
+       qup_i2c11_default: qup-i2c11-state {
+               pins = "gpio48", "gpio49";
+               function = "qup1_se4";
+               drive-strength = <2>;
+               bias-pull-up;
+       };
+
        sd_cd: sd-cd-state {
                pins = "gpio36";
                function = "gpio";
                bias-pull-up;
        };
+
+       usb_id: usb-id-state {
+               pins = "gpio50";
+               function = "gpio";
+               bias-pull-up;
+       };
 };
 
 &uart10 {
 };
 
 &usb_0 {
-       dr_mode = "peripheral";
-
        status = "okay";
 };
 
+&usb_0_dwc3_hs {
+       remote-endpoint = <&usb0_con_hs_ep>;
+};
+
+&usb_0_dwc3_ss {
+       remote-endpoint = <&hd3ss3220_out_ep>;
+};
+
 &usb_0_hsphy {
        vdda-pll-supply = <&vreg_l7a>;
        vdda18-supply = <&vreg_l6c>;
index d383d1f8bb9d08df22b28b51997f0c207e5b5b9e..d0d8711ea9c68ed8f1f7170acb2f2f14d5800e85 100644 (file)
                        snps,dis-u1-entry-quirk;
                        snps,dis-u2-entry-quirk;
 
+                       usb-role-switch;
                        status = "disabled";
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               port@0 {
+                                       reg = <0>;
+
+                                       usb_0_dwc3_hs: endpoint {
+                                       };
+                               };
+
+                               port@1 {
+                                       reg = <1>;
+
+                                       usb_0_dwc3_ss: endpoint {
+                                       };
+                               };
+                       };
                };
 
                usb_1: usb@a800000 {