From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 30C9A44063B; Sat, 26 Sep 2026 12:40:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790426434; cv=none; b=TiC+XCX/FPFCtCRV1vjI2eti+8LUlGu7W6k5F3O5otrOFKr1bZKDzuqVyMfOlzylOjfdESGFu0d6EH4un7HBDugAwBzlmM0zDe/HQS1yruvb63i+PtJpNPHsEVLKI7uote3XLF1iO1YSEkusOH0SyAEhlGTLC8eQIhPnNXP0L1E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790426434; c=relaxed/simple; bh=tR7p4+86bpeoj1XWILrzonGsW3yNL821Kp8a2y4sEFo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YuJz3DyvNiWVteGaB9y4IiB9F5ZFWYGfu7ECrtJBXSDSWwjLPEpFK6qNC6WQBVuh5jza821nwZev/Lp9OxpA9Fixd3jrhJaG2eEw016WG6KFFzMv+pDbHmVzPYCI+mqzVjmDiDDzF3bz4mgPDUo7RhQ3esrQXa1xbDrfTQoiPQo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ngGj+HgP; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ngGj+HgP" Received: by smtp.kernel.org (Postfix) with ESMTPS id EA1B3C2BCFC; Sat, 26 Sep 2026 12:40:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1790426434; bh=tR7p4+86bpeoj1XWILrzonGsW3yNL821Kp8a2y4sEFo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ngGj+HgP2PXnVe7PvcYyTYlD8pfJFGiVBy6Y+SknDEwy81QA4+63QrcotJbXahOGv ohuT33t3rYWwkC8FdJQHUt6t68hk07IgeLmDPiC0Y87hNMqMY8+z0kON04uNlNuvNR JrqlHdG/zKjtLjSrkkcdjf0aSBGg0Q/7B9Y7madbygH0JmnMwEsXGK7nDPfJNk13WJ YJ6HKwhccahtd4azwLGKYMsMC6ijd8D0R1T9ReiIk+4FZasL3N1voA2mM3tfmepQqK cOkPag0/1+YHXciHs4hPdoJ4gUnPMEfSJeRqH2SPTaCrxYiCvOYczM2eWVIrdwWrKp 4BdLEdOJDpVOA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D75AAC9833D; Sat, 26 Sep 2026 12:40:33 +0000 (UTC) From: David Heidelberg via B4 Relay Date: Sat, 26 Sep 2026 14:40:28 +0200 Subject: [PATCH RFC 09/12] arm64: dts: qcom: sdm670-google-common: Enable USB Type-C port controller Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260926-typec-v1-9-31adc19f32c6@ixit.cz> References: <20260926-typec-v1-0-31adc19f32c6@ixit.cz> In-Reply-To: <20260926-typec-v1-0-31adc19f32c6@ixit.cz> To: Alexey Minnekhanov , Bryan O'Donoghue , Heikki Krogerus , Greg Kroah-Hartman , Liam Girdwood , Mark Brown , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio , Dmitry Baryshkov , Lee Jones , Stephen Boyd Cc: linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, phone-devel@vger.kernel.org, mfd@lists.linux.dev, David Heidelberg X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3664; i=david@ixit.cz; h=from:subject:message-id; bh=CjS4hw3kr0t8vOchmksh9hh2KTW9zTk6YzJTOsPRVhk=; b=owEBbQKS/ZANAwAIAWACP8TTSSByAcsmYgBqt70+gGgkptBxM92aPKjE+5O95WN0shFAlu1nR v+Fpo3bXr6JAjMEAAEIAB0WIQTXegnP7twrvVOnBHRgAj/E00kgcgUCare9PgAKCRBgAj/E00kg cqkqEADPo2oLUvuGwwEQukf+Tf1e58KayaODxbTvtiWcIGeujCSmRGCBqskRF4wxyOWldimWLGz B+u4qEie7FN6OyGhkQkhcL8tRVIsvoP4vSvG7xoe911nglRao2HOSkix4g55OxBee+Bogxczd3K RqOq30o/DrvkVFoojYAV/xHrwa/xWKww9dfdMOtfozkn2QK1hCgzztB+2T5meV/uCN32SB2bN0f +DO6A74g1oWJSi2FGZMSM/KBx/qU6qQ7jrUiOZgENwiWgY96SAEXq9uAC3iEnaKriiRJTw1m4eH h32s+PfTmcdHxU9Sez71jiQpu5P/OZWzScPbkbkAh7MmFyKDRbmwpo5vy1QPk+9k9d04S4yYjuy 87xLQY6C6tXwFTDkLto4X2VM18CDtN4NpyRGUXcBvkO6A1gQF3GZT2PJ+qQNro2dm/vL/QgMejZ uPIhEc1hXPPhHinz338vu07fzQe54JRoUJNncN3Df6MfZvn1EZu1kSJYpIOrgSFNejqRi7FLAaX qqyZemCAT9iro+5JSErr+cr0aag5QHS6hhRpYoSU5KVT14pyOUbsf4e8OgmS9S1+zgb/SyWbgGY zM/9INYpOIl89mPueOmBlYXP3TylaJiHbyVbhiwp9ks202uLrx19W75Mrvk4qJcQNBiGDAz0sqW kK+RhsbszxWqCMw== X-Developer-Key: i=david@ixit.cz; a=openpgp; fpr=D77A09CFEEDC2BBD53A7047460023FC4D3492072 X-Endpoint-Received: by B4 Relay for david@ixit.cz/default with auth_id=355 X-Original-From: David Heidelberg Reply-To: david@ixit.cz From: David Heidelberg Enable the PM660 Type-C port controller with a USB-C connector description for the Google Pixel 3a (sargo) and Pixel 3a XL (bonito), 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. Higher voltage PDOs are left out until the charger driver programs the allowed USBIN adapter voltage. The Pixel 3a USB-C port is USB 2.0 only, so only the HS endpoint is wired to the DWC3 controller. 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 --- arch/arm64/boot/dts/qcom/sdm670-google-common.dtsi | 51 +++++++++++++++++++++- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sdm670-google-common.dtsi b/arch/arm64/boot/dts/qcom/sdm670-google-common.dtsi index b4854801a5f5e..afecbef2e5bc2 100644 --- a/arch/arm64/boot/dts/qcom/sdm670-google-common.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm670-google-common.dtsi @@ -6,16 +6,17 @@ * Copyright (c) 2022, Richard Acayan. All rights reserved. */ #include #include #include #include #include +#include #include "sdm670.dtsi" #include "pm660.dtsi" #include "pm660l.dtsi" /delete-node/ &mpss_region; /delete-node/ &venus_mem; /delete-node/ &wlan_msa_mem; /delete-node/ &cdsp_mem; @@ -580,16 +581,56 @@ cam_vio_pin: cam-vio-state { power-source = <0>; }; }; &pm660_rradc { status = "okay"; }; +&pm660_typec { + vdd-pdphy-supply = <&vreg_l7b_3p125>; + + status = "okay"; + + connector { + compatible = "usb-c-connector"; + + /* + * Sink only for now, as the PM660 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. + * + * Higher voltage sink PDOs will be added once the charger + * driver programs the allowed USBIN adapter voltage. + */ + power-role = "sink"; + data-role = "dual"; + self-powered; + + sink-pdos = ; + op-sink-microwatt = <15000000>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + pm660_hs_in: endpoint { + remote-endpoint = <&usb_1_dwc3_hs>; + }; + }; + }; + }; +}; + &pm660l_flash { status = "okay"; led-0 { function = LED_FUNCTION_FLASH; color = ; led-sources = <1>, <2>; led-max-microamp = <500000>; @@ -702,16 +743,22 @@ &usb_1_hsphy { }; &usb_1 { qcom,select-utmi-as-pipe-clk; status = "okay"; }; &usb_1_dwc3 { - /* Only peripheral works for now */ - dr_mode = "peripheral"; + dr_mode = "otg"; + usb-role-switch; /* Do not assume that sdm670.dtsi will never support USB 3.0 */ phys = <&usb_1_hsphy>; phy-names = "usb2-phy"; maximum-speed = "high-speed"; + + port { + usb_1_dwc3_hs: endpoint { + remote-endpoint = <&pm660_hs_in>; + }; + }; }; -- 2.55.0