[PATCH 3/3] ASoC: audio-graph-scu-card: use asoc_simple_card_of_canonicalize_cpu()

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

 



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

snd_soc_find_dai() will check dai_name after of_node matching
if dai_link has it. but, it will never match if name was
created by fmt_single_name(). Thus, we need to remove cpu_dai_name
if cpu was single.

Before, simple-card assumed that CPU was single if Card has single
link. It is no problem in below case

/* Card uses 1 link */
card {
	compatible = "audio-graph-card";
	...
	dais = <&cpu_port0>;
};

/* CPU has single endpoints */
cpu {
	...
	cpu_port0: port@0 {
		endpoint { ... };
	};
};

But it can't handle correctly below case.
This patch uses new asoc_simple_card_of_canonicalize_cpu() and
confirm it was single or not by counting endpoint.

/* Card uses only 1 link */
card {
	compatible = "audio-graph-card";
	...
	dais = <&cpu_port0>;
};

/* CPU has many endpoints */
cpu {
	...
	ports {
		cpu_port0: port@0 {
			endpoint { ... };
		};
		cpu_port1: port@1 {
			endpoint { ... };
		};
		...
	};
};

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
---
 sound/soc/generic/audio-graph-scu-card.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sound/soc/generic/audio-graph-scu-card.c b/sound/soc/generic/audio-graph-scu-card.c
index 05934b2..bd924b1 100644
--- a/sound/soc/generic/audio-graph-scu-card.c
+++ b/sound/soc/generic/audio-graph-scu-card.c
@@ -123,9 +123,7 @@ static int asoc_graph_card_dai_link_of(struct device_node *ep,
 		if (ret < 0)
 			return ret;
 
-		/* card->num_links includes Codec */
-		asoc_simple_card_canonicalize_cpu(dai_link,
-					(card->num_links - 1) == 1);
+		asoc_simple_card_of_canonicalize_cpu(dai_link);
 	} else {
 		/* FE is dummy */
 		dai_link->cpu_of_node		= NULL;
-- 
1.9.1




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux