From patchwork Tue Dec 19 12:22:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13498211 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EC849C41535 for ; Tue, 19 Dec 2023 12:23:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eS6MYRzjAOwzOSDjICNKawk2CXjKPxEGmjn3dhQ0h+s=; b=wOYMInWdtxv3Ql tu1l5Egefu4cqHCyEPf7orv/0VO43dG12XYuCak/BWlbhcPU1BRu1Ngf5wQHtYL9adqllXtUcBnT+ 0m8lF5iCls0YOHEYAfyQR9oI/PucDHvZfAkJxJdjb2ER3ozXmYpY/iulbkpmdWDFCEyKKeBqfPWZG nmCp5979N4QRYXsJXj6HGph5LxpddUXwiTSm0HkcLCLIQ8v8waMBapR0QmPH3x/hlNmmrpETgJTcw PauoFsdx1sQwMdyLjQXdjUDg8Y444TcTu2meU6AKPPBYt20rcoH3teF4LQ9tcnia7mxnbDHsK/c+w YfVVu8BH4AqI8uis7cCg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFZ7L-00E06K-0i; Tue, 19 Dec 2023 12:22:35 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFZ7G-00E03n-2d for linux-arm-kernel@lists.infradead.org; Tue, 19 Dec 2023 12:22:32 +0000 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1d3b547cd4cso10741185ad.1 for ; Tue, 19 Dec 2023 04:22:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702988548; x=1703593348; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=SylnFOf7Bavuihep6FrRUZ3K4tT0YwbWb0OaRxJ1UcE=; b=hBR00x2HJ4nHExtqKzUcHt9FNUTafKhWM4f5BGaI/cDr+WLOXMKlnLiIqmBL2NYfPN o/CLVV0cNDLFjKDTSbMSj49SYh/jOYcnEwIEsrgRAAOoorHcxw8095qY/D9JsTqAAHFM +eIysW8UVwe2jqbkGXI7wmv7udCKDQyJvIUWKpqJpug3xzF0ZSvJN3mMjTIUJJvlUuH9 FNuzTZrZX9Nng6t+tvkOgTNLSAHRHu+3DYNe4qZEyHEgkCdSuaHV/3Wx4cN1+LuICoZ5 mnsITB7di9wrkCsVIh8GjzLoAW9/no04P0HQ0WYYkDI7wpWwlCbqxLjux/3WG8k2T2MY wSIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702988548; x=1703593348; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SylnFOf7Bavuihep6FrRUZ3K4tT0YwbWb0OaRxJ1UcE=; b=izx1OK2V4ywi32XTQPMSPchrH0EfQyLgKvkE0vw8VIz+P9bUYHEzDbEWf/wbVtLQJ6 OWUW6AQyIHO8Z4TyC38lxulVUK52LOvRcBxwupjKdTMSSGft6296ZgoSj9D64rC+YXjA AVxHBZis6ZgMCJK7+u60gnTfbCdeBc6dDuyubgsEfGBl3mPIgHgOB+T+ZgNTlE6lcMcF AKjGIt2c20wwvyeUdV1WqzQEz4Z/I5ejRNiJCcmPOvmOcpEfEnCirmb4szT7mF36hl44 uiM5u3ocaZdAEvYKr93en0ODMu2Zp3n7J6dO+TAIzYZb+Zn0sB6Jx/uiXWEbvWKfBXXV D6Gg== X-Gm-Message-State: AOJu0YwPZE2Z7SEhzj2pM3a9c9zXlVwMGtsQxAbbt3MZCjsdnJxd3Z6z FzrjoOZNWajR7PQxfASAT+iAX1FmYbdCjTBDVl/KQDa9 X-Google-Smtp-Source: AGHT+IF3YwY+ezYIdFCUb8c2AR6pdEHQ+CZY+DLZB69/phDLq+R0/wdtzbThnFW9MA2NAguY9o48zA== X-Received: by 2002:a17:902:a9c4:b0:1cf:e19e:2505 with SMTP id b4-20020a170902a9c400b001cfe19e2505mr9205246plr.61.1702988547911; Tue, 19 Dec 2023 04:22:27 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id s17-20020a170902b19100b001d366f8cfd7sm7719419plr.182.2023.12.19.04.22.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 04:22:27 -0800 (PST) From: Neil Armstrong Date: Tue, 19 Dec 2023 13:22:12 +0100 Subject: [PATCH v2 1/2] arm64: dts: qcom: sm8650-qrd: add USB-C Altmode Support MIME-Version: 1.0 Message-Id: <20231219-topic-sm8650-upstream-altmode-v2-1-a608528864a3@linaro.org> References: <20231219-topic-sm8650-upstream-altmode-v2-0-a608528864a3@linaro.org> In-Reply-To: <20231219-topic-sm8650-upstream-altmode-v2-0-a608528864a3@linaro.org> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Catalin Marinas , Will Deacon Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Neil Armstrong X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=3408; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=x9/qfzNBO7hwOHU0S23SWtGDd1O9B7NOV8hG078Fkrc=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBlgYr3veMctBzDuwIai9WiZBgq+U+B78nC55Gpp4g+ VYUmCP2JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZYGK9wAKCRB33NvayMhJ0SKcD/ 40M3AmHf99BCo6DCxYGx4Rixo0deveAa2KnzYFmx3VIbc+tEx3TkZ03TCzqeJEgDFMWMZLny5f0KOF ULPaOk1Y0iRmokc4kNvVxkLMG3DUXASvi+nuz/pFRwioZ6R6em51K5XCuIqbOJgB7y6t0m5/jAHAe/ J45Uhs0G/1yIJTuykBega8JD/WqOKGLkLksS0VHgcWeN7vwm+bKzBbc8dhgzE4QIv3dY8s0y644GIJ YiM9yIRD4XnlHNpLY4E6YPqO9fhOjHIHazr9WRu7hHnIUo7LYaT8MMdIn0mDle3jzo9McBDAl4Rwwm xd3r5OOsVp1UCZojMqee+9VBNBU82cr4t/gNcnO4ZQ/zfDBDqJGQa55Kh8a20dgmZbgs6sVz5QRKHv C3WviYJp0UmRN/CrfADru9TAqcT/6oi+EqNEkcR//p6imu5cmFJ9lfAcVg2cIgg+DvKCMQflZ6Oc9R bP0KJiru1RuTM0pwIEiGq8SjB1LE/3A892S++8t65IWp8sl+tD1O8DDo9Szr+8XAtGecBfwkHl0OHq N+eWLnSvEioZyV93SB806ZSaGNzf7KbYKMolFcUR4pPcmjnqoQGu/E1jOzpm1XimOHOWc51ClOuywT 6QBkq3s3cDqsOW04CCDM4n6B1PO/TD3DLCPemyQ2s3cj0Ssz7wlYAfbO493A== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_042230_857984_CD2F94E6 X-CRM114-Status: GOOD ( 12.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add the necessary nodes to support the USB-C Altmode path by adding the following - WCD939x USBSS Mux I2C device - nb7vpq904m Redriver I2C device - Port/Endpoint graph links bettween PMIC-Glink, Mux, Redriver and USB PHY nodes. WCD939x USBSS port 2 Path to Codec will be added later when Audio support is added. Signed-off-by: Neil Armstrong --- arch/arm64/boot/dts/qcom/sm8650-qrd.dts | 104 +++++++++++++++++++++++++++++++- 1 file changed, 102 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sm8650-qrd.dts b/arch/arm64/boot/dts/qcom/sm8650-qrd.dts index 592a67a47c78..a6f55191e107 100644 --- a/arch/arm64/boot/dts/qcom/sm8650-qrd.dts +++ b/arch/arm64/boot/dts/qcom/sm8650-qrd.dts @@ -77,9 +77,17 @@ port@1 { reg = <1>; pmic_glink_ss_in: endpoint { - remote-endpoint = <&usb_1_dwc3_ss>; + remote-endpoint = <&redriver_ss_out>; }; }; + + port@2 { + reg = <2>; + + pmic_glink_sbu: endpoint { + remote-endpoint = <&wcd_usbss_sbu_mux>; + }; + }; }; }; }; @@ -446,6 +454,70 @@ &gpi_dma1 { status = "okay"; }; +&i2c3 { + status = "okay"; + + wcd_usbss: typec-mux@e { + compatible = "qcom,wcd9395-usbss", "qcom,wcd9390-usbss"; + reg = <0xe>; + + vdd-supply = <&vreg_l15b_1p8>; + reset-gpios = <&tlmm 152 GPIO_ACTIVE_HIGH>; + + mode-switch; + orientation-switch; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + wcd_usbss_sbu_mux: endpoint { + remote-endpoint = <&pmic_glink_sbu>; + }; + }; + }; + }; +}; + +&i2c6 { + status = "okay"; + + typec-mux@1c { + compatible = "onnn,nb7vpq904m"; + reg = <0x1c>; + + vcc-supply = <&vreg_l15b_1p8>; + + retimer-switch; + orientation-switch; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + redriver_ss_out: endpoint { + remote-endpoint = <&pmic_glink_ss_in>; + }; + }; + + port@1 { + reg = <1>; + + redriver_ss_in: endpoint { + data-lanes = <3 2 1 0>; + remote-endpoint = <&usb_dp_qmpphy_out>; + }; + }; + }; + }; +}; + &ipa { qcom,gsi-loader = "self"; memory-region = <&ipa_fw_mem>; @@ -495,6 +567,15 @@ &mdss_dsi0_phy { status = "okay"; }; +&mdss_dp0 { + status = "okay"; +}; + +&mdss_dp0_out { + data-lanes = <0 1>; + remote-endpoint = <&usb_dp_qmpphy_dp_in>; +}; + &mdss_mdp { status = "okay"; }; @@ -600,6 +681,11 @@ &pmk8550_rtc { status = "okay"; }; +&qup_i2c3_data_clk { + /* Use internal I2C pull-up */ + bias-pull-up = <2200>; +}; + &qupv3_id_0 { status = "okay"; }; @@ -787,7 +873,7 @@ &usb_1_dwc3_hs { }; &usb_1_dwc3_ss { - remote-endpoint = <&pmic_glink_ss_in>; + remote-endpoint = <&usb_dp_qmpphy_usb_ss_in>; }; &usb_1_hsphy { @@ -803,9 +889,23 @@ &usb_dp_qmpphy { vdda-phy-supply = <&vreg_l3i_1p2>; vdda-pll-supply = <&vreg_l3g_0p91>; + orientation-switch; + status = "okay"; }; +&usb_dp_qmpphy_dp_in { + remote-endpoint = <&mdss_dp0_out>; +}; + +&usb_dp_qmpphy_out { + remote-endpoint = <&redriver_ss_in>; +}; + +&usb_dp_qmpphy_usb_ss_in { + remote-endpoint = <&usb_1_dwc3_ss>; +}; + &xo_board { clock-frequency = <76800000>; };