From nobody Wed Oct 28 02:14:12 2026 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 D75C03E410E; Sat, 26 Sep 2026 12:40:33 +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=1790426433; cv=none; b=aiRduUafaUveno7ngIWx/LqYIbo2mEwI86eZxp41f0JYARLG7hpxy9EFQCxdjqPkz3kC2UsjpC43Hb+bjzT2Y46fD/2EwSfhh6yWoT2oiLgJedGNFhm1HzmVG6otp8/1biBwPlmv6YAcNjdRQjNBGP7F9/nzqk9+scZl6gq/0YA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790426433; c=relaxed/simple; bh=qX9Dcr1L78sbsl5ODSHUS1GAkK2IVN4s3MJdIoy2CNA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SPddI9VH+Rp4Lazqkq5tLk17xCKspzDWS7i+ub6ZtzzmkK0cKdbDr0ADZOwoyXuD/ITZKnCwYc3DyI+7sRJ7LXKkAHbbtSlD050QA4n4MZ7dhmLJqLl2Gsl6ivRntrUebSLCZ6dPJNJlRUc8+8S3dsQH+b6FsqY4wfwyavrtTys= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nubKJaIe; 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="nubKJaIe" Received: by smtp.kernel.org (Postfix) with ESMTPS id 647A8C2BCF7; 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=1790426433; bh=qX9Dcr1L78sbsl5ODSHUS1GAkK2IVN4s3MJdIoy2CNA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=nubKJaIe6hd3db43BgMyUQZToA4OnRf2wNxI8YXT/Lkr3yxh8KN0q4Y9pbFZAWVqo rmBI1d4fhqGqQoUx0SYaUprrZ1s/Z9d1NoZ94Ju9Sp7yxWJ/npe2oKeYs/D1qxeBB0 vXapNpR+G4vF73Mnt3IYEKhfTxLV6qF4lgC4sSs1RfQLeyjz6GVArhKs0dFGRq6Egx Htjm7l9ssiESEpcOExGdnPLbygwUljVWJOAF4LYX36guQgziAmQVKWDdLdoVKNfGIi HLnmAhbKFM0dWHghEWZ9z8TR7p6iyhSviT+u+RNtgM0aX6KnbKrbG3b1Ng+FXCfAdn SuHdZk1EdTbhg== 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 4208DC98332; Sat, 26 Sep 2026 12:40:33 +0000 (UTC) From: David Heidelberg via B4 Relay Date: Sat, 26 Sep 2026 14:40:20 +0200 Subject: [PATCH RFC 01/12] usb: typec: tcpm: qcom: Release the connector fwnode reference 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: quoted-printable Message-Id: <20260926-typec-v1-1-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=1915; i=david@ixit.cz; h=from:subject:message-id; bh=22jx8Je1oP+cSCrbfrUS4MrSfcA6caRWGdeZuml3fJs=; b=owEBbQKS/ZANAwAIAWACP8TTSSByAcsmYgBqt709qm2CM8rlvlYjeHgjttYvncP5LGHE4UVfp 0le9TwMS8GJAjMEAAEIAB0WIQTXegnP7twrvVOnBHRgAj/E00kgcgUCare9PQAKCRBgAj/E00kg covmD/91dII+0d3mG6Rh9eecL3hmADWuOqoOY6jnNuvevQ85iyRM7ef0uZHQ7GPOR/p4GU4fK24 f1J5yw86lLpCzy5voipaf5579rByui4r/RC5fS6x4NfyTYV5uLhnS4HzgZzpkZBVM6or0nDHP+i n8WmIjWl8ErpyX3GjRm11gG0/SHjdtHpotIt29rUrsN+2E9CD8G6x4iulBEhRZqklphX4f7fCba g6t7jjZSTNL2hLwolVl7duIa7HWv29uTWkkdkKh02ZbNPdhL3k52mdTt7VZHIZceI4ZuO+/v+wq H2Uv0QJkMG4Ox5brnG2szJ157Aq0SLTX5JQnR50AMEc6zd/HaOyXCB1bc/isK6epMYVJpEHIhww FCyBX/WMyitfHGI3vVM+8HZJKMlA6TJ70uSodFV8JKpuZVt7WiF2I8ASwgtKtdRmYeTNJb5zyj2 oDhUepZRWO74W0g4eSlPepn0FbKBESvKAGPUzgjE70/ue3xBlYSO7IweWdRpLZWMhDDt5VZFk62 CKchhsY0w8Cd7f2EPmOqHyiY3nWN/p93aX7tfIRCdY/p2wmJv0LtwLdxciVu0ywCVkUv+ZREErD Y7IkPl03xLeZ9SyzfZMkrgB+EYWXJ3EYsh3E28Oa5hUUPg3zeRI/mkIbwQ1JtsR+JkP4/0TEUOc M518ylOwa1Jl+MA== 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 device_get_named_child_node() returns the connector node with its reference count incremented, but the port probe never drops it. The node is only needed for the VBUS regulator lookup, so release it right after. Assisted-by: LLM Fixes: 506927b6bf29 ("usb: typec: tcpm: qcom: prefer VBUS supply from the c= onnector node") Signed-off-by: David Heidelberg Acked-by: Heikki Krogerus --- drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c b/drivers/u= sb/typec/tcpm/qcom/qcom_pmic_typec_port.c index bf985efe1cd6b..f8308d66b9d67 100644 --- a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c +++ b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c @@ -5,16 +5,17 @@ =20 #include #include #include #include #include #include #include +#include #include #include #include #include #include #include #include =20 @@ -723,16 +724,17 @@ int qcom_pmic_typec_port_probe(struct platform_device= *pdev, =20 connector =3D device_get_named_child_node(dev, "connector"); if (!connector) return -EINVAL; =20 pmic_typec_port->vdd_vbus =3D devm_of_regulator_get_optional(dev, to_of_node(connector), "vbus"); + fwnode_handle_put(connector); if (pmic_typec_port->vdd_vbus =3D=3D ERR_PTR(-ENODEV)) pmic_typec_port->vdd_vbus =3D devm_regulator_get(dev, "vdd-vbus"); if (IS_ERR(pmic_typec_port->vdd_vbus)) return PTR_ERR(pmic_typec_port->vdd_vbus); =20 pmic_typec_port->dev =3D dev; pmic_typec_port->base =3D base; pmic_typec_port->regmap =3D regmap; --=20 2.55.0 From nobody Wed Oct 28 02:14:12 2026 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 D7682400E1A; Sat, 26 Sep 2026 12:40:33 +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=1790426433; cv=none; b=pqSVDfYIpnygU1r0pnTLOSy5B2crUhU0XYN4iI63QBd8FaQS5IGETduHGBczfxwYv/UquS7n+5u47I/DzwR0ayJKGp//sIVVBtJp1TTWAfxmMMe0je2ovF0EDzi1gXm59eZg2FbR7i1/PtVGWjpl0obp/8W90d/izv183XxkpSY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790426433; c=relaxed/simple; bh=Wm00DSBMr6EfgVkcczqvzn2AVo/mF8S/ysSMiR8UkJE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bU64CUqBmyi6c4E9MnbNu6G6bKi4Q+7DCK5ooB+O0n5owO2oWaRJMdfcb/Hm4WR3hH5VOQqV7ANJhrIaLT8eaK6fU2G3FtxpQtgxOsFzDawP/KDXt2K4r2YR7jt0FgQs5tm5UPEPA6m4ewXKfMD9xO5BRZl/rqBuUOVkgCo5VBI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jwKg2N5J; 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="jwKg2N5J" Received: by smtp.kernel.org (Postfix) with ESMTPS id 731C7C2BCC7; 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=1790426433; bh=Wm00DSBMr6EfgVkcczqvzn2AVo/mF8S/ysSMiR8UkJE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=jwKg2N5JKPiRYhX0ATAttN/0CXdvm/F8GIeU1cmDrXH9/OZTGW4/XTvfb4fp0uBhv xMz+cf67/fGE4ZStEeppP1Itj8YrGKLAt4JyZNarpsP8tGQXK/pq1sppwVoDJ5dos0 TbkY8XWg/aPR9ehZwdcmZ8kSbMSTCVrm2NUe08gIqWAqM6KRXZXAoL+WEAhGSl/RDB f1T1/ZuWn4/MXaxJbneDvOlHaBTql1KsPz2mttL5aODQJbSHmKddPQ6XmsGzGI952e fjXcWDsWZEjYkujj2ArWE10EzNBdtF0Bfjmapav8yInxD4XV48WoS0bwTcWK1b7ehX hlP/tiNoyTf/Q== 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 53388C9833A; Sat, 26 Sep 2026 12:40:33 +0000 (UTC) From: David Heidelberg via B4 Relay Date: Sat, 26 Sep 2026 14:40:21 +0200 Subject: [PATCH RFC 02/12] dt-bindings: usb: qcom,pmic-typec: Update example with vbus-supply 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: quoted-printable Message-Id: <20260926-typec-v1-2-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=1765; i=david@ixit.cz; h=from:subject:message-id; bh=7QxiOjoeKoKXk9E1eYNDmLj4wCbThDkI+aQOFIPL5J4=; b=owEBbQKS/ZANAwAIAWACP8TTSSByAcsmYgBqt70+CmH8mks/No9E70DNtIUe2Oyb2BRrsAJrO zIOZWkLvYuJAjMEAAEIAB0WIQTXegnP7twrvVOnBHRgAj/E00kgcgUCare9PgAKCRBgAj/E00kg cj9oD/45Iu4qrkMFD6bJMFFFI+9sFnJQItwzRXrXXjDhtFmPmkTbBGk2laRKDf8SoADb+9svKar tkwt14EQTr/yQ8WW8J+yj7BRma48NuFHbq9B3qnRMHgP+ajfzkmkOTRhsH6G/k1w3epSzf/w280 OgATA0T5SKEeaYDBsSWppMR5nFHdtjfcLBEaXRTOCTiUFsQvIevKrc+5GE7565G3OgbKqVVo25F VN/PdYZCpYyC4PzYIKRvuEyl2kNJBIs88pAsGlfVJ/UgFa/YFhdheGSBvDZ/AReYW5ey9Cke0Yy UZtQr1sM/OYF8O1WyOzH78xvUGPQrwqkuTT2/sviRXR2uaIMnRUn6hHY5XZYSFdUzEhUhNKc1kS XX4703ejTpsvJjc283T/nfQxb+/iTlFrPqts4vLjsHyfIccc4F1UPsGUMFEc9ruBAwxzUbqJbDx xZw803J/P7SHHE8JeMgGA8LTdPVmRNmc3uMeQ2Jv7mSbdem2krrO2ggxQYtS4DWIEqJ2+mHWQEl +L/C3JMilG96SXWNB6WRWyA5J6rm3XPmf7X1PLlYBx1fN6LytJusruQ3DczH3VotFQANZnPmDk0 Ev9Ih0rc8Mix+txBeZTEyxS+oYcfDh2JVWhjpRnUa0nN7dCPDi8gfrbphIAktfAyl/Uhc06Ln4e YfmTlKkhb70RslQ== 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 The vdd-vbus-supply is deprecated, thus don't suggest deprecated usage in example. Assisted-by: LLM Signed-off-by: David Heidelberg Reviewed-by: Bryan O'Donoghue --- Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml b/D= ocumentation/devicetree/bindings/usb/qcom,pmic-typec.yaml index ba790c4488b76..2c8b11e92fb28 100644 --- a/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml +++ b/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml @@ -163,29 +163,30 @@ examples: "sig-rx", "msg-tx", "msg-rx", "msg-tx-failed", "msg-tx-discarded", "msg-rx-discarded", "fr-swap"; =20 - vdd-vbus-supply =3D <&pm8150b_vbus>; vdd-pdphy-supply =3D <&vreg_l2a_3p1>; =20 connector { compatible =3D "usb-c-connector"; =20 power-role =3D "source"; data-role =3D "dual"; self-powered; =20 source-pdos =3D ; =20 + vbus-supply =3D <&pm8150b_vbus>; + ports { #address-cells =3D <1>; #size-cells =3D <0>; =20 port@0 { reg =3D <0>; pmic_typec_hs_in: endpoint { remote-endpoint =3D <&usb_hs_out>; --=20 2.55.0 From nobody Wed Oct 28 02:14:12 2026 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 D772340BCB6; Sat, 26 Sep 2026 12:40:33 +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=1790426433; cv=none; b=NWzjMTdcyzy6ec2tATrcwp32VpDeAfSrxmZcLGsV5a2jvsgsdVHIQntNm8c3g7iUm0CsSwCTsvnss0h46EeVcPb77uus6AI2wPD9IBLbbmNa078QhyWQh8ol0ovZf3+CtMadXBG+9fGiIZGhij2XMRPKKU1yY10Wo+nA0MqHEaI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790426433; c=relaxed/simple; bh=NVmjkH7jPCdZBTzC0lyKhmKhkaZqH5Il1xxRCP38QFQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=m0kk+aEVrW6HbG2MEoiZf3d//I23n1Hp2qJJEXs9cilhANjW1CJ/xY9ws37RHLnZpOXmgPtC3hOw4C2N5gUKFLhjTnCtNU+cvwitoIxB82IONnEkY9x9YJdWtXdGi67XbknTrOibBLuv76Vx2OIrYVYCq/TwQVmaKbK3+f29dMI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EDm4bzFr; 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="EDm4bzFr" Received: by smtp.kernel.org (Postfix) with ESMTPS id 84A93C4AF0C; 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=1790426433; bh=NVmjkH7jPCdZBTzC0lyKhmKhkaZqH5Il1xxRCP38QFQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=EDm4bzFrhQ9Sbl37KTnntug6hRzqsnMHtg+ykRDgZhb9BXJY/Df7cp1J6FBSNIWb8 QHaqRwSuHKHB8/fZCbeaMZH+2F4d6hQ90Td9t+PoWuNSx5x2Ngfw8PWwZnbCxvcwyM p7i677dkkAGFqM0gni2hlUaRV1C5KyTvkcvf/Mi7YAFSrmb7aGfdeSxpTOyJz5DPTv ZBfQOnjzACWrtuCzWwJWfu9qEiFBM9a+yiUOEesf/Kgy/o430Pgy247hxgfSwbioDR bG2gk9B1cpnMElYYHkUUiACgTmW8RmQbHvvU80coIJytUJc06o91DPIgTqccSyXciR oW9bWTRmL6/4Q== 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 65BF6C9833D; Sat, 26 Sep 2026 12:40:33 +0000 (UTC) From: David Heidelberg via B4 Relay Date: Sat, 26 Sep 2026 14:40:22 +0200 Subject: [PATCH RFC 03/12] dt-bindings: usb: Add Qualcomm 1st-gen PMIC Type-C 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: quoted-printable Message-Id: <20260926-typec-v1-3-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=6560; i=david@ixit.cz; h=from:subject:message-id; bh=h5jokoIGgyRIrcE5uqQ2ilFZQ7nRsHBBtFGlJGzRCmc=; b=owEBbQKS/ZANAwAIAWACP8TTSSByAcsmYgBqt70+N08iri4moGn4GRPNFAjjCc33g/d+t6dvb 0ntxoZYIIOJAjMEAAEIAB0WIQTXegnP7twrvVOnBHRgAj/E00kgcgUCare9PgAKCRBgAj/E00kg ch+6D/9KoE80RjKlFmJnGWmJvaw9C7H3rPoqPuhClVet63WdKDaAQePP35i2ICzcBUV+ELgTbo0 r283gsIAUwZwrqZeQ8zgWERl1Ep01Wg9BdXqOvW6Fk9YrEKvVUpRQWSF9yYwj7iiayD64TjH7Uy Occ8KAsM93wFHd3slgoSER0JnLSckY5exUWo5FQ4mw8qjA5rdUaGpNruSBYbiIGbdAZaKehiN5h +bjRkxmiHpljldWXk7oJBLkAmqzZPkqMk4A6am29awqqnD0+jXOQCis0cGxoldqiqp+hEQ/8n1I VeOLyxIkw7sThyR5yZRfjJ5qQImD78m3KW+tUoiCqNomFXgT+gzQnEUuK8988sF3S5bRt3SQMuU mEcpPTiaCLPMqLp9DsfS9MbEE0V0slafl1ucO1JF9CmPaJlld+kf3SWVrqPCKbjfE3K1PI8Nna9 YsD1sSdlkC0m0Vl5wEaxM4lENTyblaPMqDS+35yMErlIGmJDAM5EFCQjS1GoGBMyrIzf2CTmq1i +qX7l65nhxnRiPzkfnYAzhAqYR8IAJolG5qk2XRUIamV6xkeU5ipw1I/VsuZ3Wb2O0Kb2tdb5lU XtcgXPTmPCTIzouYqk6XbBwZsa8Ows0P8Lx8NGkbbRwOC8GpOOForCaO5wp01N5NefTt/pWDW0r YhjHPeTQXAafbOA== 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 Add a binding for the first generation of the Qualcomm PMIC USB Type-C port controller, found on the PM660 and PMI8998 PMICs. Unlike the later standalone Type-C peripheral at 0x1500 (e.g. PM8150B), the gen1 Type-C CC logic is part of the charger's USBIN peripheral (base 0x1300) and signals all Type-C events (CC state change, tCCDebounce done, VBUS change and error) through a single aggregate "type-c-change" interrupt. The USB PD PHY at 0x1700 is register compatible with PM8150B. The different interrupt set and register layout make it a separate binding rather than another variant of qcom,pmic-typec. As with PM8150B, the Type-C block and PD PHY are described as a separate SPMI node from the charger. Allow typec nodes of the Qualcomm SPMI PMIC to use the new binding as well. Assisted-by: LLM Signed-off-by: David Heidelberg --- .../devicetree/bindings/mfd/qcom,spmi-pmic.yaml | 4 +- .../bindings/usb/qcom,pmic-typec-gen1.yaml | 130 +++++++++++++++++= ++++ 2 files changed, 133 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml b/Do= cumentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml index 5e0ed30a9a466..d7a43aa423c8a 100644 --- a/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml +++ b/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml @@ -199,17 +199,19 @@ patternProperties: $ref: /schemas/thermal/qcom,spmi-temp-alarm.yaml# =20 "^temperature-sensor@[0-9a-f]+$": type: object $ref: /schemas/thermal/qcom,pm8775-mbg-tm.yaml# =20 "^typec@[0-9a-f]+$": type: object - $ref: /schemas/usb/qcom,pmic-typec.yaml# + oneOf: + - $ref: /schemas/usb/qcom,pmic-typec.yaml# + - $ref: /schemas/usb/qcom,pmic-typec-gen1.yaml# =20 "^usb-detect@[0-9a-f]+$": type: object $ref: /schemas/extcon/qcom,pm8941-misc.yaml# =20 "^usb-vbus-regulator@[0-9a-f]+$": type: object $ref: /schemas/regulator/qcom,usb-vbus-regulator.yaml# diff --git a/Documentation/devicetree/bindings/usb/qcom,pmic-typec-gen1.yam= l b/Documentation/devicetree/bindings/usb/qcom,pmic-typec-gen1.yaml new file mode 100644 index 0000000000000..8e93719fac3d1 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/qcom,pmic-typec-gen1.yaml @@ -0,0 +1,130 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/qcom,pmic-typec-gen1.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm PMIC USB Type-C block (gen1) + +maintainers: + - David Heidelberg + +description: + First generation of the Qualcomm PMIC Type-C port controller. + +properties: + compatible: + enum: + - qcom,pm660-typec + - qcom,pmi8998-typec + + reg: + items: + - description: USBIN peripheral base (Type-C CC logic) + - description: USB PD PHY peripheral base + + interrupts: + items: + - description: Type-C change - CC state, tCCDebounce done, VBUS chan= ge or error + - description: Power Domain Signal TX - HardReset or CableReset sign= al TX + - description: Power Domain Signal RX - HardReset or CableReset sign= al RX + - description: Power Domain TX complete + - description: Power Domain RX complete + - description: Power Domain TX fail + - description: Power Domain TX message discard + - description: Power Domain RX message discard + - description: Power Domain Fast Role Swap event + + interrupt-names: + items: + - const: type-c-change + - const: sig-tx + - const: sig-rx + - const: msg-tx + - const: msg-rx + - const: msg-tx-failed + - const: msg-tx-discarded + - const: msg-rx-discarded + - const: fr-swap + + vdd-pdphy-supply: + description: VDD regulator supply to the PDPHY. + + connector: + type: object + $ref: /schemas/connector/usb-connector.yaml# + unevaluatedProperties: false + +required: + - compatible + - reg + - interrupts + - interrupt-names + - vdd-pdphy-supply + - connector + +additionalProperties: false + +examples: + - | + #include + #include + + pmic { + #address-cells =3D <1>; + #size-cells =3D <0>; + + typec@1300 { + compatible =3D "qcom,pmi8998-typec"; + reg =3D <0x1300>, + <0x1700>; + + interrupts =3D <0x2 0x13 0x7 IRQ_TYPE_EDGE_RISING>, + <0x2 0x17 0x0 IRQ_TYPE_EDGE_RISING>, + <0x2 0x17 0x1 IRQ_TYPE_EDGE_RISING>, + <0x2 0x17 0x2 IRQ_TYPE_EDGE_RISING>, + <0x2 0x17 0x3 IRQ_TYPE_EDGE_RISING>, + <0x2 0x17 0x4 IRQ_TYPE_EDGE_RISING>, + <0x2 0x17 0x5 IRQ_TYPE_EDGE_RISING>, + <0x2 0x17 0x6 IRQ_TYPE_EDGE_RISING>, + <0x2 0x17 0x7 IRQ_TYPE_EDGE_RISING>; + interrupt-names =3D "type-c-change", + "sig-tx", + "sig-rx", + "msg-tx", + "msg-rx", + "msg-tx-failed", + "msg-tx-discarded", + "msg-rx-discarded", + "fr-swap"; + + vdd-pdphy-supply =3D <&vreg_l24a_3p075>; + + connector { + compatible =3D "usb-c-connector"; + + power-role =3D "dual"; + data-role =3D "dual"; + try-power-role =3D "sink"; + + source-pdos =3D ; + sink-pdos =3D ; + op-sink-microwatt =3D <15000000>; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + port@0 { + reg =3D <0>; + endpoint { + remote-endpoint =3D <&usb_dwc3_hs>; + }; + }; + }; + }; + }; + }; +... --=20 2.55.0 From nobody Wed Oct 28 02:14:12 2026 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 D750B3A83AC; Sat, 26 Sep 2026 12:40:33 +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=1790426433; cv=none; b=knJ0FK34I0z4RYk3TAYNa4KoknvmFaQpn814usoHJdivRyAQi5Fyw0vFyYNEbixG9Hh7WiPgOHRbnCuvYTTpScyFPUwIBaDNzOaPfywI4qao80EvHkDqf2WrXMflpCr7W54WrfVm0nUe6HBxnP5sFzgGmu38IePeEQISdPs6Ans= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790426433; c=relaxed/simple; bh=fbeH1V4vzunDOndyawowxW/6qRCo8v7L07Fr6mvTg5k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=njVzCbOn0asWQIK4Drk2nFyv9JlRqNzZIVXFASO0L3VytE8VWS/Z37me+iZHrLkiXsSVaDJh2J/kiS+Y+nkWvcYWFIYSHw4mWOtQ5TsPqMN1S+Lnw0V4F625mjRTnwZU6KjvQ7TdQA/B0L8mX7vx83Z8LDfXHwFmnoDwFddlGeM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pRx+Op4v; 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="pRx+Op4v" Received: by smtp.kernel.org (Postfix) with ESMTPS id 8A29EC32782; 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=1790426433; bh=fbeH1V4vzunDOndyawowxW/6qRCo8v7L07Fr6mvTg5k=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=pRx+Op4v7ku1/IUyCHwevHXuHkCucoxQe0N9phyPYaX77lPzoBg9QnjNkn9Bzmf6S NVqz+cOV51xw9OsosZ7AX7cNHMOXzrmha1sx6xhEApB+joZvrTusBj51deDqNeLT5M bRQPU4agF2/JsdW5YK8x6ovFr9BrMUQWPeOU1Tj8hQ0U5l897BEgtUpBAo54y2+Gfv ye3yX+ROPx1AovA2L3AmBZq2s9FrgR4bnArriW3nrIw3i9pOLvrPWPZmw3XXF0u1WM KHJ3Z7bP1+eFsO6rkdO1BRXXSXuqdNmrBFKu0suVoUmCh4m4C9F5FL/Wg8XzBEJPE2 /46mEwAj8An2Q== 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 78AE1C98328; Sat, 26 Sep 2026 12:40:33 +0000 (UTC) From: David Heidelberg via B4 Relay Date: Sat, 26 Sep 2026 14:40:23 +0200 Subject: [PATCH RFC 04/12] usb: typec: qcom: Make PMIC port probe selectable 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: quoted-printable Message-Id: <20260926-typec-v1-4-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=2776; i=david@ixit.cz; h=from:subject:message-id; bh=0rBqhoYEUS5e6Dqw7gl8GlLS56lHpFV9ezYYskglvBA=; b=owEBbQKS/ZANAwAIAWACP8TTSSByAcsmYgBqt70+w/f0+R0Sai12heN/MhIh3cfG2zGBplQjT Amw5uAyGPOJAjMEAAEIAB0WIQTXegnP7twrvVOnBHRgAj/E00kgcgUCare9PgAKCRBgAj/E00kg cq/aEACDASJtuj9XnIaBYYWlfCvYWzdnaO1kkWypCP+jJS9r7zLJAfnX7V+vN5kArhjrFrO46gk wHleVtVTSF2vyK8zTICd68HEyjr1rUL0LWxPZwPNiIvOF6oPeg3HuSVxk6WpWm1ySQt2o+L906B 0GYzUGwdQYDdV23gcLx8/016p1ubedMwj5IE3iSi4UyYZ7QDzVoigcMNXKvWsmjjBb0FpyB487y 6oFuYyuNPxdcUbO4nj0Y5smop/cVT0RkGwWPBsFSptKftApLgPTJM3pGqXUESqf24d3R1iJc2pH hd3EkC7gQvz5tao6GQC4J0W6RtWw1NhGHERO58xe4eiOlBw37j/ajp69Y6yI8kKiWeNOaM5cl8I 0TW8qnBMuFaxHhK8GrrC5YT/8gdVX1IaMafE8ZzeebEU9euOrUMRUQNBb8SRnjXBn/Q8veANnj8 k2YJ+O/KPGpJbiWtuYcbHRtyy5+IqIQprLjhJ+MCc6a9jHsMKQz+LYZGv5lzaFi5m8mWtM42ail HiBo82MfXe5eaRKoSrEnA3Q73RGDRbLJfGzu1WHkJit5+kfCOoFBPoBpeux6s8wzjWgxEAWm7kD ptCg/Ko3aWWfoi0fTd2g9jasGpzv2KKr/4hg6c5jZe/gIp9dMPf1jOaTgKLHO/yy7hloxJVOuHi WLyGtBvZK1f26hg== 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 This is a preparation for extending the support with 1st generation Type-C. Assisted-by: LLM Co-developed-by: Alexey Minnekhanov Signed-off-by: Alexey Minnekhanov Signed-off-by: David Heidelberg Reviewed-by: Bryan O'Donoghue --- drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c b/drivers/usb/ty= pec/tcpm/qcom/qcom_pmic_typec.c index d770e58bc16cf..41aaae6bb3724 100644 --- a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c +++ b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c @@ -13,19 +13,25 @@ #include =20 #include =20 #include "qcom_pmic_typec.h" #include "qcom_pmic_typec_pdphy.h" #include "qcom_pmic_typec_port.h" =20 +typedef int (*pmic_typec_port_probe_fn)(struct platform_device *pdev, + struct pmic_typec *tcpm, + const struct pmic_typec_port_resources *res, + struct regmap *regmap, u32 base); + struct pmic_typec_resources { const struct pmic_typec_pdphy_resources *pdphy_res; const struct pmic_typec_port_resources *port_res; + pmic_typec_port_probe_fn port_probe; }; =20 static int qcom_pmic_typec_init(struct tcpc_dev *tcpc) { return 0; } =20 static int qcom_pmic_typec_probe(struct platform_device *pdev) @@ -55,18 +61,17 @@ static int qcom_pmic_typec_probe(struct platform_device= *pdev) dev_err(dev, "Failed to get regmap\n"); return -ENODEV; } =20 ret =3D of_property_read_u32_index(np, "reg", 0, &base); if (ret) return ret; =20 - ret =3D qcom_pmic_typec_port_probe(pdev, tcpm, - res->port_res, regmap, base); + ret =3D res->port_probe(pdev, tcpm, res->port_res, regmap, base); if (ret) return ret; =20 if (res->pdphy_res) { ret =3D of_property_read_u32_index(np, "reg", 1, &base); if (ret) return ret; =20 @@ -132,21 +137,23 @@ static void qcom_pmic_typec_remove(struct platform_de= vice *pdev) tcpm->port_stop(tcpm); tcpm_unregister_port(tcpm->tcpm_port); fwnode_handle_put(tcpm->tcpc.fwnode); } =20 static const struct pmic_typec_resources pm8150b_typec_res =3D { .pdphy_res =3D &pm8150b_pdphy_res, .port_res =3D &pm8150b_port_res, + .port_probe =3D qcom_pmic_typec_port_probe, }; =20 static const struct pmic_typec_resources pmi632_typec_res =3D { /* PD PHY not present */ .port_res =3D &pm8150b_port_res, + .port_probe =3D qcom_pmic_typec_port_probe, }; =20 static const struct of_device_id qcom_pmic_typec_table[] =3D { { .compatible =3D "qcom,pm8150b-typec", .data =3D &pm8150b_typec_res }, { .compatible =3D "qcom,pmi632-typec", .data =3D &pmi632_typec_res }, { } }; MODULE_DEVICE_TABLE(of, qcom_pmic_typec_table); --=20 2.55.0 From nobody Wed Oct 28 02:14:12 2026 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 1AC5943F4A9; 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=LfkAB7Snu2qgMWhDwPxTpuDNxeUunTNvH9uEohk65nap7J7QzCK/iO7HBN45mxaJ7pYwcWoeL/HrvD+BMVCEQlkxsCnmiomfVdkJ4c9hLK5NEtMH0TvGCTM49ffycU6xDZdCHwouMpGtoWuR31OuR4O1/wyRNzknaQXoowxnOf0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790426434; c=relaxed/simple; bh=IKIueHDGdKad1dbZuuleadx3ptYZIb6DginSe2S+pGw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BaYpv3ZwVYjWUxMXZQTEhrBJC4OrImQKjfLZWZHZXb9V9llLgLDFH4/JfBmP2pJwr7vGPCj2U2X3rqU/iLxgh3nh0jE8taB0ABnpbeiH84dhbMahZHq7LdB/TX95zq4uSZQ78Q5u2yJWMuqGYgDiginNoUqT8QBcG58z5MUkxAA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Q5g+k5pZ; 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="Q5g+k5pZ" Received: by smtp.kernel.org (Postfix) with ESMTPS id A0936C2BCFB; 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=1790426433; bh=IKIueHDGdKad1dbZuuleadx3ptYZIb6DginSe2S+pGw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=Q5g+k5pZt0RL6PzhpUgUlzuqSTJ0oVd0QB5VWm4GVyLaaddzMjjKWJJICkSNUazUy taH9m5x7QuCOH0uvRDi08yB6r7zLi4xXA4WWEXEBy56TqznDJsAMLjGOjiKmGZtERq l7wzWGal49qqP5gQyrDxXWWKXQjsVVpF8CgdTk6uebxN5QfnPGgf5W590d16H6s2Ja No3/MK1+Sd9SC3vVSSg6ayAW07lziby52fXUhH0eflHCHtirgvRx8iZ9s0/3yMFkcE GUAHiG6Bs8H4C9yPRMT+VxzoQw8G+mvR3EsCcUbXhHIVsP2Y5HjBHWG6+l2qfHicJB CxSnbJqit8Bgw== 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 8B174C9833E; Sat, 26 Sep 2026 12:40:33 +0000 (UTC) From: David Heidelberg via B4 Relay Date: Sat, 26 Sep 2026 14:40:24 +0200 Subject: [PATCH RFC 05/12] usb: typec: qcom: Make typec_port accept also different structure 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: quoted-printable Message-Id: <20260926-typec-v1-5-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=1220; i=david@ixit.cz; h=from:subject:message-id; bh=Rv/C1XQqReAptmVTI+ZJAAlK7aFi13337WHcMdGcM48=; b=owEBbQKS/ZANAwAIAWACP8TTSSByAcsmYgBqt70+EPEh7Pr+laDPW4tWdnCaH47gu2yL7r0Gt l2/AzxTDnCJAjMEAAEIAB0WIQTXegnP7twrvVOnBHRgAj/E00kgcgUCare9PgAKCRBgAj/E00kg cr+8EACMj0EdXOb53DNNjlp+WWKFSp/7RfbfxhXER7ZgaAxztTLpMF8MUe49qSwIIE7evRvh3U2 3dtguNMZCawah/9kZLL89nEsaR0piJKrZLC1m6td+zSz0diVBwm22ixLjImzV1w1vkMJdicxH8A 8QzSC/SsegXq/dZZYXdBEv1N5wKE8WTUT59/4W+JDaYBu7eoB0oG+EcVhfNOrDF7kJxMfpUOZML oC8k3IuDvpdPuQ+zY1T+lcOsN8SlkU3HZjzjNY54VeoMz/DCZ0YUhIKnSeOspXgVPMsq82nvJAt hpOZosAoeYj4q0R9S9FTqycfx3ZNYdMnJBRaN6+tGK24U7p+8JD67ke/SPgQg3atm/Xnp8cFP70 m1lKB8rdLu3OHSXEu8qUpi+xuvtFSCFJCWjC85N5cIWTC69oVWqPrb/hcEMkLuWlDYBGAQCIdly BtmDFEMkDbc8jcJbOtUnR5RUHWKC1Wv6ffjFCPbwn0Pr0XrL9JhS1U+11XnpgUs15KIpYW2YCqb LFMkID4eBa2HMb/cq25zJYFOaXYy12MnmuZcpO+dzIyIS6k9cvX5V80kiNJ7nHQMurJe9MYpgA9 YWvMbtcY4i74m0sl7u7obrR6Cr1ib1JGhwgcoTcmsZGiQrz4SYGkm/lot/jrcr+3eJfBakNftN5 MO9GKRI02vmmyFA== 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 This is needed by followup commit introducing 1st gen of type-c support. Assisted-by: LLM Co-developed-by: Alexey Minnekhanov Signed-off-by: Alexey Minnekhanov Signed-off-by: David Heidelberg Reviewed-by: Bryan O'Donoghue --- drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.h b/drivers/usb/ty= pec/tcpm/qcom/qcom_pmic_typec.h index 3c75820c91876..6f89d296ad151 100644 --- a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.h +++ b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.h @@ -6,17 +6,17 @@ #ifndef __QCOM_PMIC_TYPEC_H__ #define __QCOM_PMIC_TYPEC_H__ =20 struct pmic_typec { struct device *dev; struct tcpm_port *tcpm_port; struct tcpc_dev tcpc; struct pmic_typec_pdphy *pmic_typec_pdphy; - struct pmic_typec_port *pmic_typec_port; + void *pmic_typec_port; =20 int (*pdphy_start)(struct pmic_typec *tcpm, struct tcpm_port *tcpm_port); void (*pdphy_stop)(struct pmic_typec *tcpm); =20 int (*port_start)(struct pmic_typec *tcpm, struct tcpm_port *tcpm_port); void (*port_stop)(struct pmic_typec *tcpm); --=20 2.55.0 From nobody Wed Oct 28 02:14:12 2026 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 1DDA443F4CD; 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=sSjOgBX4oRcRixFUgsnLrXILFcPiTtEb8UYEicIPXaksg4jnjgzubyDa8OS2+u1PTsf+pSdTtcxcun4tJA1taO1eIz4ygMbQO4GfoBTCk0+RNxTT/KVxXcJkavY0/tm+/bkUJyEKwwelhxBJilCDlQjygRuDNPYdwDXlmAjcaWc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790426434; c=relaxed/simple; bh=CbitlEm4C1LRXGOhGoMRNWKo7JTZBmlS8VhWp6mv4So=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tAIO7pdmnp5/AWPJmnEHZMnHtHAmml8PjwRLL2uPdVw2QeVlGNf//51tknSUsgZElHPn+QCwhJlUXy2wg/YSJf+46NhHq4LkJ9uj64i0uGsSlCRPJ4lKjSHk/bRzGI4DORx6EjSgA74rY/YkBsRX8jbx43uJ1yEB+WmGVrkwIkw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EtTU4rbo; 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="EtTU4rbo" Received: by smtp.kernel.org (Postfix) with ESMTPS id BDE79C2BCFF; 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=1790426433; bh=CbitlEm4C1LRXGOhGoMRNWKo7JTZBmlS8VhWp6mv4So=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=EtTU4rbovS4xzokNa0EkTP0r7i/iYHE892Cypj64EyF2UinfUWotb0TiN31tSLaAW a65HAJCizuuSJJ0NVERNazHzHVyTVTO+VxRlEsnFEtGukUefOTCl6YifRwz1/QNHKz P8VRQjR8NB8kXaeyQ7PJwy9mWAi5Z1hFK+2yT6xF1ZYNzj55CTZthiSoGHBk3q3v+K i0D5DmGOx5OfNBwpPYatJ7yYkGH1aA/JGu8t4CdFL8Y4Ew9KnKIXHBu3WwLZE799n1 jtgLCKRqdzbF9kCejl1HRka4EOISu7q7QPdfrXnhQF8dRiCF0jXBk1D6ND/iN3WAI3 XQIaKQ3HaLlsQ== 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 A0B4BC98332; Sat, 26 Sep 2026 12:40:33 +0000 (UTC) From: David Heidelberg via B4 Relay Date: Sat, 26 Sep 2026 14:40:25 +0200 Subject: [PATCH RFC 06/12] usb: typec: qcom: Add gen1 Type-C port support 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: quoted-printable Message-Id: <20260926-typec-v1-6-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=20810; i=david@ixit.cz; h=from:subject:message-id; bh=lwCi5F7brUNbuKWKf7yWNCLhdQnuROjga0askdAs3Zs=; b=owEBbQKS/ZANAwAIAWACP8TTSSByAcsmYgBqt70+VdzhcG/H+UXlk7jrDe6NT+n49kEgOk84V lSWXArNAliJAjMEAAEIAB0WIQTXegnP7twrvVOnBHRgAj/E00kgcgUCare9PgAKCRBgAj/E00kg csTxD/9r2ndOi/phci0sa/0U0fIjnuh0i16zTYsvkkeK7OF1Q3zacSEnAZIwTn4/PxaTptX+yzI Wcb+3SBE3fg56/O4/vHprcP7JoFw64AlgKz/1HLDX20tAa9AyGbkGp4a7E8QL/idBZOO8IuM70R HOr9XRO+hNR+IfwZcEBvHW5Us2bPEfHWN1VOIw4Mfie4gxzwf7YRe5VB/u0vImOzsJb1BvaJlpt 53V5b2U0/jp7/Plseo+z40mSPUyygS+chiCSjVzMf9EU+SJ8spHRyGFOQGR8OVoiut1Z/F2Ykdq xPgThqjiyvp/8gZoQnBVpLMPs+3NKcXlrYBUgeq3eAEmRXba87xsVvS0tCUW2iYG9U66RsVozUE OcnXUwmrbFJqKy4F+SnZP8IXWD8BkgcaBugT8Ta6FvqQtSc6AztvEa3n/hPQnC1Qjm5ROtIu8bZ L9LOp9VuHXYOyayjTLoDU6vr8L24SBgeHSYUntJf0yTPbMmCyhWv3RCwJbUYgdWC/FPlKdAUuJx Pb0SLlF7gtgoB4nRPG/sMwz1J51QVg1XGQ/Pe02+Wn1GhABI7+shb0BckxIWtgy/X/CAbRJrHyT 73sZ1b86TfM9UvbV552w3bGGTuyl+XrC0L513z/01se7f63fu08pi0ZhV1M4itIlBQSdJUdwpXD fICnl8OHIEdCWlw== 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 Add a port backend for the first generation of the Qualcomm PMIC Type-C block, found on PM660 and PMI8998. On gen1 the Type-C CC logic is part of the charger's USBIN peripheral (base 0x1300) instead of the standalone Type-C peripheral used by PM8150B and later PMICs. All Type-C events (CC state change, tCCDebounce done, VBUS change and error) are signalled through a single aggregate "type-c-change" interrupt, the handler re-reads TYPEC_STATUS_4 to find out what changed. The PD PHY is register compatible with PM8150B and is reused as is. Differences to the PM8150B backend: - get_cc() returns -EBUSY until the hardware reports tCCDebounce done, instead of using a software debounce. - As a source, only the default and 1.5A Rp can be advertised, 3.0A requests are advertised as 1.5A. - The PBS workaround of the downstream SMB2 driver (TM_IO_DTEST4_SEL) is applied on every power role change. VBUS sourcing is optional and only used when the connector provides a vbus-supply, as the charger doesn't expose a VBUS regulator yet. Assisted-by: LLM Co-developed-by: Alexey Minnekhanov Signed-off-by: Alexey Minnekhanov Signed-off-by: David Heidelberg --- drivers/usb/typec/tcpm/qcom/Makefile | 1 + drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c | 9 + .../typec/tcpm/qcom/qcom_pmic_typec_port_gen1.c | 605 +++++++++++++++++= ++++ .../typec/tcpm/qcom/qcom_pmic_typec_port_gen1.h | 15 + 4 files changed, 630 insertions(+) diff --git a/drivers/usb/typec/tcpm/qcom/Makefile b/drivers/usb/typec/tcpm/= qcom/Makefile index cc23042b94878..b8b9350184c19 100644 --- a/drivers/usb/typec/tcpm/qcom/Makefile +++ b/drivers/usb/typec/tcpm/qcom/Makefile @@ -1,7 +1,8 @@ # SPDX-License-Identifier: GPL-2.0 # obj-$(CONFIG_TYPEC_QCOM_PMIC) +=3D qcom_pmic_tcpm.o qcom_pmic_tcpm-y +=3D qcom_pmic_typec.o \ qcom_pmic_typec_port.o \ + qcom_pmic_typec_port_gen1.o \ qcom_pmic_typec_pdphy.o \ qcom_pmic_typec_pdphy_stub.o \ diff --git a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c b/drivers/usb/ty= pec/tcpm/qcom/qcom_pmic_typec.c index 41aaae6bb3724..ea1d5b0927436 100644 --- a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c +++ b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c @@ -12,16 +12,17 @@ #include #include =20 #include =20 #include "qcom_pmic_typec.h" #include "qcom_pmic_typec_pdphy.h" #include "qcom_pmic_typec_port.h" +#include "qcom_pmic_typec_port_gen1.h" =20 typedef int (*pmic_typec_port_probe_fn)(struct platform_device *pdev, struct pmic_typec *tcpm, const struct pmic_typec_port_resources *res, struct regmap *regmap, u32 base); =20 struct pmic_typec_resources { const struct pmic_typec_pdphy_resources *pdphy_res; @@ -134,31 +135,39 @@ static void qcom_pmic_typec_remove(struct platform_de= vice *pdev) struct pmic_typec *tcpm =3D platform_get_drvdata(pdev); =20 tcpm->pdphy_stop(tcpm); tcpm->port_stop(tcpm); tcpm_unregister_port(tcpm->tcpm_port); fwnode_handle_put(tcpm->tcpc.fwnode); } =20 +static const struct pmic_typec_resources gen1_typec_res =3D { + .pdphy_res =3D &pm8150b_pdphy_res, + .port_res =3D &gen1_port_res, + .port_probe =3D qcom_pmic_typec_gen1_port_probe, +}; + static const struct pmic_typec_resources pm8150b_typec_res =3D { .pdphy_res =3D &pm8150b_pdphy_res, .port_res =3D &pm8150b_port_res, .port_probe =3D qcom_pmic_typec_port_probe, }; =20 static const struct pmic_typec_resources pmi632_typec_res =3D { /* PD PHY not present */ .port_res =3D &pm8150b_port_res, .port_probe =3D qcom_pmic_typec_port_probe, }; =20 static const struct of_device_id qcom_pmic_typec_table[] =3D { + { .compatible =3D "qcom,pm660-typec", .data =3D &gen1_typec_res }, { .compatible =3D "qcom,pm8150b-typec", .data =3D &pm8150b_typec_res }, { .compatible =3D "qcom,pmi632-typec", .data =3D &pmi632_typec_res }, + { .compatible =3D "qcom,pmi8998-typec", .data =3D &gen1_typec_res }, { } }; MODULE_DEVICE_TABLE(of, qcom_pmic_typec_table); =20 static struct platform_driver qcom_pmic_typec_driver =3D { .driver =3D { .name =3D "qcom,pmic-typec", .of_match_table =3D qcom_pmic_typec_table, diff --git a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port_gen1.c b/driv= ers/usb/typec/tcpm/qcom/qcom_pmic_typec_port_gen1.c new file mode 100644 index 0000000000000..b4e3e49664f9d --- /dev/null +++ b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port_gen1.c @@ -0,0 +1,605 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Qualcomm Type-C port backend (1st gen) + * + * GEN1 predates the standalone PM8150B-style Type-C register block. + * Its CC/role controls live in the USBIN peripheral, while the PD PHY + * is a separate PMIC peripheral. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "qcom_pmic_typec.h" +#include "qcom_pmic_typec_port.h" +#include "qcom_pmic_typec_port_gen1.h" + +/* USBIN Type-C status */ +#define TYPEC_STATUS_1_REG 0x0b +#define UFP_TYPEC_MASK GENMASK(7, 5) +#define UFP_TYPEC_RDSTD BIT(7) +#define UFP_TYPEC_RD1P5 BIT(6) +#define UFP_TYPEC_RD3P0 BIT(5) + +#define TYPEC_STATUS_2_REG 0x0c +#define DFP_TYPEC_MASK GENMASK(3, 0) +#define DFP_RD_OPEN BIT(3) +#define DFP_RD_RA_VCONN BIT(2) +#define DFP_RD_RD BIT(1) +#define DFP_RA_RA BIT(0) + +#define TYPEC_STATUS_4_REG 0x0e +#define UFP_DFP_MODE_STATUS BIT(7) +#define TYPEC_VBUS_STATUS BIT(6) +#define TYPEC_VBUS_ERROR BIT(5) +#define TYPEC_DEBOUNCE_DONE BIT(4) +#define CC_ORIENTATION BIT(1) +#define CC_ATTACHED BIT(0) + +/* USBIN Type-C configuration */ +#define TYPEC_CFG_REG 0x58 +#define TYPEC_OR_U_USB BIT(0) + +#define TYPEC_CFG_2_REG 0x59 +#define EN_TRY_SOURCE_MODE BIT(3) +#define EN_80UA_180UA_CUR_SOURCE BIT(0) + +#define TYPEC_CFG_3_REG 0x5a +#define EN_TRYSINK_MODE BIT(2) + +#define TYPEC_INTRPT_ENB_REG 0x67 +#define VBUS_ERROR_INT_EN BIT(5) +#define DEBOUNCE_DONE_INT_EN BIT(3) +#define CCSTATE_CHANGE_INT_EN BIT(2) +#define VBUS_DEASSERT_INT_EN BIT(1) +#define VBUS_ASSERT_INT_EN BIT(0) + +#define TYPEC_SW_CTRL_REG 0x68 +#define VCONN_EN_ORIENTATION BIT(6) +#define VCONN_EN_SRC BIT(4) +#define VCONN_EN_VALUE BIT(3) +#define POWER_ROLE_CMD_MASK GENMASK(2, 0) +#define UFP_EN_CMD BIT(2) +#define DFP_EN_CMD BIT(1) +#define TYPEC_DISABLE_CMD BIT(0) + +/* GEN1 TYPEC_PBS_WA_BIT workaround used by the downstream SMB2 driver. */ +#define MISC_BASE_OFFSET 0x300 +#define TM_IO_DTEST4_SEL 0xe9 +#define PBS_CRUDE_SENSOR_ENABLE 0xa5 + +/* Interrupt numbers */ +#define PMIC_TYPEC_CHANGE_IRQ 0x0 + +struct gen1_typec_port { + struct device *dev; + struct tcpm_port *tcpm_port; + struct regmap *regmap; + u32 base; + int irq; + + struct regulator *vbus; + bool vbus_enabled; + bool vbus_present; + bool vbus_valid; + struct mutex lock; /* serializes register RMW and VBUS state */ +}; + +const struct pmic_typec_port_resources gen1_port_res =3D { + .nr_irqs =3D 1, + .irq_params =3D { + { + .irq_name =3D "type-c-change", + .virq =3D PMIC_TYPEC_CHANGE_IRQ, + }, + }, +}; + +/* + * Failure of this workaround write is non-fatal and + * we can continue with the role transition. + */ +static void gen1_typec_pbs_wa(struct gen1_typec_port *port, bool sink) +{ + unsigned int val =3D sink ? 0 : PBS_CRUDE_SENSOR_ENABLE; + int ret; + + ret =3D regmap_write(port->regmap, port->base + + MISC_BASE_OFFSET + TM_IO_DTEST4_SEL, val); + if (!ret) + return; + + dev_warn(port->dev, + "failed to update GEN1 Type-C PBS workaround: %d\n", + ret); +} + +static int gen1_typec_set_power_role(struct gen1_typec_port *port, + unsigned int role) +{ + int ret; + + gen1_typec_pbs_wa(port, role =3D=3D UFP_EN_CMD); + + ret =3D regmap_update_bits(port->regmap, + port->base + TYPEC_SW_CTRL_REG, + POWER_ROLE_CMD_MASK, role); + if (ret) + dev_err(port->dev, "failed to set Type-C power role: %d\n", ret); + + return ret; +} + +static int gen1_typec_get_vbus(struct tcpc_dev *tcpc) +{ + struct pmic_typec *tcpm =3D tcpc_to_tcpm(tcpc); + struct gen1_typec_port *port =3D tcpm->pmic_typec_port; + unsigned int status; + int ret; + + mutex_lock(&port->lock); + ret =3D regmap_read(port->regmap, port->base + + TYPEC_STATUS_4_REG, &status); + if (ret) + ret =3D port->vbus_enabled; + else + ret =3D port->vbus_enabled || !!(status & TYPEC_VBUS_STATUS); + mutex_unlock(&port->lock); + + return ret; +} + +static int gen1_typec_set_vbus(struct tcpc_dev *tcpc, bool on, bool sink) +{ + struct pmic_typec *tcpm =3D tcpc_to_tcpm(tcpc); + struct gen1_typec_port *port =3D tcpm->pmic_typec_port; + bool changed =3D false; + int ret =3D 0; + + if (!port->vbus) + return 0; + + mutex_lock(&port->lock); + + if (port->vbus_enabled =3D=3D on) + goto out; + + if (on) + ret =3D regulator_enable(port->vbus); + else + ret =3D regulator_disable(port->vbus); + + if (!ret) { + port->vbus_enabled =3D on; + changed =3D true; + } + +out: + mutex_unlock(&port->lock); + + /* + * set_vbus() may run during tcpm_register_port() before port_start() + * provides tcpm_port. Once registered, notify TCPM whenever the + * source regulator actually changes state. get_vbus() also accounts + * for vbus_enabled when GEN1 does not reflect sourced VBUS in + * TYPEC_VBUS_STATUS. + */ + if (changed && port->tcpm_port) + tcpm_vbus_change(port->tcpm_port); + + return ret; +} + +static int gen1_typec_get_cc(struct tcpc_dev *tcpc, + enum typec_cc_status *cc1, + enum typec_cc_status *cc2) +{ + struct pmic_typec *tcpm =3D tcpc_to_tcpm(tcpc); + struct gen1_typec_port *port =3D tcpm->pmic_typec_port; + enum typec_cc_status active =3D TYPEC_CC_OPEN; + unsigned int status1, status2, status4; + bool orientation_cc2; + int ret; + + *cc1 =3D TYPEC_CC_OPEN; + *cc2 =3D TYPEC_CC_OPEN; + + mutex_lock(&port->lock); + + ret =3D regmap_read(port->regmap, port->base + + TYPEC_STATUS_4_REG, &status4); + if (ret) + goto out; + + if (!(status4 & CC_ATTACHED)) + goto out; + + /* + * CC is not stable until tCCDebounce has elapsed. TCPM ignores + * -EBUSY and the DEBOUNCE_DONE interrupt triggers a new read. + */ + if (!(status4 & TYPEC_DEBOUNCE_DONE)) { + ret =3D -EBUSY; + goto out; + } + + ret =3D regmap_read(port->regmap, port->base + + TYPEC_STATUS_1_REG, &status1); + if (ret) + goto out; + + ret =3D regmap_read(port->regmap, port->base + + TYPEC_STATUS_2_REG, &status2); + if (ret) + goto out; + + orientation_cc2 =3D !!(status4 & CC_ORIENTATION); + + if (status4 & UFP_DFP_MODE_STATUS) { + /* Local port is DFP/source; decode the partner's Rd/Ra. */ + switch (status2 & DFP_TYPEC_MASK) { + case DFP_RA_RA: + *cc1 =3D TYPEC_CC_RA; + *cc2 =3D TYPEC_CC_RA; + goto out; + case DFP_RD_RD: + *cc1 =3D TYPEC_CC_RD; + *cc2 =3D TYPEC_CC_RD; + goto out; + case DFP_RD_RA_VCONN: + active =3D TYPEC_CC_RD; + *cc1 =3D TYPEC_CC_RA; + *cc2 =3D TYPEC_CC_RA; + break; + case DFP_RD_OPEN: + active =3D TYPEC_CC_RD; + break; + default: + dev_dbg(port->dev, "unhandled GEN1 DFP status %#x\n", + status2); + goto out; + } + } else { + /* Local port is UFP/sink; decode the partner's advertised Rp. */ + switch (status1 & UFP_TYPEC_MASK) { + case UFP_TYPEC_RDSTD: + active =3D TYPEC_CC_RP_DEF; + break; + case UFP_TYPEC_RD1P5: + active =3D TYPEC_CC_RP_1_5; + break; + case UFP_TYPEC_RD3P0: + active =3D TYPEC_CC_RP_3_0; + break; + default: + dev_dbg(port->dev, "unhandled GEN1 UFP status %#x\n", + status1); + goto out; + } + } + + if (orientation_cc2) + *cc2 =3D active; + else + *cc1 =3D active; + +out: + mutex_unlock(&port->lock); + return ret; +} + +static int gen1_typec_set_cc(struct tcpc_dev *tcpc, + enum typec_cc_status cc) +{ + struct pmic_typec *tcpm =3D tcpc_to_tcpm(tcpc); + struct gen1_typec_port *port =3D tcpm->pmic_typec_port; + unsigned int role; + unsigned int rp_current =3D 0; + int ret; + + switch (cc) { + case TYPEC_CC_OPEN: + role =3D TYPEC_DISABLE_CMD; + break; + case TYPEC_CC_RD: + role =3D UFP_EN_CMD; + break; + case TYPEC_CC_RP_DEF: + role =3D DFP_EN_CMD; + rp_current =3D 0; + break; + case TYPEC_CC_RP_1_5: + case TYPEC_CC_RP_3_0: + /* + * GEN1 can only source 80 uA (default) or 180 uA (1.5 A). + * Advertise 1.5 A for 3.0 A requests, TCPM ignores set_cc() + * errors and would otherwise keep a stale Rp. + */ + role =3D DFP_EN_CMD; + rp_current =3D EN_80UA_180UA_CUR_SOURCE; + break; + default: + return -EINVAL; + } + + mutex_lock(&port->lock); + + if (role =3D=3D DFP_EN_CMD) { + ret =3D regmap_update_bits(port->regmap, + port->base + TYPEC_CFG_2_REG, + EN_80UA_180UA_CUR_SOURCE, + rp_current); + if (ret) + goto out; + } + + ret =3D gen1_typec_set_power_role(port, role); + +out: + mutex_unlock(&port->lock); + return ret; +} + +static int gen1_typec_set_polarity(struct tcpc_dev *tcpc, + enum typec_cc_polarity polarity) +{ + /* USB PHY orientation is handled outside this PMIC Type-C block. */ + return 0; +} + +static int gen1_typec_set_vconn(struct tcpc_dev *tcpc, bool on) +{ + struct pmic_typec *tcpm =3D tcpc_to_tcpm(tcpc); + struct gen1_typec_port *port =3D tcpm->pmic_typec_port; + unsigned int status4, orientation, mask, val; + int ret; + + mutex_lock(&port->lock); + + ret =3D regmap_read(port->regmap, port->base + + TYPEC_STATUS_4_REG, &status4); + if (ret) + goto out; + + /* VCONN is driven on the inactive CC pin. */ + orientation =3D (status4 & CC_ORIENTATION) ? + 0 : VCONN_EN_ORIENTATION; + + if (on) { + mask =3D VCONN_EN_ORIENTATION | VCONN_EN_VALUE; + val =3D orientation | VCONN_EN_VALUE; + } else { + mask =3D VCONN_EN_VALUE; + val =3D 0; + } + + ret =3D regmap_update_bits(port->regmap, + port->base + TYPEC_SW_CTRL_REG, + mask, val); + +out: + mutex_unlock(&port->lock); + return ret; +} + +static int gen1_typec_start_toggling(struct tcpc_dev *tcpc, + enum typec_port_type port_type, + enum typec_cc_status cc) +{ + struct pmic_typec *tcpm =3D tcpc_to_tcpm(tcpc); + struct gen1_typec_port *port =3D tcpm->pmic_typec_port; + unsigned int role; + unsigned int try_src =3D 0; + unsigned int try_snk =3D 0; + int ret; + + switch (port_type) { + case TYPEC_PORT_SRC: + role =3D DFP_EN_CMD; + break; + case TYPEC_PORT_SNK: + role =3D UFP_EN_CMD; + break; + case TYPEC_PORT_DRP: + role =3D 0; + /* + * Like the PM8150B backend, keep hardware Try.SNK enabled + * while TCPM owns the policy state machine. + */ + try_snk =3D EN_TRYSINK_MODE; + break; + default: + return -EINVAL; + } + + mutex_lock(&port->lock); + + ret =3D regmap_update_bits(port->regmap, + port->base + TYPEC_CFG_2_REG, + EN_TRY_SOURCE_MODE, try_src); + if (ret) + goto out; + + ret =3D regmap_update_bits(port->regmap, + port->base + TYPEC_CFG_3_REG, + EN_TRYSINK_MODE, try_snk); + if (ret) + goto out; + + /* Disable first so the state machine restarts toggling. */ + ret =3D gen1_typec_set_power_role(port, TYPEC_DISABLE_CMD); + if (ret) + goto out; + + ret =3D gen1_typec_set_power_role(port, role); + +out: + mutex_unlock(&port->lock); + return ret; +} + +static irqreturn_t gen1_typec_irq(int irq, void *data) +{ + struct gen1_typec_port *port =3D data; + unsigned int status4; + bool vbus; + bool vbus_changed =3D false; + + /* + * GEN1 exposes a single aggregate Type-C change interrupt. Always + * notify TCPM of CC changes. Only generate a VBUS event when the + * hardware VBUS state changes, or on the first observation so TCPM + * can establish the initial vSafe0V state. + */ + mutex_lock(&port->lock); + + if (!regmap_read(port->regmap, port->base + + TYPEC_STATUS_4_REG, &status4)) { + if (status4 & TYPEC_VBUS_ERROR) + dev_warn_ratelimited(port->dev, "Type-C VBUS error\n"); + + vbus =3D !!(status4 & TYPEC_VBUS_STATUS); + + if (!port->vbus_valid || vbus !=3D port->vbus_present) { + port->vbus_present =3D vbus; + port->vbus_valid =3D true; + vbus_changed =3D true; + } + } + + mutex_unlock(&port->lock); + + if (port->tcpm_port) { + if (vbus_changed) + tcpm_vbus_change(port->tcpm_port); + + tcpm_cc_change(port->tcpm_port); + } + + return IRQ_HANDLED; +} + +static int gen1_typec_port_start(struct pmic_typec *tcpm, + struct tcpm_port *tcpm_port) +{ + struct gen1_typec_port *port =3D tcpm->pmic_typec_port; + unsigned int irq_mask; + int ret; + + /* + * TYPE_C_OR_U_USB =3D=3D 0 selects the Type-C state machine on GEN1. + */ + ret =3D regmap_update_bits(port->regmap, + port->base + TYPEC_CFG_REG, + TYPEC_OR_U_USB, 0); + if (ret) + return ret; + + /* + * GEN1 exposes a single aggregate type-c-change interrupt, the + * handler re-reads TYPEC_STATUS_4 to find out what changed. + */ + irq_mask =3D CCSTATE_CHANGE_INT_EN | DEBOUNCE_DONE_INT_EN | + VBUS_ASSERT_INT_EN | VBUS_DEASSERT_INT_EN | + VBUS_ERROR_INT_EN; + + ret =3D regmap_write(port->regmap, + port->base + TYPEC_INTRPT_ENB_REG, + irq_mask); + if (ret) + return ret; + + /* Select software control for VCONN, initially disabled. */ + ret =3D regmap_update_bits(port->regmap, + port->base + TYPEC_SW_CTRL_REG, + VCONN_EN_SRC | VCONN_EN_VALUE, + VCONN_EN_SRC); + if (ret) + return ret; + + port->tcpm_port =3D tcpm_port; + enable_irq(port->irq); + + return 0; +} + +static void gen1_typec_port_stop(struct pmic_typec *tcpm) +{ + struct gen1_typec_port *port =3D tcpm->pmic_typec_port; + + disable_irq(port->irq); + port->tcpm_port =3D NULL; +} + +int qcom_pmic_typec_gen1_port_probe(struct platform_device *pdev, + struct pmic_typec *tcpm, + const struct pmic_typec_port_resources *res, + struct regmap *regmap, + u32 base) +{ + struct device *dev =3D &pdev->dev; + struct gen1_typec_port *port; + struct fwnode_handle *connector; + int ret; + + if (!res->nr_irqs || res->nr_irqs > PMIC_TYPEC_MAX_IRQS) + return -EINVAL; + + port =3D devm_kzalloc(dev, sizeof(*port), GFP_KERNEL); + if (!port) + return -ENOMEM; + + connector =3D device_get_named_child_node(dev, "connector"); + if (!connector) + return -EINVAL; + + port->vbus =3D devm_of_regulator_get_optional(dev, + to_of_node(connector), + "vbus"); + fwnode_handle_put(connector); + if (IS_ERR(port->vbus)) { + if (PTR_ERR(port->vbus) !=3D -ENODEV) + return PTR_ERR(port->vbus); + port->vbus =3D NULL; + } + + port->irq =3D platform_get_irq_byname(pdev, + res->irq_params[0].irq_name); + if (port->irq < 0) + return port->irq; + + port->dev =3D dev; + port->regmap =3D regmap; + port->base =3D base; + mutex_init(&port->lock); + + ret =3D devm_request_threaded_irq(dev, port->irq, NULL, + gen1_typec_irq, + IRQF_ONESHOT | IRQF_NO_AUTOEN, + res->irq_params[0].irq_name, port); + if (ret) + return ret; + + tcpm->pmic_typec_port =3D port; + + tcpm->tcpc.get_vbus =3D gen1_typec_get_vbus; + tcpm->tcpc.set_vbus =3D gen1_typec_set_vbus; + tcpm->tcpc.get_cc =3D gen1_typec_get_cc; + tcpm->tcpc.set_cc =3D gen1_typec_set_cc; + tcpm->tcpc.set_polarity =3D gen1_typec_set_polarity; + tcpm->tcpc.set_vconn =3D gen1_typec_set_vconn; + tcpm->tcpc.start_toggling =3D gen1_typec_start_toggling; + + tcpm->port_start =3D gen1_typec_port_start; + tcpm->port_stop =3D gen1_typec_port_stop; + + return 0; +} diff --git a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port_gen1.h b/driv= ers/usb/typec/tcpm/qcom/qcom_pmic_typec_port_gen1.h new file mode 100644 index 0000000000000..45e373d22edca --- /dev/null +++ b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port_gen1.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __QCOM_PMIC_TYPEC_PORT_GEN1_H__ +#define __QCOM_PMIC_TYPEC_PORT_GEN1_H__ + +#include "qcom_pmic_typec_port.h" + +extern const struct pmic_typec_port_resources gen1_port_res; + +int qcom_pmic_typec_gen1_port_probe(struct platform_device *pdev, + struct pmic_typec *tcpm, + const struct pmic_typec_port_resources *res, + struct regmap *regmap, + u32 base); + +#endif /* __QCOM_PMIC_TYPEC_PORT_GEN1_H__ */ --=20 2.55.0 From nobody Wed Oct 28 02:14:12 2026 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 16AA243F0B6; 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=YlNZgFMjPOGTerFgiFjByYHyeE5GgAVu2M54Q8c3KTreXp4BsTgVsHLe0fK8ojb/SvPHVT5A0NKq89VVyQ5pj0UqtDeWziEMyzL6U1GnpLGcL3uhLa0aayLuIG4n/XrxYfHYmM9wKVyBu4tFrT5QMjPlxEBq2zW1EaopslS/ieQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790426434; c=relaxed/simple; bh=68Xo+7AbOTjtfo8IuA3Hr7KPjXQFLlOeewWxpvBQVgE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=n2IDqWEAtewbiayatgoheJtsyxyX4zl9ykTU9ue2MrmNfGb6zyle+BU9okPRmX1Pgzwxi1OIZx9AcPl4PPnfKiY+EclI/Hpr2WkC95KQKWIyK78ozZH16scglvoYWriV15+fc9XhyDwovat4mv8G90I8oVlSTrADxBCXKRe/cBU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jqt5xZgn; 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="jqt5xZgn" Received: by smtp.kernel.org (Postfix) with ESMTPS id C95D9C2BCFD; 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=1790426433; bh=68Xo+7AbOTjtfo8IuA3Hr7KPjXQFLlOeewWxpvBQVgE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=jqt5xZgnHJOa3OxB1/BVrQ7LoUoWcm/2e7BmzfqFS/mb8s1jMN0RYAI08ZvRemgnz sq37C6X6AN65iwaIywFM5Cf1Gyf7320+3cCwblowkZBrHxBxiMl5P82/lhv7i/r1Ik us9X7gASb5KnoXNvG1Vn9t/AV9VnmIeI2kFhrbp5fAufm2w12r7XliBrKgJZioysdk gHNyewXmw0xWCJrp2v3tQfSRMm4DmY/0G6Q0lhMQ81oaLRi8l1v5N5rXV1v88nXGvk f0P6iMcgSsmgUk2GtIRfZrKcEUMR8/4Os1PPiO4Rcapqq60fYpBJWijfpsgJokwZiS ye2xbSvweTKBw== 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 B3377C98338; Sat, 26 Sep 2026 12:40:33 +0000 (UTC) From: David Heidelberg via B4 Relay Date: Sat, 26 Sep 2026 14:40:26 +0200 Subject: [PATCH RFC 07/12] arm64: dts: qcom: pm660: Add USB Type-C port controller node 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: quoted-printable Message-Id: <20260926-typec-v1-7-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=2238; i=david@ixit.cz; h=from:subject:message-id; bh=nfUfneQHFyPXoTLQ2iDCROlyx0D+c7Q2EAHBttmHuPo=; b=owEBbQKS/ZANAwAIAWACP8TTSSByAcsmYgBqt70+kPL94BUUjOGf4dU2jnzEuweWBFTQyYS1b HYZ1UvtVlyJAjMEAAEIAB0WIQTXegnP7twrvVOnBHRgAj/E00kgcgUCare9PgAKCRBgAj/E00kg cqVREACz+DbVUSwKhcqkKE4OxwCx4JSHA1cEOJA49V4LAZx/la2dL4AiUV3IlxIFYTbqLfKPpRR eIaXAYKkUUnmXwNsEPZdpqPuruUdkhWm0phR28T7BRg4V+xf6d5euRn4MKo0OyErAAmsQbyxNPA Xgxy0vCVrIybsEQwoNvK6UiSXbRlDyj1FZcc+fGmw+br9xRysgXO2ucMfeYlfWROW8d1Jg+zkqr SU5/sVC0l60Oof+kgzSki+rrdc4FL+FPaeIfz1gUydnS2FCRZOPMVRB9vZ64E4bdENd6YvoLb6Y S0G0MV7BJZRsdGFqt9joe/i8M2ZUrH0GJ7dFsk9zyKSqn7nwZS+5RQnWrjPWqddxV1uSSmWmqZp Z1S1DPPVg0fQXxUCctvsN1+lNzkXNmVqsfDxjIIZkl3KYil4EdpwD5+xhOTmv6BuqVH4tJXjApx s6V/BJkSUwmfocC09nYr2bdS9wGqQQ4N3Hmb4E++/jw8C6DPb45WBrv7lsC7ofo7axuPHG3ZR4i 8jgGB2fwINzKdsN1GGWrqMw5BJnVScWmmE4kqDFoaBlBcPAUV0jpRmW76LwRIPFHOuoCRk/qPa9 aSBijLscrdMObCOLrHYFMS1ockbiHDiUqWzyZmDugImCaodL56lrSlY9/GlsMn5c0zarR3DxeHM 5LMkgFXkKssTOyA== 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: Alexey Minnekhanov Add the PM660 Type-C port controller and PD PHY device node. As on PMI8998, the Type-C CC logic is part of the charger's USBIN peripheral at 0x1300, the PD PHY is at 0x1700. The node uses the 'type-c-change' interrupt from the USBIN peripheral for CC state notifications, plus the 8 PD PHY interrupts, including fr-swap. The node is disabled by default; individual boards enable it and provide the USB-C connector description with PD capabilities and port graph. Assisted-by: LLM Signed-off-by: Alexey Minnekhanov Signed-off-by: David Heidelberg Reviewed-by: Bryan O'Donoghue --- arch/arm64/boot/dts/qcom/pm660.dtsi | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/pm660.dtsi b/arch/arm64/boot/dts/qcom= /pm660.dtsi index 156b2ddff0dcb..37965a3607417 100644 --- a/arch/arm64/boot/dts/qcom/pm660.dtsi +++ b/arch/arm64/boot/dts/qcom/pm660.dtsi @@ -85,16 +85,43 @@ pm660_charger: charger@1000 { =20 io-channels =3D <&pm660_rradc 3>, <&pm660_rradc 4>; io-channel-names =3D "usbin_i", "usbin_v"; =20 status =3D "disabled"; }; =20 + pm660_typec: typec@1300 { + compatible =3D "qcom,pm660-typec"; + reg =3D <0x1300>, + <0x1700>; + + interrupts =3D <0x0 0x13 0x7 IRQ_TYPE_EDGE_RISING>, + <0x0 0x17 0x0 IRQ_TYPE_EDGE_RISING>, + <0x0 0x17 0x1 IRQ_TYPE_EDGE_RISING>, + <0x0 0x17 0x2 IRQ_TYPE_EDGE_RISING>, + <0x0 0x17 0x3 IRQ_TYPE_EDGE_RISING>, + <0x0 0x17 0x4 IRQ_TYPE_EDGE_RISING>, + <0x0 0x17 0x5 IRQ_TYPE_EDGE_RISING>, + <0x0 0x17 0x6 IRQ_TYPE_EDGE_RISING>, + <0x0 0x17 0x7 IRQ_TYPE_EDGE_RISING>; + interrupt-names =3D "type-c-change", + "sig-tx", + "sig-rx", + "msg-tx", + "msg-rx", + "msg-tx-failed", + "msg-tx-discarded", + "msg-rx-discarded", + "fr-swap"; + + status =3D "disabled"; + }; + pm660_temp: temp-alarm@2400 { compatible =3D "qcom,spmi-temp-alarm"; reg =3D <0x2400>; interrupts =3D <0x0 0x24 0x0 IRQ_TYPE_EDGE_RISING>; io-channels =3D <&pm660_adc ADC5_DIE_TEMP>; io-channel-names =3D "thermal"; #thermal-sensor-cells =3D <0>; }; --=20 2.55.0 From nobody Wed Oct 28 02:14:12 2026 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 1742E43F0B9; 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=YadQZtwbM1+7bIDnibIZtTKxaIYLeMqH69QyDd29b3eB0cDH2rp7YaZiWBkz+b3tB6UoEH+joWcIs5iLQ4DqxiLP9lP4mUXHxDjyXs4jxQqvPQ8r1zGuGU8YmvFnfqaWAgGLaoqp+XoGaK6xK8hdrC/tgN9l4z2TZ+mjDAc/HLs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790426434; c=relaxed/simple; bh=LLyswk7NKb2yaS7ZWh+Mum5Z3Tsg6nYRqsHAkNeDZ+c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Uzof55dQrGBRnQfE8OHBviLWKOuaIgDkBLfrmR9yy1wh8iDWlPjJi8PIb7CRIfZz8hufVDaFDEuDobzb0QK+pY/X7auXDv1e+YIfyF4Mn3bnSSXZVtRP5wQqAIGmK/ocpnbISD7FW4JFHxH7TTGV6x3VftCVLxU6F+nDe74TWZw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Y5mgu/hY; 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="Y5mgu/hY" Received: by smtp.kernel.org (Postfix) with ESMTPS id D6B6BC2BCFA; 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=1790426433; bh=LLyswk7NKb2yaS7ZWh+Mum5Z3Tsg6nYRqsHAkNeDZ+c=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=Y5mgu/hYlPnobuZuSbvd41yPRkUg3AORFKZp5IMXLWBja7/YSitWi94GM3nkAQtMo 9UqQNIQowZ3E0kBH9IOuRThSc5vTy6ydMku1KioZor16tjEN0ICf9J8E/JguLp5mSb iXZ9EazOILS1WcKcg9W1+o+fDL/5sXIHPU9DAEfGM8HH9jEw8BBnP6bsbdIBZWPW4R oD5L3uKX4R1j3yx7/PNDWll9WKfeRcPnGFA3wuSryQINXpKpMT34dUcolRcAGUF4Cr 8rBWUXEwUfNZGUO3Fixn8BG0tPY9ilAQobXbWB3pglHqhi4RxhOWJj6o4R3tVs9FUI IxjzlyKQ1mJ4A== 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 C5D61C98328; Sat, 26 Sep 2026 12:40:33 +0000 (UTC) From: David Heidelberg via B4 Relay Date: Sat, 26 Sep 2026 14:40:27 +0200 Subject: [PATCH RFC 08/12] arm64: dts: qcom: pmi8998: Add USB Type-C port controller node 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: quoted-printable Message-Id: <20260926-typec-v1-8-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=2142; i=david@ixit.cz; h=from:subject:message-id; bh=RieyzNgTb75VGeJsjq62hPOrIsikmavlqM7+JXkr+qg=; b=owEBbQKS/ZANAwAIAWACP8TTSSByAcsmYgBqt70+hRgy8KUAH4mpYNQGJAeTLLsf1WXpUNnqL U2lph0zExGJAjMEAAEIAB0WIQTXegnP7twrvVOnBHRgAj/E00kgcgUCare9PgAKCRBgAj/E00kg csT5EACstGo4EK8/PM5YY9feak3r3qMK+hB2xbrMeNEW8ItM8IQd3sen0VXPFVcGzL7XzKbQ/EN tDREYBfiN4pfXeZWfXTCr9z3rbv3xT3/jCo/0KYT1dOcOMo6U9M002lq0ZlltL4MMi/bi4N5ykf Q/sVh1H82IITWcqriljTQl+4JSzISseeIiIeP/m4kiv3NJ3Fb5wZ/ql1nkqk8MXwJENZAc0aGbM /s0gOShQxNEkGUqKSl5owXD60auXbNLnqvWTMmY4krRp0HV9aD8eiQXv+N4F39wCJPPcerJXcJW EoLhT9P89LPO1oiWerKUjeNhM0AuigruCZJUJE97xD2JAWimVAvfN24erXzlQuRIN1fEGIEnfMI JK1dkMVfDlmuV3m96qe4X1AZ+6xOyCa+8FDFKOHtcrOsLK31PqjMXDRuPuVL+IiwFdFlVNOg1SU 3tNY3MhhzlcgyU3TuP8og9vnKfWXLyE02r9UeGjtH+Ght36QUW3Dgnp2leEuZM4xJ+evi7vw4ED V//UYxzhmJhbGkSDi4FnUG8G9/vdVwzm9ykX1Sl0jFIn4V0Qh0gZ0ohJcVjQ+g1aJCFQrmDbah/ UmXHkdhVcoFtSmRsEnQXItwZ1rMzvYChAJklsDEPAJioAqWH/ViXc4W3kai+LuO3QRJ2Uf00ynA KZ/ZPZYQd+5lE6A== 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 Add the pmi8998 Type-C port controller and PD PHY device node. The Type-C CC logic is at USBIN base 0x1300 and the PD PHY is at 0x1700. The node uses the 'type-c-change' interrupt from the USBIN peripheral for CC state notifications, plus the 8 PD PHY interrupts, including fr-swap. The node is disabled by default; individual boards enable it and provide the USB-C connector description with PD capabilities and port graph. Assisted-by: LLM Signed-off-by: David Heidelberg Reviewed-by: Bryan O'Donoghue --- arch/arm64/boot/dts/qcom/pmi8998.dtsi | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/pmi8998.dtsi b/arch/arm64/boot/dts/qc= om/pmi8998.dtsi index cd3f0790fd420..878e577c667d0 100644 --- a/arch/arm64/boot/dts/qcom/pmi8998.dtsi +++ b/arch/arm64/boot/dts/qcom/pmi8998.dtsi @@ -24,16 +24,43 @@ pmi8998_charger: charger@1000 { =20 io-channels =3D <&pmi8998_rradc 3>, <&pmi8998_rradc 4>; io-channel-names =3D "usbin_i", "usbin_v"; =20 status =3D "disabled"; }; =20 + pmi8998_typec: typec@1300 { + compatible =3D "qcom,pmi8998-typec"; + reg =3D <0x1300>, + <0x1700>; + + interrupts =3D <0x2 0x13 0x7 IRQ_TYPE_EDGE_RISING>, + <0x2 0x17 0x0 IRQ_TYPE_EDGE_RISING>, + <0x2 0x17 0x1 IRQ_TYPE_EDGE_RISING>, + <0x2 0x17 0x2 IRQ_TYPE_EDGE_RISING>, + <0x2 0x17 0x3 IRQ_TYPE_EDGE_RISING>, + <0x2 0x17 0x4 IRQ_TYPE_EDGE_RISING>, + <0x2 0x17 0x5 IRQ_TYPE_EDGE_RISING>, + <0x2 0x17 0x6 IRQ_TYPE_EDGE_RISING>, + <0x2 0x17 0x7 IRQ_TYPE_EDGE_RISING>; + interrupt-names =3D "type-c-change", + "sig-tx", + "sig-rx", + "msg-tx", + "msg-rx", + "msg-tx-failed", + "msg-tx-discarded", + "msg-rx-discarded", + "fr-swap"; + + status =3D "disabled"; + }; + pmi8998_gpios: gpio@c000 { compatible =3D "qcom,pmi8998-gpio", "qcom,spmi-gpio"; reg =3D <0xc000>; gpio-controller; gpio-ranges =3D <&pmi8998_gpios 0 0 14>; #gpio-cells =3D <2>; interrupt-controller; #interrupt-cells =3D <2>; --=20 2.55.0 From nobody Wed Oct 28 02:14:12 2026 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: quoted-printable 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/arm6= 4/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. */ =20 #include #include #include #include #include +#include #include "sdm670.dtsi" #include "pm660.dtsi" #include "pm660l.dtsi" =20 /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 =3D <0>; }; }; =20 &pm660_rradc { status =3D "okay"; }; =20 +&pm660_typec { + vdd-pdphy-supply =3D <&vreg_l7b_3p125>; + + status =3D "okay"; + + connector { + compatible =3D "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 =3D "sink"; + data-role =3D "dual"; + self-powered; + + sink-pdos =3D ; + op-sink-microwatt =3D <15000000>; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + port@0 { + reg =3D <0>; + pm660_hs_in: endpoint { + remote-endpoint =3D <&usb_1_dwc3_hs>; + }; + }; + }; + }; +}; + &pm660l_flash { status =3D "okay"; =20 led-0 { function =3D LED_FUNCTION_FLASH; color =3D ; led-sources =3D <1>, <2>; led-max-microamp =3D <500000>; @@ -702,16 +743,22 @@ &usb_1_hsphy { }; =20 &usb_1 { qcom,select-utmi-as-pipe-clk; status =3D "okay"; }; =20 &usb_1_dwc3 { - /* Only peripheral works for now */ - dr_mode =3D "peripheral"; + dr_mode =3D "otg"; + usb-role-switch; =20 /* Do not assume that sdm670.dtsi will never support USB 3.0 */ phys =3D <&usb_1_hsphy>; phy-names =3D "usb2-phy"; maximum-speed =3D "high-speed"; + + port { + usb_1_dwc3_hs: endpoint { + remote-endpoint =3D <&pm660_hs_in>; + }; + }; }; --=20 2.55.0 From nobody Wed Oct 28 02:14:12 2026 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 38E23440A2F; 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=EqdQGHq24SVU2nB8DE1O23GnH5FLyBtyS9tFbAfOAJg6hnpgTSmESficAuZ8FElLPxdt2nvAM73QkTJCX06fv5ycPzLa4wTuXXZiqdWV6I4isBx1Yw6QhpVQ5lP0w1ESqTzkx42I6zK6nm6/Ys+OWtxBvzVNTtGI8loMe9QpiCU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790426434; c=relaxed/simple; bh=0nD/Q/yX8fnh78tBYlMsAu62vHdt7jMPZ12GjmO2VCA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ipP7GSVKDrWDrKfJyGCHFJ1UqyKCwUHmPitwfDD8eLzvStp0Fomqz0/x8fxPqiLeayXUMmXm7YM5ZTHVIGqtmTK629XORq6y3jpKGAG8cAUmud5nS0slQCE6f0hp/YArLBM4aknbhTi6qO1d4NhghUcVNazorgYZJ1j8TN9WKug= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lRGFV9CS; 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="lRGFV9CS" Received: by smtp.kernel.org (Postfix) with ESMTPS id 08036C2BCB8; Sat, 26 Sep 2026 12:40:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1790426434; bh=0nD/Q/yX8fnh78tBYlMsAu62vHdt7jMPZ12GjmO2VCA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=lRGFV9CSwn45ZWJpsvXgRGraFDKFoH8mojUP+IDRTrEqC+R0Siygo4nqAkKQrB6Eg Fb9QVy3wtxtVwUj59exR1chOe984tr2s0pR0RPpzEKns0QSwW42OhTmq02b5b+MPaF cN2N75MXW5Oir2CE035rO3JbZYgv6RzFpyJEaQ2B5JEtYcUzJE/QT7XWCE6exhj0Ch JO0Epef0Oebd19qrnDL+hvMMkOPobnpmjOlbkk/tTCV8cpTwi84ICV+aQvU+CJFiGd 1nGy1bH47RLnVho0t5Q+vzGOPCVDgKWIojMohRhP0LyL0jr527xrpVKF6Cauj+gpwG iLb6eCp5GbD6g== 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 E99C2C98338; Sat, 26 Sep 2026 12:40:33 +0000 (UTC) From: David Heidelberg via B4 Relay Date: Sat, 26 Sep 2026 14:40:29 +0200 Subject: [PATCH RFC 10/12] arm64: dts: qcom: sdm845-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: quoted-printable Message-Id: <20260926-typec-v1-10-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=4327; i=david@ixit.cz; h=from:subject:message-id; bh=r5IQw5ef3NgqdpkqzvYRqDdpmBPKAHmtONrEfZAVnQU=; b=owEBbQKS/ZANAwAIAWACP8TTSSByAcsmYgBqt70+aIeCNkK1YRBq0hkMzBSfTWJFNLHe+EZpq iLkAL06sCWJAjMEAAEIAB0WIQTXegnP7twrvVOnBHRgAj/E00kgcgUCare9PgAKCRBgAj/E00kg crwKEACh2VG72WBEQaWlm3ElTE/xURhQ7dFGJfr9JYN8dzdcagAcTPi6+ZdQ6RdLT6pIT8r6f2Y th1vxhNgAt0s66X4HUgPV2vI8/3gYoLLklygGI+yxZXgkvIgfkgYh7PSZ3M7jewWpOnafvEx9dz UIoKcHJxfP06RykWB5BT0DJxmVULNpW4RRNBs/S9oOzDVYcLz9j2dy1qyya+Nqspw+Q6VAfKnyE iytMEIZIMOLj0Gncl6twyZsxuRKTvDu8SfS4udsCuIy+scSO7taWVPShxTTWFHFbK1d0puhBUbK rUSpYEvBtnFmjCU4+qv0gxhlDQdGJzhg8WN3XV8O1Hev9vdDb9OEJl4yLcoMjMGuR228b25DEIV 8XZgxypymklkRWcv/Df3n8c7GIdsJnguRkfj9m84EA62tTx0iaSvD9z6o4266mC3Bsrg0+QDCJN 23S6R8cAFj2jTrGmS5OhZ/4yVxv9JofnwKEv3rUfZwU1Z0JgX4vf2V1uCkfFF0yCruvprtWp/40 sdnOpcH65fi2QeZFhJbby4FGa1FS/FaOmDjTeg4x1xBIZNW2XhGFFINviYVaG2eXy9mYXU7l3G9 6Qyxa9Y8ZH1IHhp2pSow3x4GRdogSRuqS3L34IufbQN+xgpmgq1lKh4BqozYEtsFzVUelsC67wQ YfC2Q5zXt1UtcFw== 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 PMI8998 Type-C port controller with a USB-C connector description for the Google Pixel 3 (blueline) and Pixel 3 XL (crosshatch), 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 - Operating sink power 7.6W (matching downstream configuration) - 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. DisplayPort Alt Mode is not advertised as Google disabled DP output in the Pixel 3 hardware design (downstream explicitly sets sde_dp to disabled and excludes it from the MDSS connector list). Wire the USB-C connector port graph: - port@0: DWC3 HS endpoint for USB role switching - port@1: QMP combo PHY for USB SS orientation switching 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/sdm845-google-common.dtsi | 59 ++++++++++++++++++= +++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi b/arch/arm6= 4/boot/dts/qcom/sdm845-google-common.dtsi index 9e952f9862f24..99f40a13b5d7f 100644 --- a/arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi @@ -2,16 +2,17 @@ =20 /dts-v1/; =20 #include #include #include #include #include +#include =20 #include "sdm845.dtsi" #include "pm8998.dtsi" #include "pmi8998.dtsi" =20 /delete-node/ &mpss_region; /delete-node/ &venus_mem; /delete-node/ &cdsp_mem; @@ -449,16 +450,63 @@ &pm8998_resin { }; =20 &pmi8998_charger { monitored-battery =3D <&battery>; =20 status =3D "okay"; }; =20 +&pmi8998_typec { + status =3D "okay"; + + vdd-pdphy-supply =3D <&vreg_l24a_3p075>; + + connector { + compatible =3D "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. + * + * Higher voltage sink PDOs will be added once the charger + * driver programs the allowed USBIN adapter voltage. + */ + power-role =3D "sink"; + data-role =3D "dual"; + self-powered; + + sink-pdos =3D ; + op-sink-microwatt =3D <7600000>; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + port@0 { + reg =3D <0>; + pmi8998_hs_in: endpoint { + remote-endpoint =3D <&usb_1_dwc3_hs>; + }; + }; + + port@1 { + reg =3D <1>; + pmi8998_typec_mux_in: endpoint { + remote-endpoint =3D <&usb_1_qmpphy_out>; + }; + }; + }; + }; +}; + &qupv3_id_0 { status =3D "okay"; }; =20 &qupv3_id_1 { status =3D "okay"; }; =20 @@ -549,17 +597,22 @@ &ufs_mem_phy { status =3D "okay"; }; =20 &usb_1 { status =3D "okay"; }; =20 &usb_1_dwc3 { - dr_mode =3D "peripheral"; + dr_mode =3D "otg"; + usb-role-switch; +}; + +&usb_1_dwc3_hs { + remote-endpoint =3D <&pmi8998_hs_in>; }; =20 &usb_1_hsphy { vdd-supply =3D <&vreg_l1a_0p875>; vdda-pll-supply =3D <&vreg_l12a_1p8>; vdda-phy-dpdm-supply =3D <&vreg_l24a_3p075>; =20 qcom,imp-res-offset-value =3D <8>; @@ -572,16 +625,20 @@ &usb_1_hsphy { =20 &usb_1_qmpphy { vdda-phy-supply =3D <&vreg_l1a_0p875>; vdda-pll-supply =3D <&vreg_l26a_1p2>; =20 status =3D "okay"; }; =20 +&usb_1_qmpphy_out { + remote-endpoint =3D <&pmi8998_typec_mux_in>; +}; + &venus { firmware-name =3D "qcom/sdm845/Google/blueline/venus.mbn"; =20 status =3D "okay"; }; =20 &wifi { vdd-0.8-cx-mx-supply =3D <&vreg_l5a_0p8>; --=20 2.55.0 From nobody Wed Oct 28 02:14:12 2026 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 439164418F2; 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=a0v2+UJNIVjypzlogu915Hb+0gSvdwUmDmk4s0KxZbvoAe0BVabto4/ThkYojYYRE4bpeg2+pFO5agomghT37+h4SZJJq9zS1vvgemDLq0FON4IHZj1RBpIKF5kGTK6p0n/7e3T1RYsa+jTVPipAiFVKDVV0ZSQFOAwQt6RO5QU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790426434; c=relaxed/simple; bh=E+ieb3LE7ncIT4E7El1E9wjac2xsmMqHnPd46QppuKg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Knb4rS8QOl03nt1lzBtElyV9dWiBCyyDTxkx0HuRLr9bZX1S/h3rYrY8fzzbVu5qZNVplBicTC92oR6vOlppmoKtv7h1sAHJofJDqbf4VZ1jk3TKWJ22Oy9ge7/sZxdAkUnvyeBWRSI/4doteOuorEFtLuFr4Mr7dA6b1Baaaeo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mXCxysvO; 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="mXCxysvO" Received: by smtp.kernel.org (Postfix) with ESMTPS id 16350C2BD00; Sat, 26 Sep 2026 12:40:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1790426434; bh=E+ieb3LE7ncIT4E7El1E9wjac2xsmMqHnPd46QppuKg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=mXCxysvOrJHyXvJKoj6pa6FPiXH1WzUDznoAa1Um+B9r6hzJR7zfo6+C1SYlQqt/p aGbM6Nttiq4V0S1AONTlUNmzZ0wtF/I1KBKArgOMG7mkQU/NUn3tSQ5BsxuxXmspeF ywYIqeWB5q2PrX76raArmmDyY8xzdME7j2Fp/T/MKb20sPT4xkAcf+qQoFnA9bHOcy wSnkAN52H5v7gkf5QlHeSah+eAPRCE7mCW648KL80dVQLg0gpQFJicp4Z3pMZKgGIT gVHAVMW5O0PDkfMJMzBKMFrwgRDFhA2RFI7s2vFPXG+f8xPbIsQoCeeNZbLtH6Ykvm Id8SjYmZCnFNQ== 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 06256C98332; Sat, 26 Sep 2026 12:40:34 +0000 (UTC) From: David Heidelberg via B4 Relay Date: Sat, 26 Sep 2026 14:40:30 +0200 Subject: [PATCH RFC 11/12] arm64: dts: qcom: sdm845-oneplus-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: quoted-printable Message-Id: <20260926-typec-v1-11-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=3902; i=david@ixit.cz; h=from:subject:message-id; bh=Q1RD32QhsfxNI1Wlv483ruSgZWvd115eJ5gP4RSA0iE=; b=owEBbQKS/ZANAwAIAWACP8TTSSByAcsmYgBqt70+v6f/M2Qj8ltENV4iwMzqcasimqGnn5e5E 5zxolskc52JAjMEAAEIAB0WIQTXegnP7twrvVOnBHRgAj/E00kgcgUCare9PgAKCRBgAj/E00kg cqxVD/4l1wTZ2Lq7JJMm2k/arBVdhyPUOYk+tBbFIslfgAxpAGHI5urwUgDiEt+7/DSSEPwFBAT 6Q4FEC49JxWcuBrN8+q7g6EIZ6B0jkbQ4hGVBx7ahkx37ljvkOe2vHIR1kR4F2DQThQtxsxlKBz Nx5WYVwVt94W1h3iSSQjojfgJ95QAxdjBT6vbQGqacvMBoy8dOpizcG4Hmavd6XXoxgeVBgADSE eKzp5mMSX6NrAC5IzHgTTBXv8Qxrjt3nPkrWTZ6kCn2DLSSJvMJhOxhRkCy0BJJWOzLi7cN4F3Y H6J12Fz4MPq0jg73yDu3wDBRD4M+Z3QCONw6IVhcI7BceJsdC/hYx5FRuqFkuOCQ+rgTPBz1gqA hu/QKAGblOCcJqP0Qz+AkKF6Lppn+T9EHeptVKxizbKeapEeBCD7A26iHLsv23ntOFPsncEN/GD zM8cKlgTjrc4K9DNy5cQcGV/P3xkYZah+Ha1WgXkyinA8IH+pscnLiqvwHtuRymg4inRTBVwaIn yoomcq0Bv6t1rMA10EsUog0MsL6V/ny4dCr00/HR1qU7F8nwBtzecbKWNzgAXNSV9Pfc8rp9ThT ZXMFaYxVYU4xRPkdeeObdzR9vFiO0arzgDuPvf0F+nlEQu0tLFNka2PeYqDqnEf4c2HlE5CjeYm b2mqkWg78EZGSUw== 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 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 =E2=80=94 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 --- .../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/arm= 64/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 @@ */ =20 /dts-v1/; =20 #include #include #include #include +#include #include #include =20 #include "sdm845.dtsi" #include "sdm845-wcd9340.dtsi" #include "pm8998.dtsi" #include "pmi8998.dtsi" =20 @@ -639,16 +640,53 @@ pinconf { }; }; }; =20 &pmi8998_charger { status =3D "okay"; }; =20 +&pmi8998_typec { + status =3D "okay"; + + vdd-pdphy-supply =3D <&vreg_l24a_3p075>; + + connector { + compatible =3D "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 =3D "sink"; + data-role =3D "dual"; + self-powered; + + sink-pdos =3D ; + op-sink-microwatt =3D <15000000>; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + port@0 { + reg =3D <0>; + pmi8998_hs_in: endpoint { + remote-endpoint =3D <&usb_1_dwc3_hs>; + }; + }; + }; + }; +}; + &pmi8998_flash { status =3D "okay"; =20 led-0 { function =3D LED_FUNCTION_FLASH; color =3D ; led-sources =3D <1>; led-max-microamp =3D <500000>; @@ -929,28 +967,34 @@ &usb_1 { * disable USB3 clock requirement as the device only supports * USB2. */ qcom,select-utmi-as-pipe-clk; }; =20 &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 =3D "peripheral"; + dr_mode =3D "otg"; + usb-role-switch; =20 /* fastest mode for USB 2 */ maximum-speed =3D "high-speed"; =20 /* Remove USB3 phy as it's unused on this device. */ phys =3D <&usb_1_hsphy>; phy-names =3D "usb2-phy"; }; =20 +&usb_1_dwc3_hs { + remote-endpoint =3D <&pmi8998_hs_in>; +}; + &usb_1_hsphy { status =3D "okay"; =20 vdd-supply =3D <&vdda_usb1_ss_core>; vdda-pll-supply =3D <&vdda_qusb_hs0_1p8>; vdda-phy-dpdm-supply =3D <&vdda_qusb_hs0_3p1>; =20 qcom,imp-res-offset-value =3D <8>; --=20 2.55.0 From nobody Wed Oct 28 02:14:12 2026 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 4974244237A; 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=Zxsqd4ujDU20/TTJA0c7mj7VdE6UI5vGV0HX3/t1osr482/yxLIoYunrDZw+o/7TSEK+BXujegFN7vJf8oWTALWU/eBvsAuxUf8QkW1SNrhVET0J8ls1Tz+87sxc1UeCBij8DuZSNB0aAKTuCKnydDY87Ne+ABUVkrYsY7MmGfM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790426434; c=relaxed/simple; bh=tcPHSgwlBjZs9/CWT2bgvix/rz4IKMDvnGfKwY69OS4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TJJcZKeA/hLTHt9pH3My4mJcFQXBNu05zRrZb7bup/k6fAqL9OXcZ5AW4XEjgbUeCFbO1H7Z8GH0cV4ELdrx4wg5ylrjt+l9p9mhn3AzY5HvgNdYCVj4xzDmfDhSuc/P7DJ/AdkxmXhWSTl7SD+hfDdj+aNyCMr2n/zTOQGiBds= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=l+d0jgpU; 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="l+d0jgpU" Received: by smtp.kernel.org (Postfix) with ESMTPS id 2981AC2BD01; Sat, 26 Sep 2026 12:40:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1790426434; bh=tcPHSgwlBjZs9/CWT2bgvix/rz4IKMDvnGfKwY69OS4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=l+d0jgpUW5BXyMTcWX+yfweRqctAb8fwG6KFWg2sNrDq5qkz0B+jZ6qHvkzttMU5/ SWl8XMN2DhSNhEKp3zmZ9UnTtm11kDAZyNZ/BK6jge92BdV5E4D9QG9co6mQow8GCq Z6hgUVHSwgDAFXKhvbXLKXhqr5zcYN/ri3oTMCbsL29f3dqQ36PI33EaIfheCnCeUn dmvaEDPyAkTJymJTOfWvCSHCz8/wfD23IDg1sqS9dUkFEnTXOSdyL8VM51SNKbN0DP e8vuFJTXFv5HHAH5NJ8yGoenwLRSknvf96/1ADZ2sP545Zii4bBwVEzMBg3mezyJ30 UxqR6+8r7OgXA== 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 17526C98328; Sat, 26 Sep 2026 12:40:34 +0000 (UTC) From: David Heidelberg via B4 Relay Date: Sat, 26 Sep 2026 14:40:31 +0200 Subject: [PATCH RFC 12/12] arm64: dts: qcom: sdm845-shift-axolotl: 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: quoted-printable Message-Id: <20260926-typec-v1-12-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=4218; i=david@ixit.cz; h=from:subject:message-id; bh=x32COcG8Butqrlw/fff8Lfo8b61ySUHbjR8/5yIgBUw=; b=owEBbQKS/ZANAwAIAWACP8TTSSByAcsmYgBqt70+D9ld9Gu1iU4YWKZL3BfGDTzOC2I5j0XtG MZVW8YLmNSJAjMEAAEIAB0WIQTXegnP7twrvVOnBHRgAj/E00kgcgUCare9PgAKCRBgAj/E00kg ctTpEACDKiK7HntwbRh9oZMsTQl2VLJx030TyTKvQKkMLV8xfAZzVCr5NtbggSwgcW0cuAvvmOf a/eC3re114t2mQqz5sFmPuwQMndQPdUwdyB83yUpq/FG8jOD6b6H/qSFdeI3AmmAi2I5LPlbnXD q3sYf74UJo0aHBXbWzgluM5ucCqIOqFILfIVKCRF0spodPSY5IJO4GgJ3WTb4wDJWfjCdHWXRnd veQXKjLYzes/VLbdZbAPCx+SDuBG52lLqgFJjvu1aTLNK+24x29Xv9fnqFIjTyy+lMS1TB1fhVO hE+rbWoQQ3mkFIgo1XjLO0x3hKmV5GdNKbQeSSPJ/xXUZUcAdTmrXUnslz/Cq692xxWAW47QW3M OxKKwsda304QmybzA0WNQWQ2D4B28rcbirGgirSEzqkL1H3izI8hEzz1X6IN+D8FDxeqACkHg49 66PoG3U5OwiONfiXCGgqq09ZYEqxTPxTISJmArCt9Ic8XvTBceLpuWADxTooDzcqh03j/tHDNW5 xaGN43A/RRotu2VPLYwRtTM0Yq4xqx5WT2RbEo8o7QqtvG29uVbaWS8XPVnFFk5ZJVft4YefF3H X3xrniO/S5/tjmegs/I3vFYYM59GcJcalPPBN1kFmO7nI3pQ9Q3EywU8Qcbm1d63FhhHVzdiETq K5u4gTq0aPACfNg== 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 PMI8998 Type-C port controller with a USB-C connector description for the SHIFT6mq: - 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. Wire the USB-C connector port graph: - port@0: DWC3 HS endpoint for USB role switching - port@1: QMP combo PHY for SS lane orientation 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. DisplayPort Alt Mode is not advertised yet, it will be added together with enabling the DP controller (mdss_dp). Assisted-by: LLM Signed-off-by: David Heidelberg --- arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts | 62 +++++++++++++++++++= +++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts b/arch/arm64= /boot/dts/qcom/sdm845-shift-axolotl.dts index 1b0eaeafbd517..2ddbe732961a2 100644 --- a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts +++ b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts @@ -6,16 +6,17 @@ */ =20 /dts-v1/; =20 #include #include #include #include +#include #include "sdm845.dtsi" #include "pm8998.dtsi" #include "pmi8998.dtsi" =20 / { model =3D "SHIFT SHIFT6mq"; compatible =3D "shift,axolotl", "qcom,sdm845"; chassis-type =3D "handset"; @@ -654,16 +655,66 @@ led-1 { color =3D ; led-sources =3D <2>; led-max-microamp =3D <100000>; flash-max-microamp =3D <1100000>; flash-max-timeout-us =3D <1280000>; }; }; =20 +&pmi8998_typec { + status =3D "okay"; + + vdd-pdphy-supply =3D <&vreg_l24a_3p075>; + + connector { + compatible =3D "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. + * + * Higher voltage sink PDOs will be added once the charger + * driver programs the allowed USBIN adapter voltage. + * + * DisplayPort Alt Mode will be added together with enabling + * the DP controller (mdss_dp). + */ + power-role =3D "sink"; + data-role =3D "dual"; + self-powered; + + sink-pdos =3D ; + op-sink-microwatt =3D <15000000>; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + port@0 { + reg =3D <0>; + pmi8998_hs_in: endpoint { + remote-endpoint =3D <&usb_1_dwc3_hs>; + }; + }; + + port@1 { + reg =3D <1>; + pmi8998_typec_mux_in: endpoint { + remote-endpoint =3D <&usb_1_qmpphy_out>; + }; + }; + }; + }; +}; + &qup_uart9_rx { drive-strength =3D <2>; bias-pull-up; }; =20 &qup_uart9_tx { drive-strength =3D <2>; bias-disable; @@ -855,17 +906,22 @@ &ufs_mem_phy { vdda-pll-supply =3D <&vdda_ufs1_1p2>; }; =20 &usb_1 { status =3D "okay"; }; =20 &usb_1_dwc3 { - dr_mode =3D "peripheral"; + dr_mode =3D "otg"; + usb-role-switch; +}; + +&usb_1_dwc3_hs { + remote-endpoint =3D <&pmi8998_hs_in>; }; =20 &usb_1_hsphy { status =3D "okay"; =20 vdd-supply =3D <&vreg_l1a_0p875>; vdda-phy-dpdm-supply =3D <&vreg_l24a_3p075>; vdda-pll-supply =3D <&vreg_l12a_1p8>; @@ -873,16 +929,20 @@ &usb_1_hsphy { =20 &usb_1_qmpphy { status =3D "okay"; =20 vdda-phy-supply =3D <&vreg_l1a_0p875>; vdda-pll-supply =3D <&vreg_l26a_1p2>; }; =20 +&usb_1_qmpphy_out { + remote-endpoint =3D <&pmi8998_typec_mux_in>; +}; + &venus { firmware-name =3D "qcom/sdm845/SHIFT/axolotl/venus.mbn"; =20 status =3D "okay"; }; =20 &wifi { vdd-0.8-cx-mx-supply =3D <&vreg_l5a_0p8>; --=20 2.55.0