From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kuninori Morimoto Subject: [PATCH v2] ASoC: simple-card: cpu_dai_name creates confusion when DT case Date: Thu, 27 Feb 2014 18:25:24 -0800 (PST) Message-ID: <87ppm87z3i.wl%kuninori.morimoto.gx@gmail.com> References: <87eh2r9169.wl%kuninori.morimoto.gx@gmail.com> <20140227050726.GR9383@sirena.org.uk> <87ios0etzw.wl%kuninori.morimoto.gx@gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-pb0-f51.google.com (mail-pb0-f51.google.com [209.85.160.51]) by alsa0.perex.cz (Postfix) with ESMTP id AC793265900 for ; Fri, 28 Feb 2014 03:25:26 +0100 (CET) Received: by mail-pb0-f51.google.com with SMTP id un15so102570pbc.38 for ; Thu, 27 Feb 2014 18:25:25 -0800 (PST) In-Reply-To: <87ios0etzw.wl%kuninori.morimoto.gx@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Mark Brown Cc: Linux-ALSA , Simon , Liam Girdwood , Kuninori Morimoto List-Id: alsa-devel@alsa-project.org From: Kuninori Morimoto Basically, soc_bind_dai_link() checks cpu_dai->dev->of_node and dai_link->cpu_of_node in DT case. But after that it will check cpu_dai->name and dai_link->cpu_dai_name too. On the other hand, snd_soc_dai :: name is created by fmt_single_name() or fmt_multiple_name(). There is no confusion if dai name is created by fmt_multiple_name(), since cpu_dai->name is same as dai_link->cpu_dai_name. but, if dai name is created by fmt_single_name(), CPU DAI never match. Thus, simple-card not set dai_link->cpu_dai_name if DT case to skip naming match on soc_bind_dai_link() Signed-off-by: Kuninori Morimoto --- v1 -> v2 - for latest mark/topic/simple branch sound/soc/generic/simple-card.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index bdd176d..034a2b7 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -234,6 +234,17 @@ static int asoc_simple_card_parse_of(struct device_node *node, priv->codec_dai.fmt, priv->codec_dai.sysclk); + /* + * soc_bind_dai_link() will check cpu name + * after of_node matching if dai_link has cpu_dai_name. + * but, it will never match if name was created by fmt_single_name() + * remove cpu_dai_name to escape name matching. + * see + * fmt_single_name() + * fmt_multiple_name() + */ + dai_link->cpu_dai_name = NULL; + return 0; } -- 1.7.9.5