All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>
Subject: [PATCH v2 11/14] ASoC: audio-graph-card2-sample.dtsi: add Sample DT for Audio Graph Card2
Date: 20 Jul 2021 10:41:23 +0900	[thread overview]
Message-ID: <87tukpvk1o.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <87a6mhwyqn.wl-kuninori.morimoto.gx@renesas.com>

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

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 <kuninori.morimoto.gx@renesas.com>
---
 .../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>; }; };
+		};
+	};
+};
-- 
2.25.1


  parent reply	other threads:[~2021-07-20  1:44 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-20  1:38 [PATCH v2 00/14] ASoC: add Audio Graph Card2 driver Kuninori Morimoto
2021-07-20  1:39 ` [PATCH v2 01/14] ASoC: test-component: add Test Component YAML bindings Kuninori Morimoto
2021-07-20  1:39   ` Kuninori Morimoto
2021-07-20  1:39 ` [PATCH v2 02/14] ASoC: test-component: add Test Component for Sound debug/test Kuninori Morimoto
2021-08-03 17:08   ` Mark Brown
2021-08-03 23:55     ` Kuninori Morimoto
2021-08-04 17:37       ` Mark Brown
2021-07-20  1:39 ` [PATCH v2 03/14] ASoC: simple-card-utils: add asoc_graph_is_ports0() Kuninori Morimoto
2021-07-20  1:40 ` [PATCH v2 04/14] ASoC: simple-card-utils: add codec2codec support Kuninori Morimoto
2021-07-20  1:40 ` [PATCH v2 05/14] ASoC: audio-graph-card2: add Audio Graph Card2 driver Kuninori Morimoto
2021-07-20  1:40 ` [PATCH v2 06/14] ASoC: audio-graph-card2: add DPCM support Kuninori Morimoto
2021-07-20  1:40 ` [PATCH v2 07/14] ASoC: audio-graph-card2: add Multi CPU/Codec support Kuninori Morimoto
2021-07-20  1:40 ` [PATCH v2 08/14] ASoC: audio-graph-card2: add Codec2Codec support Kuninori Morimoto
2021-07-20  1:41 ` [PATCH v2 09/14] ASoC: audio-graph-card2: add Yaml Document Kuninori Morimoto
2021-07-20  1:41   ` Kuninori Morimoto
2021-07-20 13:11   ` Rob Herring
2021-07-20 13:11     ` Rob Herring
2021-07-20 15:12   ` Rob Herring
2021-07-20 15:12     ` Rob Herring
2021-07-20 23:32     ` Kuninori Morimoto
2021-07-20 23:32       ` Kuninori Morimoto
2021-07-21 11:54       ` Mark Brown
2021-07-26  2:19         ` Kuninori Morimoto
2021-08-03 16:53           ` Mark Brown
2021-08-04  0:49             ` Kuninori Morimoto
2021-08-04 17:17               ` Mark Brown
2021-08-04 23:47                 ` Kuninori Morimoto
2021-08-04 23:51                   ` Kuninori Morimoto
2021-08-05 12:52                     ` Mark Brown
2021-08-13 19:43                   ` Mark Brown
2021-08-16  4:33                     ` Kuninori Morimoto
2021-07-20  1:41 ` [PATCH v2 10/14] ASoC: sample-custom-card: add Audio Graph Card2 custome sample Kuninori Morimoto
2021-07-20  1:41 ` Kuninori Morimoto [this message]
2021-07-20  1:41 ` [PATCH v2 12/14] ASoC: audio-graph-card2-sample.dtsi: add DPCM sample Kuninori Morimoto
2021-07-20  1:41 ` [PATCH v2 13/14] ASoC: audio-graph-card2-sample.dtsi: add Multi CPU/Codec sample Kuninori Morimoto
2021-07-20  1:41 ` [PATCH v2 14/14] ASoC: audio-graph-card2-sample.dtsi: add Codec2Codec sample Kuninori Morimoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tukpvk1o.wl-kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.