ARM: dts: imx7-colibri: add usb dual-role switching using extcon
authorPhilippe Schenker <philippe.schenker@toradex.com>
Mon, 16 May 2022 13:47:14 +0000 (15:47 +0200)
committerShawn Guo <shawnguo@kernel.org>
Sat, 11 Jun 2022 09:13:11 +0000 (17:13 +0800)
Add USB dual-role switching using extcon.

Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
arch/arm/boot/dts/imx7-colibri-eval-v3.dtsi
arch/arm/boot/dts/imx7-colibri.dtsi

index d6fa742..17ad906 100644 (file)
                clock-frequency = <16000000>;
        };
 
+       extcon_usbc_det: usbc-det {
+               compatible = "linux,extcon-usb-gpio";
+               id-gpio = <&gpio7 14 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_usbc_det>;
+       };
+
        gpio-keys {
                compatible = "gpio-keys";
                pinctrl-names = "default";
 };
 
 &usbotg1 {
+       extcon = <0>, <&extcon_usbc_det>;
        status = "okay";
 };
 
index 3c1cfd7..6df82a6 100644 (file)
 };
 
 &usbotg1 {
-       dr_mode = "host";
+       dr_mode = "otg";
 };
 
 &usdhc1 {
 
 &iomuxc {
        pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_gpio1 &pinctrl_gpio2 &pinctrl_gpio3 &pinctrl_gpio4
-                    &pinctrl_usbc_det>;
+       pinctrl-0 = <&pinctrl_gpio1 &pinctrl_gpio2 &pinctrl_gpio3 &pinctrl_gpio4>;
 
        /*
         * Atmel MXT touchsceen + Capacitive Touch Adapter