[PATCH 3/3] ASoC: audio-graph-card2: check also dpcm node for convert-xxx

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Tue Nov 1 05:22:27 CET 2022


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

DPCM connection on Card2, its DT looks like below.
Current Card2 is checking (a)/(b) part only for convert-xxx settings.
But it is not useful. This patch enables its settings at (A)/(B) part
too. (A)/(B) settings will be overwritten (a)/(b) settings if it has.

<Image>		      (A)	(a)
	Card2 <--+--> FE <---> CPU
		 |
		 +--> BE <---> Codec
		      (B)	(b)

<DT>
	card2-sound {
		...
		links = <fe, be>; /* (A) (B) */
	};

	dpcm {
		/* FE */
		ports at 0 {
			/* (A) */
			fe: port { fe_ep: endpoint { remote-endpoint = <&cpu_ep>; } };
		};
		/* BE */
		ports at 1 {
			/* (B) */
			be: port {
				convert-rate = <44100>; /* This patch enables this */
				be_ep: endpoint { remote-endpoint = <&codec_ep>; }
			};
		};
	};

	cpu {
		/* CPU (a) */
		port { cpu_ep: endpoint { remote-endpoint = <&fe_ep>; } };
	};

	codec {
		/* Codec (b) */
		port {
			convert-rate = <48000>; /* (B) settings will be over written here */
			codec_ep: endpoint { remote-endpoint = <&be_ep>; }
		};
	};

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
---
 sound/soc/generic/audio-graph-card2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c
index 8ac6df645ee6..e34c3433d354 100644
--- a/sound/soc/generic/audio-graph-card2.c
+++ b/sound/soc/generic/audio-graph-card2.c
@@ -849,7 +849,8 @@ int audio_graph2_link_dpcm(struct asoc_simple_priv *priv,
 			goto err;
 	}
 
-	graph_parse_convert(rep, dai_props);
+	graph_parse_convert(ep,  dai_props); /* at node of <dpcm> */
+	graph_parse_convert(rep, dai_props); /* at node of <CPU/Codec> */
 
 	snd_soc_dai_link_set_capabilities(dai_link);
 
-- 
2.25.1



More information about the Alsa-devel mailing list