[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250502-mtk-genio-510-700-fix-bt-detection-v2-1-870aa2145480@collabora.com>
Date: Fri, 02 May 2025 15:17:19 +0200
From: Louis-Alexis Eyraud <louisalexis.eyraud@...labora.com>
To: Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
Cc: kernel@...labora.com, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org,
Louis-Alexis Eyraud <louisalexis.eyraud@...labora.com>
Subject: [PATCH v2] arm64: dts: mediatek: mt8390-genio-common: Set ssusb2
default dual role mode to host
On the Mediatek Genio 510-EVK and 700-EVK boards, ssusb2 controller is
one but has two ports: one is routed to the M.2 slot, the other is on
the RPi header who does support full OTG.
Since Mediatek Genio 700-EVK USB support was added, dual role mode
property is set to otg for ssusb2. This config prevents the M.2
Wifi/Bluetooth module, present on those boards and exposing Bluetooth
as an USB device to be properly detected at startup as the default role
is device.
To keep the OTG functionality and make the M.2 module be detected at
the same time, add role-switch-default-mode property set to host and
also fix the polarity of GPIO associated to the USB connector, so the
ssusb2 controller role is properly set to host when the other port is
unused.
Fixes: 1afaeca17238 ("arm64: dts: mediatek: mt8390-genio-700: Add USB, TypeC Controller, MUX")
Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@...labora.com>
---
I've tested this patch on Mediatek Genio 510-EVK board with a kernel
based on linux-next (tag: next-20250502).
---
Changes in v2:
- Remove dr_mode property change and add role-switch-default-mode one
instead, as suggested by AngeloGioacchino Del Regno
- Fix USB connector GPIO polarity
- Reword comment in ssusb2 node to match v2 fix
- Reword commit message and title
- Rebase on linux-next (tag: next-20250502)
- Link to v1: https://lore.kernel.org/r/20250331-mtk-genio-510-700-fix-bt-detection-v1-1-34ea2cf137f3@collabora.com
---
arch/arm64/boot/dts/mediatek/mt8390-genio-common.dtsi | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/mediatek/mt8390-genio-common.dtsi b/arch/arm64/boot/dts/mediatek/mt8390-genio-common.dtsi
index 127764c4d6be81767ef534a7cb228989f471b3bd..aa8dd12a84ea9d8e0e879067c45f59563455b077 100644
--- a/arch/arm64/boot/dts/mediatek/mt8390-genio-common.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8390-genio-common.dtsi
@@ -1333,8 +1333,18 @@ xhci_ss_ep: endpoint {
};
&ssusb2 {
+ /*
+ * the ssusb2 controller is one but we got two ports : one is routed
+ * to the M.2 slot, the other is on the RPi header who does support
+ * full OTG.
+ * As the controller is shared between them, the role switch default
+ * mode is set to host to make any peripheral inserted in the M.2
+ * slot (i.e BT/WIFI module) be detected when the other port is
+ * unused.
+ */
dr_mode = "otg";
maximum-speed = "high-speed";
+ role-switch-default-mode = "host";
usb-role-switch;
vusb33-supply = <&mt6359_vusb_ldo_reg>;
wakeup-source;
@@ -1345,7 +1355,7 @@ &ssusb2 {
connector {
compatible = "gpio-usb-b-connector", "usb-b-connector";
type = "micro";
- id-gpios = <&pio 89 GPIO_ACTIVE_HIGH>;
+ id-gpios = <&pio 89 GPIO_ACTIVE_LOW>;
vbus-supply = <&usb_p2_vbus>;
};
};
---
base-commit: 1c51b1ba38c07e4f999802eb708bf798dd5f5d1b
change-id: 20250328-mtk-genio-510-700-fix-bt-detection-2711cbcbb2e4
Best regards,
--
Louis-Alexis Eyraud <louisalexis.eyraud@...labora.com>
Powered by blists - more mailing lists