diff mbox series

[v3,11/16] ASoC: rich-graph-card-sample.dtsi: add Sample DT for Normal (Single)

Message ID 87ee9xusus.wl-kuninori.morimoto.gx@renesas.com (mailing list archive)
State New, archived
Headers show
Series ASoC: Add Rich Graph Card support | expand

Commit Message

Kuninori Morimoto Sept. 10, 2021, 1:22 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Rich Graph Card 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/rich-graph-card-sample.dtsi"

	CONFIG_SND_RICH_GRAPH_CARD
	CONFIG_SND_RICH_CUSTOM_CARD_SAMPLE
	CONFIG_SND_TEST_COMPONENT

This patch uses rich-graph-card base sample custom driver.
You can directly use rich-graph-card instead of custom driver
by modifing compatible.

	- compatible = "rich-custom-card-sample";
	+ compatible = "rich-graph-card";

Sample custom driver will indicate customized print.

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>
---
 sound/soc/generic/rich-graph-card-sample.dtsi | 69 +++++++++++++++++++
 1 file changed, 69 insertions(+)
 create mode 100644 sound/soc/generic/rich-graph-card-sample.dtsi
diff mbox series

Patch

diff --git a/sound/soc/generic/rich-graph-card-sample.dtsi b/sound/soc/generic/rich-graph-card-sample.dtsi
new file mode 100644
index 000000000000..0b4fc71f581d
--- /dev/null
+++ b/sound/soc/generic/rich-graph-card-sample.dtsi
@@ -0,0 +1,69 @@ 
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * rich-graph-card-sample.dtsi
+ *
+ * Copyright (C) 2020 Renesas Electronics Corp.
+ * Copyright (C) 2020 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+ *
+ * This sample indicates how to use rich-graph-card and its
+ * custom driver. "rich-custom-card-sample" is the custome driver
+ * which is using rich-graph-card.
+ *
+ * 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/rich-graph-card-sample.dtsi"
+ *
+ *	CONFIG_SND_RICH_GRAPH_CARD
+ *	CONFIG_SND_RICH_CUSTOM_CARD_SAMPLE
+ *	CONFIG_SND_TEST_COMPONENT
+ */
+/ {
+	/*
+	 * @ : used at links
+	 *
+	 * [Normal]
+	 *	cpu0 <-@-----------------> codec0
+	 */
+	rich-graph-card-sample {
+		/*
+		 * You can use rich-graph-card directly by using
+		 *
+		 * compatible = "rich-graph-card";
+		 */
+		compatible = "rich-custom-card-sample";
+
+		links = <&cpu0			/* 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>; }; };
+		};
+	};
+
+	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>; }; };
+		};
+	};
+};