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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>

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@0 {
				reg = <0>; /* for DAI0 */
				remote-endpoint = <codec-ep0>;
			};
			cpu-ep1: endpint@1 {
				reg = <1>; /* for DAI1 */
				remote-endpoint = <codec-ep1>;
			};
		};
	}

	/* Codec has 1 DAI */
	Codec {
		port {
			reg = <0>; /* both are for DAI0 */
			codec-ep0: endpint@0 {
				remote-endpoint = <cpu-ep0>;
			};
			codec-ep1: endpint@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@xxxxxxxxxxx>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
---
 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

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux