devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] ARM: dts: colibri-imx6ull: Enable dual-role switching
@ 2022-11-15 18:05 Philippe Schenker
  2022-11-19  1:04 ` Shawn Guo
  0 siblings, 1 reply; 2+ messages in thread
From: Philippe Schenker @ 2022-11-15 18:05 UTC (permalink / raw)
  To: devicetree, Shawn Guo
  Cc: Alexander Stein, Philippe Schenker, Fabio Estevam,
	Krzysztof Kozlowski, NXP Linux Team, Pengutronix Kernel Team,
	Rob Herring, Sascha Hauer, linux-arm-kernel, linux-kernel

From: Philippe Schenker <philippe.schenker@toradex.com>

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>

---

Changes in v2:
- Switched from extcon-usb-gpio to usb-connector-gpio

 arch/arm/boot/dts/imx6ull-colibri.dtsi | 29 ++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/arch/arm/boot/dts/imx6ull-colibri.dtsi b/arch/arm/boot/dts/imx6ull-colibri.dtsi
index a4429ba1f2ae..336ab2e0534c 100644
--- a/arch/arm/boot/dts/imx6ull-colibri.dtsi
+++ b/arch/arm/boot/dts/imx6ull-colibri.dtsi
@@ -24,6 +24,28 @@ backlight: backlight {
 		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";
@@ -280,6 +302,13 @@ &usbotg1 {
 	srp-disable;
 	hnp-disable;
 	adp-disable;
+	usb-role-switch;
+
+	port {
+		usb1_drd_sw: endpoint {
+			remote-endpoint = <&usb_dr_connector>;
+		};
+	};
 };
 
 /* Colibri USBH */
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] ARM: dts: colibri-imx6ull: Enable dual-role switching
  2022-11-15 18:05 [PATCH v2] ARM: dts: colibri-imx6ull: Enable dual-role switching Philippe Schenker
@ 2022-11-19  1:04 ` Shawn Guo
  0 siblings, 0 replies; 2+ messages in thread
From: Shawn Guo @ 2022-11-19  1:04 UTC (permalink / raw)
  To: Philippe Schenker
  Cc: devicetree, Alexander Stein, Philippe Schenker, Fabio Estevam,
	Krzysztof Kozlowski, NXP Linux Team, Pengutronix Kernel Team,
	Rob Herring, Sascha Hauer, linux-arm-kernel, linux-kernel

On Tue, Nov 15, 2022 at 07:05:54PM +0100, Philippe Schenker wrote:
> From: Philippe Schenker <philippe.schenker@toradex.com>
> 
> 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>

Applied, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-19  1:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-15 18:05 [PATCH v2] ARM: dts: colibri-imx6ull: Enable dual-role switching Philippe Schenker
2022-11-19  1:04 ` Shawn Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).