Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3350016pxj; Mon, 7 Jun 2021 08:31:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbl+RJKPP9i4dga2Y1a/hVYRh4QMrzZgQzHwxdlcBURD+blIblJWPZ3SjQ2JGHwjv7N8V8 X-Received: by 2002:a17:906:3644:: with SMTP id r4mr18547772ejb.140.1623079897933; Mon, 07 Jun 2021 08:31:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623079897; cv=none; d=google.com; s=arc-20160816; b=VXBbRBlEypQ6GSc6n6nhxK7+km4c45P0fAOPUZ7hW+9+UNMFM9Azi8O1JkxINccF6l y70NFmfHIxq+wXF/VxZVetW+iXFoF3H7DoRm3RvVAj5WJzmZJHDPcHz4WYgHVMw8kAi4 TfMCC3v+G7GLRXXvzH43pRVVOXugJaAepKerZo94d64+Nhr6cxWheiI1bTO2S9jXjEAF ooylsJcyVbKqSyKL82rh99dZ3sxtiRFrjpAF75fHLWCqp79xIyDE5CZGe3qu113aXIw0 mbv9FnrIWx5z6yXMhOP2MVrN/UbduvDHfjbZeKb4JgWMu2GH9QAx2wV/W8LOzSVWOuIa or0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=TBonzj0wK2eMrUMd6BSIQ0dwX/RR5Bz8ilFeFxR/TGA=; b=kPj+eXFPqMY2lb5gAuctRszCW5ouUWgmYdZzPFssdNZP13uNOxOkUCFQfUMAxtC4kW JfwoghNmeT60uXrQfT4lzwLPI40JB44GGO+P4WdptSAEGSoj/d8teBramIFaHLHHtiQL ON06srWjiPq6ryc2xSNuSRqS6n2rUZzF9TlCCE6a8C4krlLFg0zez/pWDT8jCT+GOxT7 632o4kzSQwiwJziI45jsb5B+tQriPG0I08OVkO1gpWeKTuuGvhKYK3iA/LJuBx0gbVoW VpfHqvrIwMfZucdcxJ0GBoYbd6+ZScSuUyt+Cn6osW4pyDU39IuGI0zdXgGUIhqE59+z uobA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nMKso3FM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h3si12673582edq.233.2021.06.07.08.31.15; Mon, 07 Jun 2021 08:31:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nMKso3FM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230288AbhFGPbF (ORCPT + 99 others); Mon, 7 Jun 2021 11:31:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230239AbhFGPbE (ORCPT ); Mon, 7 Jun 2021 11:31:04 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 711D1C06178B for ; Mon, 7 Jun 2021 08:29:00 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id l9so1315971wms.1 for ; Mon, 07 Jun 2021 08:29:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TBonzj0wK2eMrUMd6BSIQ0dwX/RR5Bz8ilFeFxR/TGA=; b=nMKso3FMfmrhSU5hrDKlPqTBzag4qyRAim1CmknzGmK5CZlXJ+8ldGm4nuY0CrK/KK bL8JqkIY2YQGFKimMKeKOzdpOhcKrx29sAYIF7W9LnjDkIof9Y/+/U8MkuJPygjnC9a5 MbjPoB6hGVc5YnZprRBRfT/R8p1YvMzIMUMbG6SlJ8xLFIqlJls7VaEzc4Q1AEcO5q9A NaScyNR0yMa7iUnhmilLklRiN75V6zgulkErXd3uHaQqQ/Lcr1eL14UWLn4jlls+Qd++ I1dgb7vkcyYiLVLtmDzH+x9XCiPPfNDcI/QCNx3OY5zxntGDbtU0i+eV49leyXH3HSPb d/rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TBonzj0wK2eMrUMd6BSIQ0dwX/RR5Bz8ilFeFxR/TGA=; b=IqC9sMqxbWVEtl1CCAiVawbEvsBE1MZkWtLIBIOuCELWV4jKkKoHE8a+2e2ZrAigSw OuTxPgp+aPpaxk0F0gEH+V1htahExUfpkltdz0qJTj42KeXSjafcGp0UaBFVbwwSce9u w56WYY15cehFBd9qoWo8qtJtENxA96vMS2Unps1r8mNpGOZeJhdyQVar9ZITq2ELQNr7 3rwizFeHyb2M5xl69YT2JZ6NviKaLgZJraid/WgMvac0nFI40s8eZ3HAB9vzwGe90V5r oH9bPvRIv9E03JE/ZXmcDbNe+G+58rGNOck1y8ag7+DrPjhsS7gmUlniwrS+NuPNcIq/ xOMw== X-Gm-Message-State: AOAM530Cd1nYEQskyaE1Vl6xHCoyDxF3Lj/MikzFfW47IASH7+BzfemW FE7ujg3wum1uDGf+fHWwVvE9vg== X-Received: by 2002:a7b:c19a:: with SMTP id y26mr17394049wmi.132.1623079738917; Mon, 07 Jun 2021 08:28:58 -0700 (PDT) Received: from srini-hackbox.lan (cpc86377-aztw32-2-0-cust226.18-1.cable.virginm.net. [92.233.226.227]) by smtp.gmail.com with ESMTPSA id q3sm16370170wrr.43.2021.06.07.08.28.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 08:28:58 -0700 (PDT) From: Srinivas Kandagatla To: bjorn.andersson@linaro.org, broonie@kernel.org Cc: plai@codeaurora.org, tiwai@suse.de, robh@kernel.org, devicetree@vger.kernel.org, perex@perex.cz, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, lgirdwood@gmail.com, bgoswami@codeaurora.org, Srinivas Kandagatla Subject: [RFC PATCH 00/13] ASoC: qcom: Add AudioReach support Date: Mon, 7 Jun 2021 16:28:23 +0100 Message-Id: <20210607152836.17154-1-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset adds ASoC driver support to configure signal processing framework ("AudioReach") which is integral part of Qualcomm next generation audio SDK and will be deployed on upcoming Qualcomm chipsets. It makes use of ASoC Topology to load graphs on to the DSP which is then managed by APM (Audio Processing Manager) service to prepare/start/stop. Here is simpified high-level block diagram of AudioReach: ___________________________________________________________ | CPU (Application Processor) | | +---------+ +---------+ +---------+ | | | q6apm | | q6apm | | q6afe | | | | dais | <------> | | <-----> | bedais | | | +---------+ +---------+ +---------+ | | ^ ^ | | | | +---------+ | | +---------+ v +---------->|topology | | | | q6prm | +---------+ | | | | | |<-------->| GPR | +---------+ | | +---------+ +---------+ | | ^ | |____________________________|______________________________| | | RPMSG (IPC over GLINK) ____________________________|______________________________ | | | | +-----------------------+ | | | | | | v v q6 (Audio DSP) | |+-----+ +----------------------------------+ | || PRM | | APM (Audio Processing Manager) | | |+-----+ | . Graph Management | | | | . Command Handing | | | | . Event Management | | | | ... | | | +----------------------------------+ | | ^ | |____________________________|______________________________| | | LPASS AIF ____________________________|______________________________ | | Audio I/O | | v | | +--------------------------------------------------+ | | | Audio devices | | | | CODEC | HDMI-TX | PCM | SLIMBUS | I2S |MI2S |...| | | | | | | +--------------------------------------------------+ | |___________________________________________________________| AudioReach has constructs of sub-graph, container and modules. Each sub-graph can have N containers and each Container can have N Modules and connections between them can be linear or non-linear. An audio function can be realized with one or many connected sub-graphs. There are also control/event paths between modules that can be wired up while building graph to achieve various control mechanism between modules. These concepts of Sub-Graph, Containers and Modules are represented in ASoC topology. Here is simple I2S graph with a Write Shared Memory and a Volume control module within a single Subgraph (1) with one Container (1) and 5 modules. ____________________________________________________________ | Sub-Graph [1] | | _______________________________________________________ | | | Container [1] | | | | [WR_SH] -> [PCM DEC] -> [PCM CONV] -> [VOL]-> [I2S-EP]| | | |_______________________________________________________| | |____________________________________________________________| For now this graph is split into two subgraphs to achieve dpcm like below: ________________________________________________ _________________ | Sub-Graph [1] | | Sub-Graph [2] | | ____________________________________________ | | _____________ | | | Container [1] | | | |Container [2]| | | | [WR_SH] -> [PCM DEC] -> [PCM CONV] -> [VOL]| | | | [I2S-EP] | | | |____________________________________________| | | |_____________| | |________________________________________________| |_________________| _________________ | Sub-Graph [3] | | _____________ | | |Container [3]| | | | [DMA-EP] | | | |_____________| | |_________________| This patchset adds very minimal support for AudioReach which includes supporting sub-graphs containing CODEC DMA ports and simple PCM Decoder/Encoder and Logger Modules. Additional capabilities will be built over time to expose features offered by AudioReach. This patchset is Tested on SM8250 SoC based Qualcomm Robotics Platform RB5 and SM9250 MTP with WSA881X Smart Speaker Amplifiers, DMICs connected via VA Macro and WCD938x Codec connected via TX and RX Macro. Sample WIP ASoC graphs are available at https://git.linaro.org/people/srinivas.kandagatla/audioreach-topology.git/ Thanks, srini Srinivas Kandagatla (13): soc: dt-bindings: qcom: add gpr bindings soc: qcom: add gpr driver support ASoC: qcom: dt-bindings: add bindings Audio Processing manager ASoC: qcom: audioreach: add basic pkt alloc support ASoC: qcom: audioreach: add q6apm support ASoC: qcom: audioreach: add module configuration command helpers ASoC: qcom: audioreach: add topology support ASoC: qcom: audioreach: add q6apm-dai support ASoC: qcom: audioreach: add bedai support ASoC: qcom: dt-bindings: add bindings for Proxy Resource Manager ASoC: qcom: audioreach: add q6prm support ASoC: qcom: dt-bindings: add audioreach soundcard compatibles ASoC: qcom: sm8250: Add audioreach support .../bindings/soc/qcom/qcom,gpr.yaml | 74 ++ .../devicetree/bindings/sound/qcom,q6apm.yaml | 72 ++ .../devicetree/bindings/sound/qcom,q6prm.yaml | 43 + .../bindings/sound/qcom,sm8250.yaml | 43 + drivers/soc/qcom/Kconfig | 9 + drivers/soc/qcom/Makefile | 1 + drivers/soc/qcom/gpr.c | 487 ++++++++ include/dt-bindings/soc/qcom,gpr.h | 18 + include/dt-bindings/sound/qcom,q6apm.h | 215 ++++ include/dt-bindings/sound/qcom,q6prm.h | 205 ++++ include/linux/soc/qcom/gpr.h | 127 ++ include/uapi/sound/snd_ar_tokens.h | 200 +++ sound/soc/qcom/Kconfig | 20 + sound/soc/qcom/Makefile | 1 + sound/soc/qcom/audioreach/Makefile | 12 + sound/soc/qcom/audioreach/audioreach.c | 1082 +++++++++++++++++ sound/soc/qcom/audioreach/audioreach.h | 649 ++++++++++ sound/soc/qcom/audioreach/q6apm-bedai.c | 377 ++++++ sound/soc/qcom/audioreach/q6apm-dai.c | 494 ++++++++ sound/soc/qcom/audioreach/q6apm.c | 962 +++++++++++++++ sound/soc/qcom/audioreach/q6apm.h | 171 +++ sound/soc/qcom/audioreach/q6prm.c | 412 +++++++ sound/soc/qcom/audioreach/topology.c | 848 +++++++++++++ sound/soc/qcom/sm8250.c | 144 ++- 24 files changed, 6665 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,gpr.yaml create mode 100644 Documentation/devicetree/bindings/sound/qcom,q6apm.yaml create mode 100644 Documentation/devicetree/bindings/sound/qcom,q6prm.yaml create mode 100644 drivers/soc/qcom/gpr.c create mode 100644 include/dt-bindings/soc/qcom,gpr.h create mode 100644 include/dt-bindings/sound/qcom,q6apm.h create mode 100644 include/dt-bindings/sound/qcom,q6prm.h create mode 100644 include/linux/soc/qcom/gpr.h create mode 100644 include/uapi/sound/snd_ar_tokens.h create mode 100644 sound/soc/qcom/audioreach/Makefile create mode 100644 sound/soc/qcom/audioreach/audioreach.c create mode 100644 sound/soc/qcom/audioreach/audioreach.h create mode 100644 sound/soc/qcom/audioreach/q6apm-bedai.c create mode 100644 sound/soc/qcom/audioreach/q6apm-dai.c create mode 100644 sound/soc/qcom/audioreach/q6apm.c create mode 100644 sound/soc/qcom/audioreach/q6apm.h create mode 100644 sound/soc/qcom/audioreach/q6prm.c create mode 100644 sound/soc/qcom/audioreach/topology.c -- 2.21.0