From nobody Fri Sep 19 07:04:10 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2851AC4167D for ; Mon, 28 Nov 2022 13:10:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230032AbiK1NKb (ORCPT ); Mon, 28 Nov 2022 08:10:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230364AbiK1NKZ (ORCPT ); Mon, 28 Nov 2022 08:10:25 -0500 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3DD41C117 for ; Mon, 28 Nov 2022 05:10:23 -0800 (PST) Received: by mail-lf1-x129.google.com with SMTP id f13so17241074lfa.6 for ; Mon, 28 Nov 2022 05:10:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=F+MZFFXQoUg3Z5XDdTQwCe4xWRYWXnsMf0CVDTxJETo=; b=ES4wwhw+HbyFfsdgILeqak2EdPforwx6r76D3oaBVKWkDfcJ/CHiFlwsHzSlMQCGsU RidDxvWiMjTH1rfb7rfTYRU9Q4Z84lXLMIrZ+/vlxAQUIRKIKJWzqys0qFP4JbbgtBNM ODNVJyClwa5PGzpfEHxzKYfUxX370W5eAH6BE/D+R7kshv56yffD2lODJk+EdDRINDxH txmmq5HIJ5SlyhD6MVPul7I7m6Arj4yeRKNkL+Wo0DppqnEfiRhgpHw2qaybxPFesx9Y PVTjTfbt/Pig1t/hh+0XAyD7Ga/x2HFB38sV9ttg0U9NnVt2dPXFgkFAudvm6oUla7xY OPNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=F+MZFFXQoUg3Z5XDdTQwCe4xWRYWXnsMf0CVDTxJETo=; b=3MsWUqdx0ZGiUpm9dFCYiYPSrtYLu0YSCXi26ldFU5u53dWarVZEgHVTTClve7DUyI KU5aQ/K4uY2ZETVgu6d+42pdNIS5+UnLGdeZ0HIzsz/0ewm8/uIU+lIONMf4DKErRmGS +as6Qw5ulGcDLqZoakYNoUAJpOz9lIWLjM3AqxHQaewLiMqmaqjs+6+8LK/QPt2bWV/B lJ9uad8Eg6fwTGWf9gFyqlK6DGjmI8/9zLjC6y1ye5IrStKQqo+6UI/aR+5lTYT2jC74 tiToTGsOCY/H10IEcbYg7oDA7Xpwwdr3fzvFS5RVWjySOAH2y0K0jiRcC5EFC43evvww uvaw== X-Gm-Message-State: ANoB5plc3bJv7yxMt0qoF4fxpzpATF5LGa1ugEG6LvuF5UbvkEix2nyA /Mh9t/VkuE93aQcLsmR17A5RHA== X-Google-Smtp-Source: AA0mqf4j+tL8JbuzDrExGUSMTCuPKekebgCSGv4qfhcYBHzy7h6Z1zNeGyz6IIoYCiyfFly7WF0qOQ== X-Received: by 2002:ac2:50cf:0:b0:4aa:6cdf:2aef with SMTP id h15-20020ac250cf000000b004aa6cdf2aefmr12956009lfm.247.1669641021396; Mon, 28 Nov 2022 05:10:21 -0800 (PST) Received: from krzk-bin.NAT.warszawa.vectranet.pl (088156142067.dynamic-2-waw-k-3-2-0.vectranet.pl. [88.156.142.67]) by smtp.gmail.com with ESMTPSA id j12-20020a056512028c00b004b40c1f1c70sm1725340lfp.212.2022.11.28.05.10.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Nov 2022 05:10:20 -0800 (PST) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Srinivas Kandagatla , Krzysztof Kozlowski Subject: [PATCH v5 2/3] arm64: dts: qcom: sm8450: add Soundwire and LPASS Date: Mon, 28 Nov 2022 14:10:15 +0100 Message-Id: <20221128131016.127860-3-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221128131016.127860-1-krzysztof.kozlowski@linaro.org> References: <20221128131016.127860-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Srinivas Kandagatla Add Soundwire controllers, Low Power Audio SubSystem (LPASS) devices and LPASS pin controller. Signed-off-by: Srinivas Kandagatla Co-developed-by: Krzysztof Kozlowski Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio --- Changes since v4: 1. Re-order few properties between Soundwire nodes, to keep them ordered consistently. 2. Drop unsupported qcom,port-offset. Changes since v3: 1. Re-order reg and sound-dai-cells. Changes since v2: 1. Use lower-case hex. Changes since v1: 1. Whitespace cleanups. 2. Correct include - do not use deprecated one. --- arch/arm64/boot/dts/qcom/sm8450.dtsi | 292 +++++++++++++++++++++++++++ 1 file changed, 292 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sm8450.dtsi b/arch/arm64/boot/dts/qco= m/sm8450.dtsi index 7b63c56ff2f4..380405ec3452 100644 --- a/arch/arm64/boot/dts/qcom/sm8450.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8450.dtsi @@ -15,6 +15,7 @@ #include #include #include +#include #include =20 / { @@ -2090,6 +2091,209 @@ compute-cb@3 { }; }; =20 + wsa2macro: codec@31e0000 { + compatible =3D "qcom,sm8450-lpass-wsa-macro"; + reg =3D <0 0x031e0000 0 0x1000>; + clocks =3D <&q6prmcc LPASS_CLK_ID_WSA_CORE_TX_MCLK LPASS_CLK_ATTRIBUTE_= COUPLE_NO>, + <&q6prmcc LPASS_CLK_ID_RX_CORE_MCLK2_2X_MCLK LPASS_CLK_ATTRIBUTE_COUP= LE_NO>, + <&q6prmcc LPASS_HW_MACRO_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>, + <&q6prmcc LPASS_HW_DCODEC_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>, + <&vamacro>; + clock-names =3D "mclk", "npl", "macro", "dcodec", "fsgen"; + assigned-clocks =3D <&q6prmcc LPASS_CLK_ID_WSA_CORE_TX_MCLK LPASS_CLK_A= TTRIBUTE_COUPLE_NO>, + <&q6prmcc LPASS_CLK_ID_RX_CORE_MCLK2_2X_MCLK LPASS_CLK_ATTRIBUTE_CO= UPLE_NO>; + assigned-clock-rates =3D <19200000>, <19200000>; + + #clock-cells =3D <0>; + clock-output-names =3D "wsa2-mclk"; + pinctrl-names =3D "default"; + pinctrl-0 =3D <&wsa2_swr_active>; + #sound-dai-cells =3D <1>; + }; + + /* WSA2 */ + swr4: soundwire-controller@31f0000 { + compatible =3D "qcom,soundwire-v1.7.0"; + reg =3D <0 0x031f0000 0 0x2000>; + interrupts =3D ; + clocks =3D <&wsa2macro>; + clock-names =3D "iface"; + + qcom,din-ports =3D <2>; + qcom,dout-ports =3D <6>; + + qcom,ports-sinterval-low =3D /bits/ 8 <0x07 0x1f 0x3f 0x07 0x1f 0x3f 0x= 0f 0x0f>; + qcom,ports-offset1 =3D /bits/ 8 <0x01 0x02 0x0c 0x06 0x12 0x0d 0x07 0x= 0a>; + qcom,ports-offset2 =3D /bits/ 8 <0xff 0x00 0x1f 0xff 0x00 0x1f 0x00 0x= 00>; + qcom,ports-hstart =3D /bits/ 8 <0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xf= f>; + qcom,ports-hstop =3D /bits/ 8 <0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff= >; + qcom,ports-word-length =3D /bits/ 8 <0xff 0xff 0xff 0xff 0xff 0xff 0xff= 0xff>; + qcom,ports-block-pack-mode =3D /bits/ 8 <0xff 0xff 0x01 0xff 0xff 0x01 = 0xff 0xff>; + qcom,ports-block-group-count =3D /bits/ 8 <0xff 0xff 0xff 0xff 0xff 0xf= f 0xff 0xff>; + qcom,ports-lane-control =3D /bits/ 8 <0xff 0xff 0xff 0xff 0xff 0xff 0xf= f 0xff>; + + #address-cells =3D <2>; + #size-cells =3D <0>; + #sound-dai-cells =3D <1>; + }; + + rxmacro: codec@3200000 { + compatible =3D "qcom,sm8450-lpass-rx-macro"; + reg =3D <0 0x3200000 0 0x1000>; + clocks =3D <&q6prmcc LPASS_CLK_ID_RX_CORE_TX_MCLK LPASS_CLK_ATTRIBUTE_C= OUPLE_NO>, + <&q6prmcc LPASS_CLK_ID_RX_CORE_MCLK2_2X_MCLK LPASS_CLK_ATTRIBUTE_COUP= LE_NO>, + <&q6prmcc LPASS_HW_MACRO_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>, + <&q6prmcc LPASS_HW_DCODEC_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>, + <&vamacro>; + clock-names =3D "mclk", "npl", "macro", "dcodec", "fsgen"; + + assigned-clocks =3D <&q6prmcc LPASS_CLK_ID_RX_CORE_TX_MCLK LPASS_CLK_A= TTRIBUTE_COUPLE_NO>, + <&q6prmcc LPASS_CLK_ID_RX_CORE_MCLK2_2X_MCLK LPASS_CLK_ATTRIBUTE_COUP= LE_NO>; + assigned-clock-rates =3D <19200000>, <19200000>; + + #clock-cells =3D <0>; + clock-output-names =3D "mclk"; + pinctrl-names =3D "default"; + pinctrl-0 =3D <&rx_swr_active>; + #sound-dai-cells =3D <1>; + }; + + swr1: soundwire-controller@3210000 { + compatible =3D "qcom,soundwire-v1.7.0"; + reg =3D <0 0x3210000 0 0x2000>; + interrupts =3D ; + clocks =3D <&rxmacro>; + clock-names =3D "iface"; + label =3D "RX"; + qcom,din-ports =3D <0>; + qcom,dout-ports =3D <5>; + + qcom,ports-sinterval-low =3D /bits/ 8 <0x03 0x1f 0x1f 0x07 0x00>; + qcom,ports-offset1 =3D /bits/ 8 <0x00 0x00 0x0b 0x01 0x00>; + qcom,ports-offset2 =3D /bits/ 8 <0x00 0x00 0x0b 0x00 0x00>; + qcom,ports-hstart =3D /bits/ 8 <0xff 0x03 0xff 0xff 0xff>; + qcom,ports-hstop =3D /bits/ 8 <0xff 0x06 0xff 0xff 0xff>; + qcom,ports-word-length =3D /bits/ 8 <0x01 0x07 0x04 0xff 0xff>; + qcom,ports-block-pack-mode =3D /bits/ 8 <0xff 0x00 0x01 0xff 0xff>; + qcom,ports-block-group-count =3D /bits/ 8 <0xff 0xff 0xff 0xff 0x00>; + qcom,ports-lane-control =3D /bits/ 8 <0x01 0x00 0x00 0x00 0x00>; + + #address-cells =3D <2>; + #size-cells =3D <0>; + #sound-dai-cells =3D <1>; + }; + + txmacro: codec@3220000 { + compatible =3D "qcom,sm8450-lpass-tx-macro"; + reg =3D <0 0x3220000 0 0x1000>; + clocks =3D <&q6prmcc LPASS_CLK_ID_RX_CORE_TX_MCLK LPASS_CLK_ATTRIBUTE_C= OUPLE_NO>, + <&q6prmcc LPASS_CLK_ID_RX_CORE_MCLK2_2X_MCLK LPASS_CLK_ATTRIBUTE_COUP= LE_NO>, + <&q6prmcc LPASS_HW_MACRO_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>, + <&q6prmcc LPASS_HW_DCODEC_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>, + <&vamacro>; + clock-names =3D "mclk", "npl", "macro", "dcodec", "fsgen"; + assigned-clocks =3D <&q6prmcc LPASS_CLK_ID_RX_CORE_TX_MCLK LPASS_CLK_AT= TRIBUTE_COUPLE_NO>, + <&q6prmcc LPASS_CLK_ID_RX_CORE_MCLK2_2X_MCLK LPASS_CLK_ATTRIBUTE_CO= UPLE_NO>; + assigned-clock-rates =3D <19200000>, <19200000>; + + #clock-cells =3D <0>; + clock-output-names =3D "mclk"; + pinctrl-names =3D "default"; + pinctrl-0 =3D <&tx_swr_active>; + #sound-dai-cells =3D <1>; + }; + + wsamacro: codec@3240000 { + compatible =3D "qcom,sm8450-lpass-wsa-macro"; + reg =3D <0 0x03240000 0 0x1000>; + clocks =3D <&q6prmcc LPASS_CLK_ID_WSA_CORE_TX_MCLK LPASS_CLK_ATTRIBUTE_= COUPLE_NO>, + <&q6prmcc LPASS_CLK_ID_RX_CORE_MCLK2_2X_MCLK LPASS_CLK_ATTRIBUTE_COUP= LE_NO>, + <&q6prmcc LPASS_HW_MACRO_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>, + <&q6prmcc LPASS_HW_DCODEC_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>, + <&vamacro>; + clock-names =3D "mclk", "npl", "macro", "dcodec", "fsgen"; + + assigned-clocks =3D <&q6prmcc LPASS_CLK_ID_WSA_CORE_TX_MCLK LPASS_CLK_A= TTRIBUTE_COUPLE_NO>, + <&q6prmcc LPASS_CLK_ID_RX_CORE_MCLK2_2X_MCLK LPASS_CLK_ATTRIBUTE_CO= UPLE_NO>; + assigned-clock-rates =3D <19200000>, <19200000>; + + #clock-cells =3D <0>; + clock-output-names =3D "mclk"; + pinctrl-names =3D "default"; + pinctrl-0 =3D <&wsa_swr_active>; + #sound-dai-cells =3D <1>; + }; + + /* WSA */ + swr0: soundwire-controller@3250000 { + compatible =3D "qcom,soundwire-v1.7.0"; + reg =3D <0 0x03250000 0 0x2000>; + interrupts =3D ; + clocks =3D <&wsamacro>; + clock-names =3D "iface"; + + qcom,din-ports =3D <2>; + qcom,dout-ports =3D <6>; + + qcom,ports-sinterval-low =3D /bits/ 8 <0x07 0x1f 0x3f 0x07 0x1f 0x3f 0x= 0f 0x0f>; + qcom,ports-offset1 =3D /bits/ 8 <0x01 0x02 0x0c 0x06 0x12 0x0d 0x07 0x= 0a>; + qcom,ports-offset2 =3D /bits/ 8 <0xff 0x00 0x1f 0xff 0x00 0x1f 0x00 0x= 00>; + qcom,ports-hstart =3D /bits/ 8 <0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xf= f>; + qcom,ports-hstop =3D /bits/ 8 <0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff= >; + qcom,ports-word-length =3D /bits/ 8 <0xff 0xff 0xff 0xff 0xff 0xff 0xff= 0xff>; + qcom,ports-block-pack-mode =3D /bits/ 8 <0xff 0xff 0x01 0xff 0xff 0x01 = 0xff 0xff>; + qcom,ports-block-group-count =3D /bits/ 8 <0xff 0xff 0xff 0xff 0xff 0xf= f 0xff 0xff>; + qcom,ports-lane-control =3D /bits/ 8 <0xff 0xff 0xff 0xff 0xff 0xff 0xf= f 0xff>; + + #address-cells =3D <2>; + #size-cells =3D <0>; + #sound-dai-cells =3D <1>; + }; + + swr2: soundwire-controller@33b0000 { + compatible =3D "qcom,soundwire-v1.7.0"; + reg =3D <0 0x33b0000 0 0x2000>; + interrupts-extended =3D <&intc GIC_SPI 496 IRQ_TYPE_LEVEL_HIGH>, + <&intc GIC_SPI 520 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names =3D "core", "wake"; + + clocks =3D <&vamacro>; + clock-names =3D "iface"; + label =3D "TX"; + + qcom,din-ports =3D <4>; + qcom,dout-ports =3D <0>; + qcom,ports-sinterval-low =3D /bits/ 8 <0x01 0x01 0x03 0x03>; + qcom,ports-offset1 =3D /bits/ 8 <0x00 0x00 0x01 0x01>; + qcom,ports-offset2 =3D /bits/ 8 <0x00 0x00 0x00 0x00>; + qcom,ports-hstart =3D /bits/ 8 <0xff 0xff 0xff 0xff>; + qcom,ports-hstop =3D /bits/ 8 <0xff 0xff 0xff 0xff>; + qcom,ports-word-length =3D /bits/ 8 <0xff 0xff 0xff 0xff>; + qcom,ports-block-pack-mode =3D /bits/ 8 <0xff 0xff 0xff 0xff>; + qcom,ports-block-group-count =3D /bits/ 8 <0xff 0xff 0xff 0xff>; + qcom,ports-lane-control =3D /bits/ 8 <0x01 0x02 0x00 0x00>; + + #address-cells =3D <2>; + #size-cells =3D <0>; + #sound-dai-cells =3D <1>; + }; + + vamacro: codec@33f0000 { + compatible =3D "qcom,sm8450-lpass-va-macro"; + reg =3D <0 0x033f0000 0 0x1000>; + clocks =3D <&q6prmcc LPASS_CLK_ID_TX_CORE_MCLK LPASS_CLK_ATTRIBUTE_COUP= LE_NO>, + <&q6prmcc LPASS_HW_MACRO_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>, + <&q6prmcc LPASS_HW_DCODEC_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>, + <&q6prmcc LPASS_CLK_ID_RX_CORE_MCLK2_2X_MCLK LPASS_CLK_ATTRIBUTE_COUP= LE_NO>; + clock-names =3D "mclk", "macro", "dcodec", "npl"; + assigned-clocks =3D <&q6prmcc LPASS_CLK_ID_TX_CORE_MCLK LPASS_CLK_ATTRI= BUTE_COUPLE_NO>; + assigned-clock-rates =3D <19200000>; + + #clock-cells =3D <0>; + clock-output-names =3D "fsgen"; + #sound-dai-cells =3D <1>; + }; + remoteproc_adsp: remoteproc@30000000 { compatible =3D "qcom,sm8450-adsp-pas"; reg =3D <0 0x30000000 0 0x100>; @@ -3023,6 +3227,91 @@ qup_uart20_default: qup-uart20-default-state { =20 }; =20 + lpass_tlmm: pinctrl@3440000{ + compatible =3D "qcom,sm8450-lpass-lpi-pinctrl"; + reg =3D <0 0x3440000 0x0 0x20000>, + <0 0x34d0000 0x0 0x10000>; + gpio-controller; + #gpio-cells =3D <2>; + gpio-ranges =3D <&lpass_tlmm 0 0 23>; + + clocks =3D <&q6prmcc LPASS_HW_MACRO_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>, + <&q6prmcc LPASS_HW_DCODEC_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>; + clock-names =3D "core", "audio"; + + wsa_swr_active: wsa-swr-active-state { + clk-pins { + pins =3D "gpio10"; + function =3D "wsa_swr_clk"; + drive-strength =3D <2>; + slew-rate =3D <1>; + bias-disable; + }; + + data-pins { + pins =3D "gpio11"; + function =3D "wsa_swr_data"; + drive-strength =3D <2>; + slew-rate =3D <1>; + bias-bus-hold; + }; + }; + + tx_swr_active: tx-swr-active-state { + clk-pins { + pins =3D "gpio0"; + function =3D "swr_tx_clk"; + drive-strength =3D <2>; + slew-rate =3D <1>; + bias-disable; + }; + + data-pins { + pins =3D "gpio1", "gpio2", "gpio14"; + function =3D "swr_tx_data"; + drive-strength =3D <2>; + slew-rate =3D <1>; + bias-bus-hold; + }; + }; + + rx_swr_active: rx-swr-active-state { + clk-pins { + pins =3D "gpio3"; + function =3D "swr_rx_clk"; + drive-strength =3D <2>; + slew-rate =3D <1>; + bias-disable; + }; + + data-pins { + pins =3D "gpio4", "gpio5"; + function =3D "swr_rx_data"; + drive-strength =3D <2>; + slew-rate =3D <1>; + bias-bus-hold; + }; + }; + + wsa2_swr_active: wsa2-swr-active-state { + clk-pins { + pins =3D "gpio15"; + function =3D "wsa2_swr_clk"; + drive-strength =3D <2>; + slew-rate =3D <1>; + bias-disable; + }; + + data-pins { + pins =3D "gpio16"; + function =3D "wsa2_swr_data"; + drive-strength =3D <2>; + slew-rate =3D <1>; + bias-bus-hold; + }; + }; + }; + apps_smmu: iommu@15000000 { compatible =3D "qcom,sm8450-smmu-500", "arm,mmu-500"; reg =3D <0 0x15000000 0 0x100000>; @@ -3501,6 +3790,9 @@ lpass_ag_noc: interconnect@3c40000 { }; }; =20 + sound: sound { + }; + thermal-zones { aoss0-thermal { polling-delay-passive =3D <0>; --=20 2.34.1