From patchwork Mon Dec 18 10:26:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13496527 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 15DBBC35274 for ; Mon, 18 Dec 2023 10:27:01 +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=c2AV+OO0Z+FEtNHyaYW9k+SQEFXb8RWIKB0dRYsO2KE=; b=JlpDur0VtiQYsT lfEOM0o+UIr3KYojVzRcdJLGIB4XkmrwVgC5RejyTlQBea82Gt5tTg+jx5DCiTQaJoT37BCKwfVh0 uKrxwt+lwgFViNTR4FZw1jtdro6NYho3tY57yKyDrntJgHB+HK8V20TxmpNTnFUHhxedDWWWAsl7V TYZPw6lnlhiqNWVjgrKdNitpndLt3OGBXhntMDcvXzUYAI33HNbgcZ5pR6jou7oaFY11ng52kcqYK deibtsd1fUzKppm9EaVYnfQ0lrrLhnTJlDB1WTbyAw15kPw2qYmGKBQb0pxNcReGOHcr4mtcE2qOl ivRzZZSMDINurRCd8oJg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFApW-009p4C-0j; Mon, 18 Dec 2023 10:26:34 +0000 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFApS-009p23-2i for linux-arm-kernel@lists.infradead.org; Mon, 18 Dec 2023 10:26:32 +0000 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3363aa2bbfbso2717157f8f.0 for ; Mon, 18 Dec 2023 02:26:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702895188; x=1703499988; 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=0JpYFAZaGSOCR2iZrKzQUAvOF9SV0JKgD6OLjGIZmUg=; b=QA8s1dB0Kz7uZNpKDR1P+/fQEm6Giyimk0ZEOPSBwOOxgO7vl9B3FTl06Fuysflt3A dMBm8KMwTsVW9+L2AAYk7GYnFmpvByxnHB2SjlHmIfBbu+rOY+e8Fqhed5r4td+DmZNo GtNNCUxrhVQzeR67zpZ7yZQQg8rv4JpTuGun0IvFDikkfGAcBLmkexA73IPEhTSZeK8t bnpNhKKV3DXIFpulVP3Yulibq+6xSLWgdBx9vUgYH1HEWDBYpxBh1edSDWerm0E5CIpZ poav6hCheLgC62cl+xHiE6+kMX0mXj5UZn803yoLY1JN6Qrva+0HPGpRFE0cAr85V2FB NlgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702895188; x=1703499988; 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=0JpYFAZaGSOCR2iZrKzQUAvOF9SV0JKgD6OLjGIZmUg=; b=aGtNMkzhUwRzn2iK9fcP8pRApMQH2LeWnlsym0eDtdsbg98WkyyIlA6/zeDfwNVgr9 0rLVZuqRcsUyfVmfsB+UACBVHxgnv20nVJvfYw9okLmd3YQ6fRfJH+m6xeqs/EtP3PzR eMrjCRQr6kWU6AylOjdvNAmpflITWZy38NvhlTrB8H2zhpYq+RtpCSU58i02ewJ15Skb OTBWlZltorLmhmLj4v4Vnlg0xNVvdC2P2r+MaCHQKek0qvwg1E71aMpT7IXmdzaI0Fhy c22TZ+ycfKaFmHZ5slwYGYAM5WaGoJHppqBov2PitrD9mzgxJONashM11uLuxNPTVfKS k+/Q== X-Gm-Message-State: AOJu0Yxy/gvGRTftqGuWd1W2iH+fFqjbe1uyjMaiySvLhpS/095LMS3C dOZd6gyaNEv+YOlN8abdIjO1aw== X-Google-Smtp-Source: AGHT+IGxxaBKTgAX4il7WwlGMHxTiaoQVgnts1FpPJMa0rCTgjfqkrV/7FuY30AFyCnZqDnMtAoPlA== X-Received: by 2002:adf:d1ce:0:b0:336:3dcd:186b with SMTP id b14-20020adfd1ce000000b003363dcd186bmr5561702wrd.63.1702895188323; Mon, 18 Dec 2023 02:26:28 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id o9-20020a5d62c9000000b003364aa5cc13sm11365333wrv.1.2023.12.18.02.26.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 02:26:27 -0800 (PST) From: Neil Armstrong Date: Mon, 18 Dec 2023 11:26:24 +0100 Subject: [PATCH 1/2] arm64: dts: qcom: sm8650-qrd: add USB-C Altmode Support MIME-Version: 1.0 Message-Id: <20231218-topic-sm8650-upstream-altmode-v1-1-7900660693cf@linaro.org> References: <20231218-topic-sm8650-upstream-altmode-v1-0-7900660693cf@linaro.org> In-Reply-To: <20231218-topic-sm8650-upstream-altmode-v1-0-7900660693cf@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=3404; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=nDXHDjdOUbZo6NMCY4ZIRIUoi9CPQ+tjxaeoWgPW94E=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBlgB5R3BMMALruVDHpz+DlfjI7+aKYNWPrdMVKk0Ov K91Jq2eJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZYAeUQAKCRB33NvayMhJ0dAAD/ 44kh86BJr7RRRsbignuODXOZEQc7PaPk9ZW018RoPHz6esmxH+a/dIRq9DPBr9F2xOIjq/NL/DkjRx GdDvjUvAa/xmV+90FsUHXO8wLacsT/3EuX7H4bUX7Sgbgj2JwQg/+3xsQWnG8qFKvOhVeMV4JmB/4u YJGnSsxeK8c+JL/AASLRKexUtkZKQdwm3v1DumIFnx3nBmndm2Oj36V65CmhPPj+hND/IfXxlZ8zKT PAPJfAHBLwJQe+CQ58R4KM1S2Lw4KZhv1abLty+0VbK8nDQv/lTto1SnT7nhEcN4z9omVDaO/wzcH1 t9JRM9ODUvuCPSkRf0ydwSUAH9/nty7Xqs3EknyyEO2wnMF/ilYxCUNw4dFaEOPq2yTTryTss7zsi5 d1o/fMHzZDe0+1X0cMUz4zao06Dmma7y7t7ic86K/F5dUrczOyf1O6Cv21Mp4z+zjNLpDIVwxvuo8y wtngj23nuheeL2dXd/bDqUqDl8uXXS2QQ7dXkcrF7XAx8Q7HNxDKcKqlw6q5uMEovU3RlnSoezZvrB IwUjEwzSOCQjkmLeHdDxvwB8aD7e8o+8o72Arg9TMb+Vht9mse9r2CK2dTLtCivdf24wJC6lTPEoY5 qr6ud9+N7oUx12EXwUNRMRiXc98Zt0wcYCcDFYuLgxvt1Dq+lZgUUOW1d/PA== 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-20231218_022630_883060_DC03B2B7 X-CRM114-Status: GOOD ( 12.12 ) 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..121fbbb5d015 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 = "ok"; + + 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 = "ok"; + + 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>; };