From patchwork Tue Jul 20 01:41:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 12387275 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=-13.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 3B1E0C07E95 for ; Tue, 20 Jul 2021 01:44:29 +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 9E9926101E for ; Tue, 20 Jul 2021 01:44:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9E9926101E 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 38EFA165D; Tue, 20 Jul 2021 03:43:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 38EFA165D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1626745467; bh=KR/8ZrfmrPFXYl7mjVmSK7VrUotsVWa2YfW2a1q65u0=; h=Date:From:Subject:To:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=euN+GbnItjw95eLSefuLAUGzqQ8rBw3/UORFOQlm4ej9zRuUyagglHLOAezALqfEo M8YnHrTJbPxRJk803QhoF1Op+DvmmmpUtXtd/bUzqQW/AX6eQWY+QZPquOkK5Z+yDx Dq4QfaBWElDF/+wP5HHvZ7WJrExeLulTxt5v2MRc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 62FAFF804E2; Tue, 20 Jul 2021 03:41:28 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8F876F8051A; Tue, 20 Jul 2021 03:41:27 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id 4B997F80256 for ; Tue, 20 Jul 2021 03:41:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4B997F80256 Date: 20 Jul 2021 10:41:23 +0900 X-IronPort-AV: E=Sophos;i="5.84,253,1620658800"; d="scan'208";a="88181676" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 20 Jul 2021 10:41:23 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 094C84153E8B; Tue, 20 Jul 2021 10:41:23 +0900 (JST) Message-ID: <87tukpvk1o.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 11/14] ASoC: audio-graph-card2-sample.dtsi: add Sample DT for Audio Graph Card2 User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87a6mhwyqn.wl-kuninori.morimoto.gx@renesas.com> References: <87a6mhwyqn.wl-kuninori.morimoto.gx@renesas.com> 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" From: Kuninori Morimoto Audio Graph Card2 settings is a little bit difficult for beginner, and Customizing it also difficult/confusable too. So, this patch adds sample for it. You can easily use it by adding below line on your DT file, and select CONFIGs to your .config. #include "../../../../../sound/soc/generic/audio-graph-card2-sample.dtsi" CONFIG_SND_AUDIO_GRAPH_CARD2 CONFIG_SND_SAMPLE_CUSTOM_CARD CONFIG_SND_TEST_COMPONENT This patch uses audio-graph-card2 base sample custom driver. You can directly use audio-graph-card2 instead of custom driver by modifing compatible. - compatible = "sample-custom-card"; + compatible = "audio-graph-card2"; Sample custom driver will indicate customized print. Previous "audio-graph-card" and new "audio-graph-card2" doesn't have full compatibility. The differenct from audio-graph-card are - audio-graph-card2 uses "links" instead of "dais". - audio-graph-card2 uses flags for bitclock/frame-master instead of phandle. - audio-graph-card2 uses .get_fmt instead of having "format" It is using Test-Component driver for CPU/Codec. It can indicate more detail print of each behavior if user want to. In such case, you need to update compatible to "xxx-nv" or "xxx-vv". - compatible = "test-cpu"; + compatible = "test-cpu-nv"; Signed-off-by: Kuninori Morimoto --- .../soc/generic/audio-graph-card2-sample.dtsi | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 sound/soc/generic/audio-graph-card2-sample.dtsi diff --git a/sound/soc/generic/audio-graph-card2-sample.dtsi b/sound/soc/generic/audio-graph-card2-sample.dtsi new file mode 100644 index 000000000000..5e83bfed1781 --- /dev/null +++ b/sound/soc/generic/audio-graph-card2-sample.dtsi @@ -0,0 +1,68 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * audio-graph-card2-sample dtsi + * + * + * This sample indicates how to use audio-graph-card2 and its + * custom driver. "sample-custom-card" is the custome driver + * which is using audio-graph-card2. + * + * You can easily use this sample by adding below line on your DT file, + * and add new CONFIG to your .config. + * + * #include "../../../../../sound/soc/generic/audio-graph-card2-sample.dtsi" + * + * CONFIG_SND_AUDIO_GRAPH_CARD2 + * CONFIG_SND_SAMPLE_CUSTOM_CARD + * CONFIG_SND_TEST_COMPONENT + */ +/ { + /* + * cpu0 <--> codec0 // Normal + * cpu1 <--> codec1 // Normal + */ + card2 { + /* + * You can use audio-graph-card2 directly + * by using + * + * compatible = "audio-graph-card2"; + */ + compatible = "sample-custom-card"; + + links = <&cpu0 &cpu1 /* normal: cpu side only */ + >; + }; + + test_cpu { + /* + * update compatible to indicate more detail behaviour + * if you want. see test-compatible for more detail. + * + * - compatible = "test-cpu"; + * + compatible = "test-cpu-nv"; + */ + compatible = "test-cpu"; + ports { + bitclock-master; + frame-master; + cpu0: port@0 { cpu0_ep: endpoint { remote-endpoint = <&codec0_ep>; }; }; + cpu1: port@1 { cpu1_ep: endpoint { remote-endpoint = <&codec1_ep>; }; }; + }; + }; + + test_codec { + /* + * update compatible to indicate more detail behaviour + * if you want. see test-compatible for more detail. + * + * - compatible = "test-codec"; + * + compatible = "test-codec-nv"; + */ + compatible = "test-codec"; + ports { + port@0 { codec0_ep: endpoint { remote-endpoint = <&cpu0_ep>; }; }; + port@1 { codec1_ep: endpoint { remote-endpoint = <&cpu1_ep>; }; }; + }; + }; +};