From patchwork Fri Sep 3 11:20:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 506504 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp906415jai; Fri, 3 Sep 2021 04:21:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXqtnlPqif83l0y/6XO3hDeUfL7Jz9ME6NivEaQh/7QuU4LfTohtUSg2rwMyFfpRRAL5KW X-Received: by 2002:a02:a18d:: with SMTP id n13mr2255817jah.120.1630668099382; Fri, 03 Sep 2021 04:21:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630668099; cv=none; d=google.com; s=arc-20160816; b=GHeBllwSsM7m4nOSpnvFGR6ci2/sJWQE2zZ9lLHhjhzkjwIlwq0dIUXWcvleJ9qGWu MHu/QkdyKQ9XKmoov8HRkFtXl5JQK5ZsqPIM9isBIxIYxKHY00cQvJ50k14NNX63fR+U 62uKHrawIO1emkBAbwgrDv5aoVTrJwtRcafjtFHgH5036AZX6dGcHpJ3dquhVNpu+srq i7q88fFNs0i8GExZEwRDMl3GrDbOfRlMQ8hhIirJXVJFtu6XhqT1oE/0cs7/nRMXG55e khCsdFG9J+zHIzaOTtvfDpC0uPXTIK+jxh63H6ip7AAVz1ojvCK8TVE7aqdydaKon//9 y8kQ== 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=rhw/D3IqBN1hsJk+EJlULPqW12y1oz+eUkv320uK0aw=; b=NgLLi5Ej357+kl/4xXdtinCL94qdMddJll8MsQVaAif3Cx4HIAdcNugo6Fc68TzL0u IX+76RQ/yMESczio5zKNVcxRcNCHJNLh61Cihn1jaZq0Q1vx2rwgYHd/jJo1ARA3D/QP lS+bQVvO96rSC66MKG52jnY4YatLCArMpVNHcGzvBGZGrfAPqYtKi769qUnu25+W/5HI /ljjjzg9SQPFCVPZRVWkAAnqHVQmKD2Ioo9a8YaFHfpCeZM7Ikhnj3b9/L7cR2pGzHYf hVLcMbUp9wyypWhrENSmK4QxZYAgWb+KZlOGQfUoAPKzeIGTZ0SqIOENqgud8z3PxN/L 10yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yVeoksPl; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 j9si175389ile.176.2021.09.03.04.21.39; Fri, 03 Sep 2021 04:21:39 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-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=yVeoksPl; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 S1349247AbhICLWg (ORCPT + 6 others); Fri, 3 Sep 2021 07:22:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348974AbhICLWc (ORCPT ); Fri, 3 Sep 2021 07:22:32 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 855D9C061575 for ; Fri, 3 Sep 2021 04:21:32 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id t15so7735174wrg.7 for ; Fri, 03 Sep 2021 04:21:32 -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=rhw/D3IqBN1hsJk+EJlULPqW12y1oz+eUkv320uK0aw=; b=yVeoksPlImr5oQjW+RkW7IZ0rCFXQyMt3hePw1UlG5xZRAbjI/ieHdc3gGVsUhI5SQ FMJmreyq1ZpYHwVFvK4Hf6SRu1+SM5VRVuxnrO7SdabrEiQT2CoSUW4A75Lp2vW570ws bW1Vfnil7+24r1VMVuRa30E4JOhNrIqw4M2P2GOcIMpUvisb8MvHdO0vRdroiAvpD9mn 8JWWAixlddUJoJzB23+bBi7mN+1Gu6dOJIG6JvR7APCR3N3PNDxBCqGd4cD5JfTx8aEa Q6pxaXEZSOy8ORt4dbB07VYAWDUIdD2BPaWZbNyjUjPTDT74P04lDmYCJn/I48znVelj VHxA== 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=rhw/D3IqBN1hsJk+EJlULPqW12y1oz+eUkv320uK0aw=; b=ZlleNo1pMN8hzc1rVsjuFsCZu9NdAkKduUHP4ogcD8LeWwSPIn3iZg7/KAvmB6exnz WwXNPQ3wsWslCfgW7c5/N2rPHpxrocnrmYlmDZUMBZxVK83Hnpem2dmQAjlNZZEkbePa eXzPWko+1xakFFp4KHvMFrGNy1dOh21osjxq+ut6U+xwxw0TsMlUfAi+YaCQgqzmJsiR Qzy7mWES+QglyKVBituF0v6jGYf1gd+23UP9l+D1LC655K2V4N4hSAX2kx/Y3Sc7CPW7 3JRd72cVmgbKolDOc+42AI46ZYlq1S3ye+vSMkfdeHK3EaZWE+QTPQsqSjO0c/O6YZxJ xokA== X-Gm-Message-State: AOAM532rAo4ZLjLV1rvIBXxtqpVRR+5Y+3rN7Fd1t+gU3UvWkbYamM6t FZjv9tQdQPhs/vO8uSARc1H1CQ== X-Received: by 2002:adf:82b1:: with SMTP id 46mr3399951wrc.217.1630668090918; Fri, 03 Sep 2021 04:21:30 -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 f20sm3881877wmb.32.2021.09.03.04.21.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Sep 2021 04:21:30 -0700 (PDT) From: Srinivas Kandagatla To: bjorn.andersson@linaro.org, broonie@kernel.org, robh@kernel.org Cc: plai@codeaurora.org, tiwai@suse.de, devicetree@vger.kernel.org, perex@perex.cz, alsa-devel@alsa-project.org, lgirdwood@gmail.com, bgoswami@codeaurora.org, Srinivas Kandagatla Subject: [PATCH v5 00/21] ASoC: qcom: Add AudioReach support Date: Fri, 3 Sep 2021 12:20:11 +0100 Message-Id: <20210903112032.25834-1-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Many thanks for reviewing v4. This version addresses all the comments raised as part of v4 review. 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 simplified high-level block diagram of AudioReach: ___________________________________________________________ | CPU (Application Processor) | | +---------+ +---------+ +----------+ | | | q6apm | | q6apm | | q6apm | | | | dais | <------> | | <-----> |lpass-dais| | | +---------+ +---------+ +----------+ | | ^ ^ | | | | +---------+ | | +---------+ v +---------->|topology | | | | q6prm | +---------+ | | | | | |<-------->| GPR | +---------+ | | +---------+ +---------+ | | ^ ^ | | | | | | +----------+ | | | | q6prm | | | | |lpass-clks| | | | +----------+ | | |____________________________|______________________________| | | 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 and HDMI audio via I2S. First 10 Patches are mostly reorganization existing Old QDSP Audio Framework code and bindings so that we could reuse them on AudioReach. ASoC topology graphs for DragonBoard RB5 and SM8250 MTP are available at https://git.linaro.org/people/srinivas.kandagatla/audioreach-topology.git/ Thanks, srini Changes since v4: only apr dt-binding changes. - deprecated qcom,apr-domain dt-bindings to make it more reusable - added more protection-domain list that have been missed during yaml conversion. - remove "qcom,apr" compatible that was added by mistake during yaml conversion. Srinivas Kandagatla (21): soc: dt-bindings: qcom: apr: convert to yaml soc: dt-bindings: qcom: apr: deprecate qcom,apr-domain property soc: qcom: apr: make code more reuseable soc: dt-bindings: qcom: add gpr bindings soc: qcom: apr: Add GPR support ASoC: dt-bindings: move LPASS dai related bindings out of q6afe ASoC: dt-bindings: move LPASS clocks related bindings out of q6afe ASoC: dt-bindings: rename q6afe.h to q6dsp-lpass-ports.h ASoC: qdsp6: q6afe-dai: move lpass audio ports to common file ASoC: qdsp6: q6afe-clocks: move audio-clocks to common file ASoC: dt-bindings: q6dsp: add q6apm-lpass-dai compatible ASoC: dt-bindings: lpass-clocks: add q6prm clocks compatible ASoC: dt-bindings: add q6apm digital audio stream bindings ASoC: qdsp6: audioreach: add basic pkt alloc support ASoC: qdsp6: audioreach: add q6apm support ASoC: qdsp6: audioreach: add module configuration command helpers ASoC: qdsp6: audioreach: add topology support ASoC: qdsp6: audioreach: add q6apm-dai support ASoC: qdsp6: audioreach: add q6apm lpass dai support ASoC: qdsp6: audioreach: add q6prm support ASoC: qdsp6: audioreach: add support for q6prm-clocks .../devicetree/bindings/soc/qcom/qcom,apr.txt | 134 -- .../bindings/soc/qcom/qcom,apr.yaml | 169 +++ .../devicetree/bindings/sound/qcom,q6afe.txt | 181 --- .../bindings/sound/qcom,q6apm-dai.yaml | 50 + .../sound/qcom,q6dsp-lpass-clocks.yaml | 74 ++ .../sound/qcom,q6dsp-lpass-ports.yaml | 202 +++ drivers/soc/qcom/Kconfig | 8 + drivers/soc/qcom/apr.c | 289 +++- include/dt-bindings/soc/qcom,gpr.h | 18 + include/dt-bindings/sound/qcom,q6afe.h | 203 +-- .../sound/qcom,q6dsp-lpass-ports.h | 208 +++ include/linux/soc/qcom/apr.h | 70 +- include/uapi/sound/snd_ar_tokens.h | 203 +++ sound/soc/qcom/Kconfig | 22 + sound/soc/qcom/qdsp6/Makefile | 11 +- sound/soc/qcom/qdsp6/audioreach.c | 1170 +++++++++++++++++ sound/soc/qcom/qdsp6/audioreach.h | 692 ++++++++++ sound/soc/qcom/qdsp6/q6afe-clocks.c | 187 +-- sound/soc/qcom/qdsp6/q6afe-dai.c | 687 +--------- sound/soc/qcom/qdsp6/q6apm-dai.c | 504 +++++++ sound/soc/qcom/qdsp6/q6apm-lpass-dais.c | 266 ++++ sound/soc/qcom/qdsp6/q6apm.c | 916 +++++++++++++ sound/soc/qcom/qdsp6/q6apm.h | 154 +++ sound/soc/qcom/qdsp6/q6dsp-lpass-clocks.c | 186 +++ sound/soc/qcom/qdsp6/q6dsp-lpass-clocks.h | 30 + sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c | 627 +++++++++ sound/soc/qcom/qdsp6/q6dsp-lpass-ports.h | 22 + sound/soc/qcom/qdsp6/q6prm-clocks.c | 85 ++ sound/soc/qcom/qdsp6/q6prm.c | 256 ++++ sound/soc/qcom/qdsp6/q6prm.h | 78 ++ sound/soc/qcom/qdsp6/topology.c | 1118 ++++++++++++++++ 31 files changed, 7406 insertions(+), 1414 deletions(-) delete mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,apr.txt create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,apr.yaml create mode 100644 Documentation/devicetree/bindings/sound/qcom,q6apm-dai.yaml create mode 100644 Documentation/devicetree/bindings/sound/qcom,q6dsp-lpass-clocks.yaml create mode 100644 Documentation/devicetree/bindings/sound/qcom,q6dsp-lpass-ports.yaml create mode 100644 include/dt-bindings/soc/qcom,gpr.h create mode 100644 include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h create mode 100644 include/uapi/sound/snd_ar_tokens.h create mode 100644 sound/soc/qcom/qdsp6/audioreach.c create mode 100644 sound/soc/qcom/qdsp6/audioreach.h create mode 100644 sound/soc/qcom/qdsp6/q6apm-dai.c create mode 100644 sound/soc/qcom/qdsp6/q6apm-lpass-dais.c create mode 100644 sound/soc/qcom/qdsp6/q6apm.c create mode 100644 sound/soc/qcom/qdsp6/q6apm.h create mode 100644 sound/soc/qcom/qdsp6/q6dsp-lpass-clocks.c create mode 100644 sound/soc/qcom/qdsp6/q6dsp-lpass-clocks.h create mode 100644 sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c create mode 100644 sound/soc/qcom/qdsp6/q6dsp-lpass-ports.h create mode 100644 sound/soc/qcom/qdsp6/q6prm-clocks.c create mode 100644 sound/soc/qcom/qdsp6/q6prm.c create mode 100644 sound/soc/qcom/qdsp6/q6prm.h create mode 100644 sound/soc/qcom/qdsp6/topology.c -- 2.21.0