devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: dts: colibri-imx6ull: Enable dual-role switching
@ 2022-11-02 15:52 Philippe Schenker
  2022-11-03  7:46 ` Alexander Stein
  0 siblings, 1 reply; 5+ messages in thread
From: Philippe Schenker @ 2022-11-02 15:52 UTC (permalink / raw)
  To: Shawn Guo, devicetree
  Cc: 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. The Colibri iMX6ULL does have the SoC
ball USB_OTG1_VBUS connected in series with a capacitor to ground.

This means that we need to provide to the extcon framework VBUS and ID
events using the single GPIO we have. The Extcon USB GPIO driver does
use id-gpio also for VBUS event, as in our case where vbus-gpio is
absent.

Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>

---

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

diff --git a/arch/arm/boot/dts/imx6ull-colibri.dtsi b/arch/arm/boot/dts/imx6ull-colibri.dtsi
index 577a424b0e1d..feb1fcd9a684 100644
--- a/arch/arm/boot/dts/imx6ull-colibri.dtsi
+++ b/arch/arm/boot/dts/imx6ull-colibri.dtsi
@@ -24,6 +24,13 @@ backlight: backlight {
 		status = "okay";
 	};
 
+	extcon_usbc_det: usbc-det {
+		compatible = "linux,extcon-usb-gpio";
+		id-gpio = <&gpio5 2 GPIO_ACTIVE_HIGH>; /* SODIMM 137 / USBC_DET */
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_snvs_usbc_det>;
+	};
+
 	gpio-keys {
 		compatible = "gpio-keys";
 		pinctrl-names = "default";
@@ -275,6 +282,7 @@ &uart5 {
 /* Colibri USBC */
 &usbotg1 {
 	dr_mode = "otg";
+	extcon = <&extcon_usbc_det>, <&extcon_usbc_det>;
 	srp-disable;
 	hnp-disable;
 	adp-disable;
-- 
2.38.1


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

end of thread, other threads:[~2022-11-11  5:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-02 15:52 [PATCH] ARM: dts: colibri-imx6ull: Enable dual-role switching Philippe Schenker
2022-11-03  7:46 ` Alexander Stein
2022-11-03  8:04   ` Francesco Dolcini
2022-11-07 12:00     ` Philippe Schenker
2022-11-11  5:17     ` 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).