[alsa-devel] [PATCH 1/7 v2] ASoC: simple-card-utils: care endpoint reg for asoc_simple_card_get_dai_id()

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Thu Dec 13 02:35:38 CET 2018


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

commit b6f3fc005a2c8 ("ASoC: simple-card-utils: fixup
asoc_simple_card_get_dai_id() counting") fixuped getting DAI ID
method. But, we need to consider about endpoint case, too.
This patch fixup it.

For example) MIXer case

	DAI0 -+- CPU <--> Codec - DAI0
	DAI1 /

	/* CPU has 2 DAIs */
	CPU {
		port {
			cpu-ep0: endpint at 0 {
				reg = <0>; /* for DAI0 */
				remote-endpoint = <codec-ep0>;
			};
			cpu-ep1: endpint at 1 {
				reg = <1>; /* for DAI1 */
				remote-endpoint = <codec-ep1>;
			};
		};
	}

	/* Codec has 1 DAI */
	Codec {
		port {
			reg = <0>; /* both are for DAI0 */
			codec-ep0: endpint at 0 {
				remote-endpoint = <cpu-ep0>;
			};
			codec-ep1: endpint at 1 {
				remote-endpoint = <cpu-ep1>;
			};
		};
	}

Fixes: commit b6f3fc005a2c8 ("ASoC: simple-card-utils: fixup asoc_simple_card_get_dai_id() counting")
Reported-by: Tony Lindgren <tony at atomide.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
---
 sound/soc/generic/simple-card-utils.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index 17d8aee..fec3bf7 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -284,6 +284,9 @@ static int asoc_simple_card_get_dai_id(struct device_node *ep)
 	if (ret)
 		return -ENXIO;
 
+	if (info.id)
+		return info.id;
+
 	return info.port;
 }
 
-- 
2.7.4



More information about the Alsa-devel mailing list