ARM: dts: colibri-imx6ull: Enable dual-role switching
authorPhilippe Schenker <philippe.schenker@toradex.com>
Tue, 15 Nov 2022 18:05:54 +0000 (19:05 +0100)
committerShawn Guo <shawnguo@kernel.org>
Sat, 19 Nov 2022 01:04:09 +0000 (09:04 +0800)
The Colibri standard provides a GPIO called USBC_DET to switch from
USB Host to USB Device and back. Make use of this GPIO by adding it
with usb-connector framework.

Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
arch/arm/boot/dts/imx6ull-colibri.dtsi

index a4429ba1f2aec534b2eeb7db6647a44ec3b208b1..336ab2e0534c0e05c60fe42f1e627514711b8735 100644 (file)
                status = "disabled";
        };
 
+       connector {
+               compatible = "gpio-usb-b-connector", "usb-b-connector";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_snvs_usbc_det>;
+               id-gpios = <&gpio5 2 GPIO_ACTIVE_HIGH>; /* SODIMM 137 / USBC_DET */
+               label = "USBC";
+               self-powered;
+               type = "micro";
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               usb_dr_connector: endpoint {
+                                       remote-endpoint = <&usb1_drd_sw>;
+                               };
+                       };
+               };
+       };
+
        gpio-keys {
                compatible = "gpio-keys";
                pinctrl-names = "default";
        srp-disable;
        hnp-disable;
        adp-disable;
+       usb-role-switch;
+
+       port {
+               usb1_drd_sw: endpoint {
+                       remote-endpoint = <&usb_dr_connector>;
+               };
+       };
 };
 
 /* Colibri USBH */