From: taygoth <taygoth@gmail.com>
To: linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Mark Brown <broonie@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Wesley Cheng <quic_wcheng@quicinc.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
Casey Connolly <casey.connolly@linaro.org>
Subject: [PATCH 5/6] arm64: dts: qcom: sdm845-oneplus-common: enable USB Type-C role switching
Date: Tue, 19 May 2026 01:22:50 +0500 [thread overview]
Message-ID: <ba3804796cc651aa281deab49234ca52cfdd3696.1779127507.git.taygoth@gmail.com> (raw)
In-Reply-To: <cover.1779127507.git.taygoth@gmail.com>
Enable the PMI8998 Type-C controller and USB OTG VBUS regulator so the
OnePlus 6 and OnePlus 6T can dynamically switch between USB peripheral
and host roles depending on the connected cable, instead of being
locked to peripheral mode at boot.
The dwc3 controller is moved from dr_mode = "peripheral" to "otg" and
gains a usb-role-switch property. The existing usb_1_dwc3_hs endpoint
declared in sdm845.dtsi has its remote-endpoint pointed at the new
pmi8998 Type-C connector subnode. The maximum-speed override is no
longer required because role switching infrastructure handles speed
negotiation through the usb-c-connector.
The VBUS regulator current limits (500 mA - 1.5 A) match the boost
converter capability noted in the downstream qpnp-smb2 charger config.
Signed-off-by: taygoth <taygoth@gmail.com>
---
.../boot/dts/qcom/sdm845-oneplus-common.dtsi | 43 ++++++++++++++++---
1 file changed, 36 insertions(+), 7 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
index 6b7378cf4d49..42badc71ba6a 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
@@ -606,6 +606,36 @@ &pmi8998_charger {
status = "okay";
};
+&pmi8998_vbus {
+ regulator-min-microamp = <500000>;
+ regulator-max-microamp = <1500000>;
+ status = "okay";
+};
+
+&pmi8998_typec {
+ status = "okay";
+
+ connector {
+ compatible = "usb-c-connector";
+ label = "USB-C";
+ power-role = "dual";
+ data-role = "dual";
+ try-power-role = "sink";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ pmi8998_hs_in: endpoint {
+ remote-endpoint = <&usb_1_dwc3_hs>;
+ };
+ };
+ };
+ };
+};
+
&pmi8998_flash {
status = "okay";
@@ -890,19 +920,18 @@ &usb_1 {
};
&usb_1_dwc3 {
- /*
- * We don't have the capability to switch modes yet.
- */
- dr_mode = "peripheral";
-
- /* fastest mode for USB 2 */
- maximum-speed = "high-speed";
+ dr_mode = "otg";
+ usb-role-switch;
/* Remove USB3 phy as it's unused on this device. */
phys = <&usb_1_hsphy>;
phy-names = "usb2-phy";
};
+&usb_1_dwc3_hs {
+ remote-endpoint = <&pmi8998_hs_in>;
+};
+
&usb_1_hsphy {
status = "okay";
--
2.47.3
next prev parent reply other threads:[~2026-05-18 20:23 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-18 20:22 [PATCH 0/6] usb: typec: add Qualcomm PMI8998 USB Type-C role-switch support taygoth
2026-05-18 20:22 ` [PATCH 1/6] dt-bindings: regulator: qcom,usb-vbus-regulator: add PMI8998 taygoth
2026-05-18 21:56 ` Bryan O'Donoghue
2026-05-19 10:51 ` Krzysztof Kozlowski
2026-05-18 20:22 ` [PATCH 2/6] dt-bindings: usb: add Qualcomm PMI8998 Type-C controller taygoth
2026-05-18 22:03 ` Dmitry Baryshkov
2026-05-18 20:22 ` [PATCH 3/6] usb: typec: add Qualcomm PMI8998 role-switch driver taygoth
2026-05-18 21:45 ` Dmitry Baryshkov
2026-05-18 22:07 ` Bryan O'Donoghue
2026-05-18 22:09 ` Bryan O'Donoghue
2026-05-19 10:52 ` Krzysztof Kozlowski
2026-05-18 20:22 ` [PATCH 4/6] arm64: dts: qcom: pmi8998: add USB Type-C and VBUS regulator nodes taygoth
2026-05-18 20:22 ` taygoth [this message]
2026-05-18 20:22 ` [PATCH 6/6] MAINTAINERS: add entry for Qualcomm PMI8998 USB Type-C driver taygoth
2026-05-18 21:59 ` [PATCH 0/6] usb: typec: add Qualcomm PMI8998 USB Type-C role-switch support Bryan O'Donoghue
[not found] ` <CAFPzRonyVt9Kd+Sc0ooNz8By6b-Zr_jHr0sBXv-M25dQ0w9Cjg@mail.gmail.com>
2026-05-18 23:43 ` Bryan O'Donoghue
2026-05-20 15:00 ` Dmitry Baryshkov
2026-05-19 11:12 ` Konrad Dybcio
2026-07-28 8:25 ` David Heidelberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ba3804796cc651aa281deab49234ca52cfdd3696.1779127507.git.taygoth@gmail.com \
--to=taygoth@gmail.com \
--cc=andersson@kernel.org \
--cc=broonie@kernel.org \
--cc=bryan.odonoghue@linaro.org \
--cc=casey.connolly@linaro.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=quic_wcheng@quicinc.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®