From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6424E36215A for ; Mon, 18 May 2026 20:23:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779135796; cv=none; b=mpJRycVlfbciuJuZr+imDS+YB8WKTmftIxWHTASo5ABQ6G3wwr2raYue7IAs2nRlZrSHfB3JiA9UzKxbKOKvijl5VVULcM1q+RmDupMzNKvuf8usnqBKoNdvBabZl/AQ+cCeklSXHq+g1c7u3kKQ6BAMaaRgRZdkyEnKO6Md1VM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779135796; c=relaxed/simple; bh=TYdy6nuGg2H6DLqJvqnXf3NKbUg3XykFU/TUZ5CEuWI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=e1ojGOckVxF7+srJFAg/yNV/giWgKNWY5K5SGOgpZDbuB5Ypk9RFHkfq69WzYe6BXAKbIAs4TlylD+wdwf/54Iu6VfsoKOq+OHRyMRY79SaGesqGLYHnQO18fClKv8hk/eIjBz0LBXPrH7Pt4/+5Sk5YUDlOmjtMIBNp7YXGSxc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=DhHbnNes; arc=none smtp.client-ip=209.85.208.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DhHbnNes" Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-39394e1e8f3so29384191fa.1 for ; Mon, 18 May 2026 13:23:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779135794; x=1779740594; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=V7MgMydFIuv/r1d4/vML1sQi26pQ+VbIk3AiQmKgmmE=; b=DhHbnNesJe2+EWPYUwyEinfP/Kg5FxHd6NLWVezExRXTBICvlq8xhfcts/6OUdR7fo mXo/TsfgiWmX/z9bivqz7LiKH9Xjv1dyHqJ0zHNXt5pJ7+QvdP2UskWeMxnCgdYFKjEU rSXn9xDp1i1zxJ7E0AZd+DgLraEqrh/GOFZ8Zc0rHCD+a0ual9Mt54U6ZfTlu9g7lQUZ iQ3znw2kp1rSCDIrtmjOKB9EtWuxi6v329Fi/f54fF0oWX1Ut5PVluBZY0s22aOB1gWd bPKbDg7gxsSDXJL2NMb8QlwyColEUmZhu03YqFmZTazKJ96L8RfDCt3P7dLJDwCwVls6 FMZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779135794; x=1779740594; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=V7MgMydFIuv/r1d4/vML1sQi26pQ+VbIk3AiQmKgmmE=; b=S23HelkPxG8rubDOTcsLdddJpFXCbw23QdVZmhBJdViRiEYn4G2WCywaltyfiRkaDh dqiXZven67qRPOb+cJVQft7fRcPLmKeV9qVdQQR+QCjB5M71OIThz3nsw9BAHg/Keajm SBq2JzMZJcTAl22Npe88Rj/VIh4SidQYjBLor/72BIcZUMq2HCF+nE8PU90J+Liz5dgZ MLRiPLgO0YEVNSL8/nVmOv2NW3THWCMNE82NgO8rFVIYAXoFUd7C5Ril9jCe0/QuEPpY Vord4UnuFt8fuUpLYQS6Wg5h49LuuQ7ZsxbxxsAnhzNxRO8JRtsWChxM0aUiwbaGRMvs RETw== X-Forwarded-Encrypted: i=1; AFNElJ8XnuV7VJpMDelcQnvZRt6QhKmg2+x1W2YGHYh0w2uH9UNADI+qknw6iQI4UK3UIkpKQC/viaViPGlDrKM=@vger.kernel.org X-Gm-Message-State: AOJu0YxiNc+ppi5c4EXaKGTeIWSdOHJ1afNSz77knpZHiaj8F4jnGFYp 4iwT0GZYQOc+T2MWyLrKj4nD46WSEJVGj95QmpJ3qG0MVXs10KLFw9OW X-Gm-Gg: Acq92OHbr3WTSJ87SbGVytch9cn8Ng6xz4nCHLaCync1iByUJVvpxfNez5Xt7lvHfMP Cbmbnrq626Qho0cOn45FH4bp2B9WMm+foF79P5JKUGCO8m5ZWASZNwWg++C3nARSgjvSZKVZWr5 yrPcMC9Tze1UUicbmwH559LO97fMo41/gj+RdmPaBbOSDkRwu+iB4RU0HE2gqiMJDGL/VJUhI20 7h0qegRUcz5QVwviXAdy4Zemmu1eB+4P1LpQ/tadtJBPTMU8OWTDizIPXd3iqnq0VTS9GPi8KKX uxuzjAcTmwwoW3B0SZ7GxdJ/Wf7wsU/gVI26JP3OsmmG9Oz1p5beCn2T7JQBILquAMv4h1Wlv2x vbB84rOy+ph5EbRJpGd5Mb7srWWBrAFZQLt7koHKWwKUT3j377UK4Hzgijlbh4S7OC2qvoireG3 H6Fwgw4nzxMWZ7m3eh5QWFVDhdbwrCUF6KOgDyEygv X-Received: by 2002:a2e:3318:0:b0:393:a145:54f3 with SMTP id 38308e7fff4ca-39561d62df2mr40726251fa.15.1779135793502; Mon, 18 May 2026 13:23:13 -0700 (PDT) Received: from localhost.localdomain ([90.157.113.57]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-395887b42f8sm15225061fa.36.2026.05.18.13.23.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 18 May 2026 13:23:12 -0700 (PDT) From: taygoth To: linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mark Brown , Liam Girdwood , Wesley Cheng , Greg Kroah-Hartman , Heikki Krogerus , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Bryan O'Donoghue , Casey Connolly 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 Message-ID: X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- .../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