linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: rockchip: fix rk3399-puma-haikou USB OTG mode
@ 2022-01-20 12:51 quentin.schulz
  2022-01-23 15:40 ` Heiko Stuebner
  0 siblings, 1 reply; 2+ messages in thread
From: quentin.schulz @ 2022-01-20 12:51 UTC (permalink / raw)
  To: robh+dt, heiko
  Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
	Quentin Schulz, Quentin Schulz

From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

The micro USB3.0 port available on the Haikou evaluation kit for Puma
RK3399-Q7 SoM supports dual-role model (aka drd or OTG) but its support
was broken until now because of missing logic around the ID pin.

This adds proper support for USB OTG on Puma Haikou by "connecting" the
GPIO used for USB ID to the USB3 controller device.

Cc: Quentin Schulz <foss+kernel@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 .../arm64/boot/dts/rockchip/rk3399-puma-haikou.dts |  1 +
 arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi      | 14 ++++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
index 292bb7e80cf3..2564ef28d256 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
@@ -231,6 +231,7 @@ &usbdrd3_0 {
 };
 
 &usbdrd_dwc3_0 {
+	extcon = <&extcon_usb3>;
 	dr_mode = "otg";
 	status = "okay";
 };
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
index fb67db4619ea..c9a563ae3cfd 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
@@ -32,6 +32,13 @@ clkin_gmac: external-gmac-clock {
 		#clock-cells = <0>;
 	};
 
+	extcon_usb3: extcon-usb3 {
+		compatible = "linux,extcon-usb-gpio";
+		id-gpio = <&gpio1 RK_PC2 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&usb3_id>;
+	};
+
 	vcc1v2_phy: vcc1v2-phy {
 		compatible = "regulator-fixed";
 		regulator-name = "vcc1v2_phy";
@@ -422,6 +429,13 @@ vcc5v0_host_en: vcc5v0-host-en {
 			  <4 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
 		};
 	};
+
+	usb3 {
+		usb3_id: usb3-id {
+			rockchip,pins =
+			  <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
 };
 
 &sdhci {
-- 
2.34.1


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

* Re: [PATCH] arm64: dts: rockchip: fix rk3399-puma-haikou USB OTG mode
  2022-01-20 12:51 [PATCH] arm64: dts: rockchip: fix rk3399-puma-haikou USB OTG mode quentin.schulz
@ 2022-01-23 15:40 ` Heiko Stuebner
  0 siblings, 0 replies; 2+ messages in thread
From: Heiko Stuebner @ 2022-01-23 15:40 UTC (permalink / raw)
  To: quentin.schulz, robh+dt
  Cc: Heiko Stuebner, linux-arm-kernel, devicetree, linux-rockchip,
	Quentin Schulz, linux-kernel

On Thu, 20 Jan 2022 13:51:56 +0100, quentin.schulz@theobroma-systems.com wrote:
> The micro USB3.0 port available on the Haikou evaluation kit for Puma
> RK3399-Q7 SoM supports dual-role model (aka drd or OTG) but its support
> was broken until now because of missing logic around the ID pin.
> 
> This adds proper support for USB OTG on Puma Haikou by "connecting" the
> GPIO used for USB ID to the USB3 controller device.

Applied as fix for 5.17, thanks!

[1/1] arm64: dts: rockchip: fix rk3399-puma-haikou USB OTG mode
      commit: ed2c66a95c0c5669880aa93d0d34c6e9694b4cbd

I've done a bit of reordereing:
- extcon comes alphabetically after dr_mode
- extcon-usb3 before external-gmac...


Best regards,
-- 
Heiko Stuebner <heiko@sntech.de>

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

end of thread, other threads:[~2022-01-23 15:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-20 12:51 [PATCH] arm64: dts: rockchip: fix rk3399-puma-haikou USB OTG mode quentin.schulz
2022-01-23 15:40 ` Heiko Stuebner

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).