From patchwork Tue Oct 3 13:18:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 147879 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp2080600vqb; Tue, 3 Oct 2023 06:21:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFR1q8CcPT50c6mOLuM+p3Cf6jMj6EAfH/1Fl8u8wfaXY62yvixq/pE1zBwiq/QtL0dFeRq X-Received: by 2002:a17:903:184:b0:1c0:bcbc:d67 with SMTP id z4-20020a170903018400b001c0bcbc0d67mr4233378plg.22.1696339274242; Tue, 03 Oct 2023 06:21:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696339274; cv=pass; d=google.com; s=arc-20160816; b=HWm2XrwtdcvBxiI7081NXqgBOxjGRRYFrv/ZOtuwlxWDNRBdtfPNeHlTsePcXIgUCz vNB9u9rC9g60Oq+LmyT11uRstP9lhsLZdVufgQWi5jefM2n5YIU/pLNDbiPsrwb4XXh9 9WZzpVbe4fPcPEVFiojCYgKZmXs7gSisq/Y+2A7GqDnMdYAQZ1nmCkoHbUit+V69gfzg fReFjFff5jlKBOXxqsXwcanBXUL73ueNEG+RNxfUWu5uFSxqmCX7hhqTi0AFdbm+IP9f TggSbBaESTNtBcIZMkrNZPUL4zLrQfkkpDnvR4Hjlz/A1/oF3PqowR18LSGEj2/ZSUIi ZT8A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature:dkim-signature; bh=axN5JTKzeHnuAwCYNQDx+NKlDEDPR1XqPTp8Vpb9ugo=; fh=2KZCdDDOrrR71Og9rtv+A3rmI3MualZUlNJjU056txw=; b=twOw7ivFR0PNUODAm5oYoljb5RTPlaXzM/PdmW90JALJvoIsY8tD8faoxqDdirTFBC AR6IrRjsmgUQmoPTDZyhesIUPc7nW+Sa829QPQ0wdQr/Yyf+a60J4NHYglK42JCBVDm4 EFzE47s7UtX8QbanPDap3igKRbHgKy+UZe4X5JiywPnhNSAa39WIs4B8Xerng2M1mphN /OXN5fzYtV5n2IIfrJN2YG+KrBsaL6xtKWrG/2AyoAXS/TNakT9toL7AB/JbQEgvzDtb V3LTkaCjKj72Y5E3q2XEtJmyzWxVcRrM67ps+fbwpI6yKGA+1xZF2MOhCp01y7MDa1w7 Yn4A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gerhold.net header.s=strato-dkim-0002 header.b=PJqm4E5g; dkim=neutral (no key) header.i=@gerhold.net header.s=strato-dkim-0003; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id u190-20020a6385c7000000b00582f2161cb4si1496368pgd.300.2023.10.03.06.21.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 06:21:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@gerhold.net header.s=strato-dkim-0002 header.b=PJqm4E5g; dkim=neutral (no key) header.i=@gerhold.net header.s=strato-dkim-0003; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id F3C7480765D5; Tue, 3 Oct 2023 06:20:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235655AbjJCNS7 (ORCPT + 17 others); Tue, 3 Oct 2023 09:18:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234590AbjJCNSv (ORCPT ); Tue, 3 Oct 2023 09:18:51 -0400 Received: from mo4-p02-ob.smtp.rzone.de (mo4-p02-ob.smtp.rzone.de [81.169.146.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 812BEAB; Tue, 3 Oct 2023 06:18:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696339125; cv=none; d=strato.com; s=strato-dkim-0002; b=RJJJ6c3m9rHxAG2DyN+OMi8V6qhNOzpQXPVMHa3Wz/Qh4EJc/TfNoa0cAQ8BMyqgB+ Pp3xtnkWqo4qKQwDGVjuBTVOBqyxHMNYM+zHjs3q7SztLM4Acr7DUh6hL+QseaCxIu3c AJjXEPiT4jf2qHWaVwJ00UulOFO3o1D3hEG9VYADtzIl1pUf/MFhmKNGhg95higmypk5 vL6Ajm62sr0GdRo62aSnUIiix6dUcG4FcIptLnyUKlQqDu6scxg4dZKyZXvCby0DqZ+B yUdP1MMoB9aF6ETordixoX1BFFzS09pOUMZA2DWmh/QILXEf/kUrVfgbkERJYlAVFA0e rhNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1696339125; s=strato-dkim-0002; d=strato.com; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=axN5JTKzeHnuAwCYNQDx+NKlDEDPR1XqPTp8Vpb9ugo=; b=SNOATYAqOZBizfJlp66r2gcRodkOMZ4rwWy2pzc90+f234WwLoaVChimYCrWcqXJEI KRk0fjz+HxjJV3uCTMJoDczjZnioO2JGtQO6oRGNYS4672j55P4fkOVOuHXW6N12uym5 /RazlJu6qStkWwNYZwQ7Gr4THT1yEZkvK9Vm3eKLBr2AavAuCByNgoMzCnns/tsbnCtr VJLLENYOBPF6ahFTemxQatJ5JZyK5wULYXYEv6VHtax41mmg8gm5uNOVLRcV8vKyTSKa 1IsGi/UbOFoWAYWe7qpTMjzGERqmCQQP5FS90fRUj4CFBGvdmCiQrCqDspUUo+0WCOF6 1yaw== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo02 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1696339125; s=strato-dkim-0002; d=gerhold.net; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=axN5JTKzeHnuAwCYNQDx+NKlDEDPR1XqPTp8Vpb9ugo=; b=PJqm4E5guv2vaMi+fMjYoEJlLMRF1ciNE2n34JOqcv2sx4dhr32JyvxYBkNsYoA7o5 /X8yhdDFPAfru2ag1saVVoHe3OPfOJ47Hdf0Maxrg0WN/XNVvpzAtp1TZXvnu4i0UH3d 43F3Hjv8KRj+K7Nbin34G1Ajh4D4TCe1/5wUgKTDJmXOBOOASee5YPQPHmAVUMycoemp S87csp5qPfCeyClbC7tWNblU0o6ot09l/960LmUo1LlinxFMF5CgqgrSrsUqc4heDIH2 PlLJeH46Y3Dp6HzqoT1zBHgUHqyU6TMzLjhp9+mcW3i34EYdjoBzNYXmd/LeURj7gk1R nMGQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1696339125; s=strato-dkim-0003; d=gerhold.net; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=axN5JTKzeHnuAwCYNQDx+NKlDEDPR1XqPTp8Vpb9ugo=; b=Lru4Q6MDj5yRw8HsZG/E+xkykGPBaoNXE24VxA2E0+OfkP9OL5KE96r+RtXeQ6mSmH vEx7PZlAqI2buIg8d6AQ== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVOQjVd4CteZ/7jYgS+mLFY+H0JAn8u4l+/zY=" Received: from [192.168.244.3] by smtp.strato.de (RZmta 49.8.2 DYNA|AUTH) with ESMTPSA id R04c57z93DIj2OG (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Tue, 3 Oct 2023 15:18:45 +0200 (CEST) From: Stephan Gerhold Date: Tue, 03 Oct 2023 15:18:22 +0200 Subject: [PATCH v2 04/14] arm64: dts: qcom: msm8916: Add common msm8916-modem-qdsp6.dtsi MIME-Version: 1.0 Message-Id: <20231003-msm8916-modem-v2-4-61b684be55c0@gerhold.net> References: <20231003-msm8916-modem-v2-0-61b684be55c0@gerhold.net> In-Reply-To: <20231003-msm8916-modem-v2-0-61b684be55c0@gerhold.net> To: Bjorn Andersson Cc: Andy Gross , Konrad Dybcio , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Bryan O'Donoghue , Stephan Gerhold X-Mailer: b4 0.12.3 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 03 Oct 2023 06:20:25 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778740650376512516 X-GMAIL-MSGID: 1778740650376512516 Most MSM8916/MSM8939 devices use very similar setups for the modem, because most of the device-specific details are abstracted by the modem firmware. There are several definitions (status switches, DAI links etc) that will be exactly the same for every board. Introduce a common msm8916-modem-qdsp6.dtsi include that can be used to simplify enabling the modem for such devices. By default the digital/analog codec in the SoC/PMIC is used, but boards can define additional codecs by adding additional backend DAI links. Signed-off-by: Stephan Gerhold --- arch/arm64/boot/dts/qcom/msm8916-modem-qdsp6.dtsi | 148 ++++++++++++++++++++++ 1 file changed, 148 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916-modem-qdsp6.dtsi b/arch/arm64/boot/dts/qcom/msm8916-modem-qdsp6.dtsi new file mode 100644 index 000000000000..039961622633 --- /dev/null +++ b/arch/arm64/boot/dts/qcom/msm8916-modem-qdsp6.dtsi @@ -0,0 +1,148 @@ +// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) +/* + * msm8916-modem-qdsp6.dtsi describes the typical modem setup on MSM8916 devices + * (or similar SoCs) with audio routed via the QDSP6 services provided by the + * modem firmware. The digital/analog codec in the SoC/PMIC is used by default, + * but boards can define additional codecs by adding additional backend DAI links. + */ + +#include +#include + +&apr { + status = "okay"; +}; + +&bam_dmux { + status = "okay"; +}; + +&bam_dmux_dma { + status = "okay"; +}; + +&lpass { + status = "reserved"; /* Controlled by QDSP6 */ +}; + +&lpass_codec { + status = "okay"; +}; + +&mba_mem { + status = "okay"; +}; + +&mpss { + status = "okay"; +}; + +&mpss_mem { + status = "okay"; +}; + +&pm8916_codec { + status = "okay"; +}; + +&q6afedai { + dai@16 { + reg = ; + qcom,sd-lines = <0 1>; + }; + dai@20 { + reg = ; + qcom,sd-lines = <0 1>; + }; +}; + +&q6asmdai { + dai@0 { + reg = <0>; + direction = ; + }; + dai@1 { + reg = <1>; + direction = ; + }; + dai@2 { + reg = <2>; + direction = ; + }; + dai@3 { + reg = <3>; + direction = ; + is-compress-dai; + }; +}; + +&sound { + compatible = "qcom,msm8916-qdsp6-sndcard"; + model = "msm8916"; + + pinctrl-0 = <&cdc_pdm_default>; + pinctrl-1 = <&cdc_pdm_sleep>; + pinctrl-names = "default", "sleep"; + + status = "okay"; + + frontend0-dai-link { + link-name = "MultiMedia1"; + + cpu { + sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA1>; + }; + }; + + frontend1-dai-link { + link-name = "MultiMedia2"; + + cpu { + sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA2>; + }; + }; + + frontend2-dai-link { + link-name = "MultiMedia3"; + + cpu { + sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA3>; + }; + }; + + frontend3-dai-link { + link-name = "MultiMedia4"; + + cpu { + sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA4>; + }; + }; + + sound_link_backend0: backend0-dai-link { + link-name = "Primary MI2S"; + + cpu { + sound-dai = <&q6afedai PRIMARY_MI2S_RX>; + }; + platform { + sound-dai = <&q6routing>; + }; + codec { + sound-dai = <&lpass_codec 0>, <&pm8916_codec 0>; + }; + }; + + sound_link_backend1: backend1-dai-link { + link-name = "Tertiary MI2S"; + + cpu { + sound-dai = <&q6afedai TERTIARY_MI2S_TX>; + }; + platform { + sound-dai = <&q6routing>; + }; + codec { + sound-dai = <&lpass_codec 1>, <&pm8916_codec 1>; + }; + }; +};