From patchwork Mon Jun 7 15:28:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 12303889 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61F84C47094 for ; Mon, 7 Jun 2021 15:31:55 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8494560FF1 for ; Mon, 7 Jun 2021 15:31:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8494560FF1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 1F5EF1690; Mon, 7 Jun 2021 17:31:03 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1F5EF1690 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1623079913; bh=tqlPsUUOIHKEEVPiksirtoodebg2WiTJdExh5gICAU8=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=smwV9BKnFymV5m/8ZJHCCWnnwSy5dKBLchnr02ZGQy4zMANngrzRbgy6k+0mijHt/ 8o7XF9Jr8SfKWed3AXqHbtvSS0y3lfiqg+sIA1tItKVJHlMgfYnCYW6QNb6H3tcizB mSciUHJAIeWE4gf7p/QHkuGaMr483UzavQ84B+fs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B4E70F804C1; Mon, 7 Jun 2021 17:30:08 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id F130FF804CB; Mon, 7 Jun 2021 17:29:20 +0200 (CEST) Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id DE606F800AF for ; Mon, 7 Jun 2021 17:29:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DE606F800AF Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="nMKso3FM" Received: by mail-wm1-x32b.google.com with SMTP id f17so10322649wmf.2 for ; Mon, 07 Jun 2021 08:29:05 -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=lu0+KN3VOZ/V1bkXfNJtnZbJ/bz+C8eQ2Jc1lezs7/75F3ssDT3nbRJRQs8sJc39rU IWHgtq9J6dVFRprCOv50QuP+XOl234WU1p+nxbMSksGzenT27LEJ81JWi4CnGrAxBkd6 UF2AH8qSlNiYTW/h/yVCP/dYi2+6duAJ4dbz4d46rb8zJPxas8sDRK37vfb2V7sU2gSv efbQVuJ556d4RRnB0SS7kTTtKO98uHCsMp8ajQToA5H7cOiylwy45Ml2HQ+3VsytzNLx bDWwEmHDKZ9GlhHv6PrrWC8W3NIIxIpiPMpHaFs7lVyMIGC2eu/ARl38r56yuejt4bU0 U36w== X-Gm-Message-State: AOAM531M9Og5ZBcYzhvKoys2pt0KNmERUyovnia/exeN12Die4AgPWSR zjVCUcyPnNvm+lbnjQEML+l/Aw== X-Google-Smtp-Source: ABdhPJxelM/QH7inYspnHoMLYLDbqxeuvm6+AOcdZUrk/uvppwrSz4H2RTVphX+KnCvHPmpiUGZ3Aw== 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 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 Cc: robh@kernel.org, alsa-devel@alsa-project.org, bgoswami@codeaurora.org, devicetree@vger.kernel.org, tiwai@suse.de, lgirdwood@gmail.com, plai@codeaurora.org, linux-kernel@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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