]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
arm64: dts: imx8mp-kontron: Fix USB OTG role switching
authorFrieder Schrempf <frieder.schrempf@kontron.de>
Mon, 20 Oct 2025 13:21:51 +0000 (15:21 +0200)
committerShawn Guo <shawnguo@kernel.org>
Tue, 28 Oct 2025 09:01:42 +0000 (17:01 +0800)
The VBUS supply regulator is currently assigned to the PHY node.
This causes the VBUS to be always on, even when the controller
needs to be switched to peripheral mode.

Fix the OTG role switching by adding a connector node and moving
the VBUS supply regulator to that node. This way the VBUS gets
correctly switched according to the current role.

Fixes: 946ab10e3f40 ("arm64: dts: Add support for Kontron OSM-S i.MX8MP SoM and BL carrier board")
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
arch/arm64/boot/dts/freescale/imx8mp-kontron-bl-osm-s.dts

index 614b4ce330b1cb85eb3592d28a1c56d182f9075e..0924ac50fd2dbccaa547f4e8850b848a6391c594 100644 (file)
                ethernet1 = &eqos;
        };
 
-       extcon_usbc: usbc {
-               compatible = "linux,extcon-usb-gpio";
+       connector {
+               compatible = "gpio-usb-b-connector", "usb-b-connector";
+               id-gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
+               label = "Type-C";
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_usb1_id>;
-               id-gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
+               type = "micro";
+               vbus-supply = <&reg_usb1_vbus>;
+
+               port {
+                       usb_dr_connector: endpoint {
+                               remote-endpoint = <&usb3_dwc>;
+                       };
+               };
        };
 
        leds {
        hnp-disable;
        srp-disable;
        dr_mode = "otg";
-       extcon = <&extcon_usbc>;
        usb-role-switch;
+       role-switch-default-mode = "peripheral";
        status = "okay";
+
+       port {
+               usb3_dwc: endpoint {
+                       remote-endpoint = <&usb_dr_connector>;
+               };
+       };
 };
 
 &usb_dwc3_1 {
 };
 
 &usb3_phy0 {
-       vbus-supply = <&reg_usb1_vbus>;
        status = "okay";
 };