[PATCH RFC 11/12] arm64: dts: qcom: sdm845-oneplus-common: Enable USB Type-C port controller

From: David Heidelberg via B4 Relay

Date: Sat Sep 26 2026 - 08:42:11 EST


From: David Heidelberg <david@xxxxxxx>

Enable the PMI8998 Type-C port controller with a USB-C connector
description for the OnePlus 6 (enchilada) and OnePlus 6T (fajita),
which share the same USB-C hardware via this common dtsi.

The connector is configured as:
- Sink-only power role with a 5V/3A sink PDO
- Dual-role data with USB role switching

The VBUS output of the charger is not supported yet, so the port can't
act as a power source. Describe it as sink-only until VBUS support lands,
USB host mode is still reachable through a PD data role swap.

Only the HS endpoint (port@0) is wired to the DWC3 controller since
these devices use USB 2.0 only — the QMP USB3+DP combo PHY is not
connected in the OnePlus 6/6T hardware design. Consequently, no
DisplayPort Alt Mode is advertised and no SS orientation switching is
needed.

Switch the DWC3 controller from peripheral-only to OTG mode with
usb-role-switch to allow the TCPM framework to control USB host/device
role based on CC pin detection.

Assisted-by: LLM
Signed-off-by: David Heidelberg <david@xxxxxxx>
---
.../arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 48 +++++++++++++++++++++-
1 file changed, 46 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
index 439779f308e38..c71cbd1effe91 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
@@ -6,16 +6,17 @@
*/

/dts-v1/;

#include <dt-bindings/arm/qcom,ids.h>
#include <dt-bindings/input/linux-event-codes.h>
#include <dt-bindings/leds/common.h>
#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
+#include <dt-bindings/usb/pd.h>
#include <dt-bindings/sound/qcom,q6afe.h>
#include <dt-bindings/sound/qcom,q6asm.h>

#include "sdm845.dtsi"
#include "sdm845-wcd9340.dtsi"
#include "pm8998.dtsi"
#include "pmi8998.dtsi"

@@ -639,16 +640,53 @@ pinconf {
};
};
};

&pmi8998_charger {
status = "okay";
};

+&pmi8998_typec {
+ status = "okay";
+
+ vdd-pdphy-supply = <&vreg_l24a_3p075>;
+
+ connector {
+ compatible = "usb-c-connector";
+
+ /*
+ * Sink only for now, as the PMI8998 charger doesn't provide
+ * the VBUS output yet. Switch to the dual power role with
+ * source PDOs, try-power-role and vbus-supply once it is
+ * supported.
+ */
+ power-role = "sink";
+ data-role = "dual";
+ self-powered;
+
+ sink-pdos = <PDO_FIXED(5000, 3000,
+ PDO_FIXED_USB_COMM |
+ PDO_FIXED_DATA_SWAP)>;
+ op-sink-microwatt = <15000000>;
+
+ 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";

led-0 {
function = LED_FUNCTION_FLASH;
color = <LED_COLOR_ID_WHITE>;
led-sources = <1>;
led-max-microamp = <500000>;
@@ -929,28 +967,34 @@ &usb_1 {
* disable USB3 clock requirement as the device only supports
* USB2.
*/
qcom,select-utmi-as-pipe-clk;
};

&usb_1_dwc3 {
/*
- * We don't have the capability to switch modes yet.
+ * The USB-C role is managed by the pmi8998 Type-C port controller
+ * via usb-role-switch.
*/
- dr_mode = "peripheral";
+ dr_mode = "otg";
+ usb-role-switch;

/* fastest mode for USB 2 */
maximum-speed = "high-speed";

/* 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";

vdd-supply = <&vdda_usb1_ss_core>;
vdda-pll-supply = <&vdda_qusb_hs0_1p8>;
vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>;

qcom,imp-res-offset-value = <8>;

--
2.55.0