From patchwork Wed Oct 6 11:39:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 515305 Delivered-To: patch@linaro.org Received: by 2002:adf:fbc8:0:0:0:0:0 with SMTP id d8csp562998wrs; Wed, 6 Oct 2021 04:40:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfLQ2siFgQkK3qDTdQ1sCP3ZOQTF9um7sFSnguO/qm4jsPUi5FAdpP4urkF4xymyj8j534 X-Received: by 2002:a17:90b:14cc:: with SMTP id jz12mr3096547pjb.171.1633520410855; Wed, 06 Oct 2021 04:40:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633520410; cv=none; d=google.com; s=arc-20160816; b=I7mGIPQL1GMirz7UyAB3EvdSfBC6vbbhqVjw7XCemFGDBvQD2KRnXJLEYiHYV1hXNp LUybKYz/FJWykSPUDsBzL7ZSHGMU8xFDdflOHdsFSClxzpl9N6FOeC9EsPZMP+QfLxj+ uFPxOnOvsWKR+Wi7xbG1ZiY1IyiBRbnEOk7kmXeMDG+zl+/GQNPwZb7FEQrpsNqGdEwv epYizPN5pJh2MTaNv/gjefwJFwq4IcvMiOkzQWPdXUnigOSITgsUvFG6KYS5lbx0ZffC 9PZp57FqT4IUf/QO4yY+B6JRtFthLGcF3pys8e08AZcrpMr4LNOwDaYNByDFryaX0/54 KEdA== 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=VpQHh+t6NF9tkOFLPv9+Kz4YDCWXW0+ajSEShbkHaek=; b=WM71UcxdMAKW7FouckN2MFhKPjLT24A6zLHNz/VGWZsoqMBloJNYsM5O7QQfZmRRjN 6EfJELKEhJW63xIMjcnflSKmG33m9gxM8hjIY0KzL6+i7zg6jl7CyZAuqe35AqNVoJqm XsXIHM9E/nugyCCnURDUB38WBTaFlJ5u8t6KFqk+GEyzdHNppmxPs/ULpiz2a1iZEsON Rk8JdSCTfyTI+FDLtgzfTcmyyVL8TOvAtquzAYTdAdljwMWdo1Qm/D3oQhG/L4mU4qcG ChQKXe7Pz4nkdboFoIds39Xm8reVd6pSVA+J/akNbiLoGWE93kXhU39VoX1pVjkQKlpG mmwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YhQc8IhJ; 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 o22si32587717pfu.175.2021.10.06.04.40.09; Wed, 06 Oct 2021 04:40:10 -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=YhQc8IhJ; 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 S237982AbhJFLmA (ORCPT + 7 others); Wed, 6 Oct 2021 07:42:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237836AbhJFLl7 (ORCPT ); Wed, 6 Oct 2021 07:41:59 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C01E9C061749 for ; Wed, 6 Oct 2021 04:40:07 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id v17so7875795wrv.9 for ; Wed, 06 Oct 2021 04:40:07 -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=VpQHh+t6NF9tkOFLPv9+Kz4YDCWXW0+ajSEShbkHaek=; b=YhQc8IhJ11l0Y9JCk9COIpGB0vw6HFmIZJ/3uG+ndao893ngUUfPUHNNeeulKlT+I+ LTklTI/2LKG78KB56sSHNKIuYvAtB1HGV2k9591hA8gdvb/6H1LhlS1ooK7kEGrx9amu GnyOzPI9/267NE0bZVd9PTDZowiq63dWoc+Oe2+Z16iZOWMItCQN7MJ2+gPQuHpGSIXi ZeZ9ia7y1yS6n4Se3ENKTJK0f0Ut/iAjqYo8uN2zIWzIafntcnMaKzbePh/MP6jxWOYs LOA7SeoODqbBSwEUUpvHv63JKKs23KuQLpYc//AP7vzLKsRNHxlgnHuKoVXfkpEP0YIh Tnhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=VpQHh+t6NF9tkOFLPv9+Kz4YDCWXW0+ajSEShbkHaek=; b=jKVu66HxJ/ip5KqwTz9Hp17jwV6ckeq/iRnNOAt0YSk87iKK1tkuSDegbANTm/lVLI 8p5h+2RY/UGe1GXeBkqjN08nHOS4BxY7RYHN8dt3HERG2wur8tYbK2iAimGI6G2wDnw2 FmCm2g/XbQXhg/SLgKKV694XjlfJI4Z/je5jJoJe4J+wpRMvEpszS1FxolaA5N88r0DL 3ZoS5DiNmkDUB1+FmhD47FpRwVLEaSthW6wxQ5ZAgnx4ZjoBsMQktsupNfH/Edl/77HF jqDIKyWVvpCooxZnlZQjpqNpNUBBu84ImtlHZepCgEP5lcwz/vL/h4wsPyhzJg6G5drH lKuw== X-Gm-Message-State: AOAM531tRcEuk0y+OG9ck/+0lFigQNoqYy2SaO39RO/O25Ntw+yxI+De AGxcOwWh9GRN0Lfd0vb5+oDohg== X-Received: by 2002:a05:6000:1569:: with SMTP id 9mr29094161wrz.337.1633520406183; Wed, 06 Oct 2021 04:40:06 -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 n11sm5540110wmq.19.2021.10.06.04.40.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Oct 2021 04:40:05 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org, bjorn.andersson@linaro.org, robh@kernel.org Cc: plai@codeaurora.org, pierre-louis.bossart@linux.intel.com, 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 v9 00/17] ASoC: qcom: Add AudioReach support Date: Wed, 6 Oct 2021 12:39:33 +0100 Message-Id: <20211006113950.10782-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 Hi Mark, This version addresses all the comments raised as part of v8 review. QCOM SoC relevant non-audio patches in this series has been merged into the Qualcomm drivers-for-5.16 tree, as this series depends those patches an immutable tag is available at: https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git tags/20210927135559.738-6-srinivas.kandagatla@linaro.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 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/ and Qualcomm AudioReach DSP headers are available at: https://source.codeaurora.org/quic/la/platform/vendor/opensource/arspf-headers Note: There is one false positive warning in this patchset: audioreach.c:80:45: warning: array of flexible structures Thanks, srini Changes since v8: - made use of struct_size where possible. - fixed an incorrect indent. - adding __packed for consistency on structures that are passed to dsp. - rebased to sound-next branch. Srinivas Kandagatla (17): 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 Kconfig and Makefile 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/sound/qcom,q6afe.txt | 181 --- .../bindings/sound/qcom,q6apm-dai.yaml | 53 + .../sound/qcom,q6dsp-lpass-clocks.yaml | 77 ++ .../sound/qcom,q6dsp-lpass-ports.yaml | 205 +++ include/dt-bindings/sound/qcom,q6afe.h | 203 +-- .../sound/qcom,q6dsp-lpass-ports.h | 208 +++ include/uapi/sound/snd_ar_tokens.h | 208 +++ sound/soc/qcom/Kconfig | 22 + sound/soc/qcom/qdsp6/Makefile | 11 +- sound/soc/qcom/qdsp6/audioreach.c | 1130 +++++++++++++++++ sound/soc/qcom/qdsp6/audioreach.h | 726 +++++++++++ sound/soc/qcom/qdsp6/q6afe-clocks.c | 187 +-- sound/soc/qcom/qdsp6/q6afe-dai.c | 687 +--------- sound/soc/qcom/qdsp6/q6apm-dai.c | 416 ++++++ sound/soc/qcom/qdsp6/q6apm-lpass-dais.c | 260 ++++ sound/soc/qcom/qdsp6/q6apm.c | 822 ++++++++++++ sound/soc/qcom/qdsp6/q6apm.h | 152 +++ 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 | 202 +++ sound/soc/qcom/qdsp6/q6prm.h | 78 ++ sound/soc/qcom/qdsp6/topology.c | 1113 ++++++++++++++++ 25 files changed, 6664 insertions(+), 1227 deletions(-) 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/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