linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: imx8mp-venice-gw74xx: add USB DR support
@ 2022-09-08 15:42 Tim Harvey
  2022-09-13  2:10 ` Shawn Guo
  0 siblings, 1 reply; 2+ messages in thread
From: Tim Harvey @ 2022-09-08 15:42 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, devicetree
  Cc: NXP Linux Team, Fabio Estevam, Pengutronix Kernel Team,
	Sascha Hauer, Shawn Guo, Krzysztof Kozlowski, Rob Herring,
	Alexander Stein, Jun Li, Tim Harvey

Add support for USB DR on USB1 interface. Host/Device detection is done
using the usb-role-switch connector with a GPIO as USB1_OTG_ID is not
connected internally.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
 .../dts/freescale/imx8mp-venice-gw74xx.dts    | 30 +++++++++++++++----
 1 file changed, 25 insertions(+), 5 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts b/arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts
index 9fb492a8b045..e0fe356b662d 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts
+++ b/arch/arm64/boot/dts/freescale/imx8mp-venice-gw74xx.dts
@@ -598,20 +598,35 @@ &uart4 {
 };
 
 /* USB1 - Type C front panel */
-&usb3_phy0 {
+&usb3_0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_usb1>;
+	fsl,over-current-active-low;
 	status = "okay";
 };
 
-&usb3_0 {
-	fsl,over-current-active-low;
+&usb3_phy0 {
 	status = "okay";
 };
 
 &usb_dwc3_0 {
-	dr_mode = "host";
+	/* dual role is implemented but not a full featured OTG */
+	adp-disable;
+	hnp-disable;
+	srp-disable;
+	dr_mode = "otg";
+	usb-role-switch;
+	role-switch-default-mode = "peripheral";
 	status = "okay";
+
+	connector {
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_usbcon1>;
+		compatible = "gpio-usb-b-connector", "usb-b-connector";
+		type = "micro";
+		label = "Type-C";
+		id-gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
+	};
 };
 
 /* USB2 - USB3.0 Hub */
@@ -870,7 +885,12 @@ MX8MP_IOMUXC_UART4_TXD__UART4_DCE_TX	0x140
 	pinctrl_usb1: usb1grp {
 		fsl,pins = <
 			MX8MP_IOMUXC_GPIO1_IO13__USB1_OTG_OC	0x140
-			MX8MP_IOMUXC_GPIO1_IO10__USB1_OTG_ID	0x140
+		>;
+	};
+
+	pinctrl_usbcon1: usb1congrp {
+		fsl,pins = <
+			MX8MP_IOMUXC_GPIO1_IO10__GPIO1_IO10	0x140
 		>;
 	};
 
-- 
2.25.1


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

* Re: [PATCH] arm64: dts: imx8mp-venice-gw74xx: add USB DR support
  2022-09-08 15:42 [PATCH] arm64: dts: imx8mp-venice-gw74xx: add USB DR support Tim Harvey
@ 2022-09-13  2:10 ` Shawn Guo
  0 siblings, 0 replies; 2+ messages in thread
From: Shawn Guo @ 2022-09-13  2:10 UTC (permalink / raw)
  To: Tim Harvey
  Cc: linux-arm-kernel, linux-kernel, devicetree, NXP Linux Team,
	Fabio Estevam, Pengutronix Kernel Team, Sascha Hauer,
	Krzysztof Kozlowski, Rob Herring, Alexander Stein, Jun Li

On Thu, Sep 08, 2022 at 08:42:27AM -0700, Tim Harvey wrote:
> Add support for USB DR on USB1 interface. Host/Device detection is done
> using the usb-role-switch connector with a GPIO as USB1_OTG_ID is not
> connected internally.
> 
> Signed-off-by: Tim Harvey <tharvey@gateworks.com>

Applied, thanks!

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

end of thread, other threads:[~2022-09-13  2:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-08 15:42 [PATCH] arm64: dts: imx8mp-venice-gw74xx: add USB DR support Tim Harvey
2022-09-13  2:10 ` 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).