From patchwork Tue Jun 22 01:13:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 465940 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=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS autolearn=ham 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 F3B39C48BC2 for ; Tue, 22 Jun 2021 01:14:49 +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 CEBEE60C41 for ; Tue, 22 Jun 2021 01:14:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CEBEE60C41 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=renesas.com 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 DCC8E826; Tue, 22 Jun 2021 03:13:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DCC8E826 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1624324486; bh=/9g1S9gN+STWA+RaRQUAjK398mmxpOqKtNhwsf6vFD0=; h=Date:From:Subject:To:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=M1FolAv62F3QS0RRN716pGzKNuDbsTiyrv4oUP4wH5tnDhVGgJsGDlZ75p0LRgj1i dkeCE+VTFPDDRowM2l2xYqT1qDrEkuhd7zQe21oBk8X27KKfDaziGdVwRm0Y2H8v7p vkBUuxBnu60Uq/N47AZEFRnZeAxyhaXtt924Vztw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 70F02F80163; Tue, 22 Jun 2021 03:13:56 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 729F1F8016B; Tue, 22 Jun 2021 03:13:55 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id 1AE86F80163 for ; Tue, 22 Jun 2021 03:13:51 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1AE86F80163 Date: 22 Jun 2021 10:13:49 +0900 X-IronPort-AV: E=Sophos;i="5.83,290,1616425200"; d="scan'208";a="85109177" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 22 Jun 2021 10:13:49 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 1E974400D0C5; Tue, 22 Jun 2021 10:13:49 +0900 (JST) Message-ID: <871r8u4s6q.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH RFC 00/15] ASoC: add Audio Graph Card2 driver User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown , Rob Herring MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA 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" Hi Mark, Rob We already have Audio-Graph-Card which is Of-Graph base general sound card driver. Basically it supports basic CPU-Codec connection, and is also supporting DPCM connection. Because it was forcibly expanded to DPCM, DT parsing is very limited and very difficult to add new features on it, for example Multi CPU/Codec support, Codec2Codec support, etc. And some users want to use Audio-Graph-Card as basic connection and expand its own settings on it. This patch adds more flexible new Audio-Graph-Card2 driver for it. Audio-Graph-Card and Audio-Graph-Card2 are similar, but don't have full compatibility. Audio-Graph-Card2 supports Normal Connection, DPCM Connection, Multi CPU/Codec Connection, Codec2Codec Connection, and possible to Customizing. This patch-set adds Audio-Graph-Card2 driver and customized driver sample, and DT settings sample which can be used for testing. To enable testing/debuging, this patch-set also adds Test-Component driver. We already have Dummy Component and/or Dummy DAI on soc-utils, but 1) we can't use it from DT, 2) it do nothing. Added new Test-Component can be used from DT, and it indicates called function name. We can use it to trace callback order / understanding ALSA SoC behavior, etc. Sample DT settings which can be used for testing is using Test-Component. This patch set includes sample DT for custome driver and/or audio-graph-card2. You can easily try to use/test it if you added below line to your DT file. It needs below CONFIGs. It will probe sample Sound Card which has Normal/DPCM/Multi/Codec2Codec connections. #include "../../../../../sound/soc/generic/audio-graph-card2-sample.dtsi" CONFIG_SND_AUDIO_GRAPH_CARD2 CONFIG_SND_SAMPLE_CUSTOM_CARD CONFIG_SND_TEST_COMPONENT There are some notes. Because Audio Graph Card2 is still under experimental stage, it will indicate such warning when probing, and the DT might be updated/exchanged. It can use Codec2Codec, but it will start automatically when probed, and can't stop it so far. It should be updated. 1 : add Of-Graph *port base* loop which is used at Audio-Graph-Card2 2 - 3 : add Test-Component driver 4 - 10 : add Audio-Graph-Card2 driver 11 : add Audio-Graph-Card2 base custome driver sample 12 - 15 : Audio-Graph-Card2 driver / custome driver DT sample Link: https://lore.kernel.org/r/87k0xszlep.wl-kuninori.morimoto.gx@renesas.com Kuninori Morimoto (15): 1 of: property: add port base loop 2 ASoC: dt-bindings: test-component: add Test Component YAML bindings 3 ASoC: test-component: add Test Component for Sound debug/test 4 ASoC: simple-card-utils: add asoc_graph_is_ports0() 5 ASoC: simple-card-utils: add codec2codec support 6 ASoC: audio-graph-card2: add Audio Graph Card2 driver 7 ASoC: audio-graph-card2: add DPCM support 8 ASoC: audio-graph-card2: add Multi CPU/Codec support 9 ASoC: audio-graph-card2: add Codec2Codec support 10 ASoC: audio-graph-card2: add Yaml Document 11 ASoC: sample-custom-card: add Audio Graph Card2 custome sample 12 ASoC: audio-graph-card2-sample.dtsi: add Sample DT for Audio Graph Card2 13 ASoC: audio-graph-card2-sample.dtsi: add DPCM sample 14 ASoC: audio-graph-card2-sample.dtsi: add Multi CPU/Codec sample 15 ASoC: audio-graph-card2-sample.dtsi: add Codec2Codec sample. .../sound/audio-graph-card2-items.yaml | 36 + .../bindings/sound/audio-graph-card2.yaml | 45 + .../bindings/sound/audio-graph-port2.yaml | 74 + .../bindings/sound/test-component.yaml | 33 + drivers/of/property.c | 69 +- include/linux/of_graph.h | 14 + include/sound/graph_card.h | 24 + include/sound/simple_card_utils.h | 4 + sound/soc/generic/Kconfig | 20 + sound/soc/generic/Makefile | 6 + .../soc/generic/audio-graph-card2-sample.dtsi | 140 ++ sound/soc/generic/audio-graph-card2.c | 1253 +++++++++++++++++ sound/soc/generic/sample-custom-card.c | 160 +++ sound/soc/generic/simple-card-utils.c | 46 +- sound/soc/generic/test-component.c | 659 +++++++++ 15 files changed, 2572 insertions(+), 11 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/audio-graph-card2-items.yaml create mode 100644 Documentation/devicetree/bindings/sound/audio-graph-card2.yaml create mode 100644 Documentation/devicetree/bindings/sound/audio-graph-port2.yaml create mode 100644 Documentation/devicetree/bindings/sound/test-component.yaml create mode 100644 sound/soc/generic/audio-graph-card2-sample.dtsi create mode 100644 sound/soc/generic/audio-graph-card2.c create mode 100644 sound/soc/generic/sample-custom-card.c create mode 100644 sound/soc/generic/test-component.c