From patchwork Fri Feb 28 02:25:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 3737601 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C6209BF13A for ; Fri, 28 Feb 2014 02:25:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E685420225 for ; Fri, 28 Feb 2014 02:25:41 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 9AE3F201FE for ; Fri, 28 Feb 2014 02:25:40 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id A911A26590E; Fri, 28 Feb 2014 03:25:39 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NO_DNS_FOR_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 59166265901; Fri, 28 Feb 2014 03:25:35 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id E9C94265904; Fri, 28 Feb 2014 03:25:33 +0100 (CET) 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:message-id:from:subject:user-agent:to:cc:in-reply-to :references:mime-version:content-type; bh=DtS1IqJx7B7iuuIBv/nR1sjhTA8o7eU/y+HZhmjUwlM=; b=K9ugY1J3jDMaT/g9e/SPSQ4hFJrmuhdBKKBMFAz7hgqmSLvhOryZJqc5G1INfOJ8sY Hkn/gyQkF7cX8SMOdFp9WLxSUQQUKxL8Rbfietp4Z+kkUKboWfyv/xqXc43aawOLVMBa iQto5Eac8mB6uF5eY9CEqtL/2YTh2/vIK0YI5aW7oHjCdWIcBh78pqnT7s7YkmD+2xsB ljbPujj/sTD68GlEeinHmILNoJxxin+eTEhQj0d+nuXoQaKAI4HV/1mQFjwayCNj5BDQ UKKQaCX8bMBJUrwgnIVeMOVbmDngn94EaJYc1ltDbqnp3rn0p5cFlFRnRSgLXqN3pFsd 5nUQ== X-Received: by 10.68.132.233 with SMTP id ox9mr426249pbb.138.1393554325453; Thu, 27 Feb 2014 18:25:25 -0800 (PST) Received: from morimoto-Dell-XPS420.gmail.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPSA id ug9sm593143pbc.11.2014.02.27.18.25.23 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 27 Feb 2014 18:25:24 -0800 (PST) Date: Thu, 27 Feb 2014 18:25:24 -0800 (PST) Message-ID: <87ppm87z3i.wl%kuninori.morimoto.gx@gmail.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 To: Mark Brown In-Reply-To: <87ios0etzw.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") Cc: Linux-ALSA , Simon , Liam Girdwood , Kuninori Morimoto Subject: [alsa-devel] [PATCH v2] ASoC: simple-card: cpu_dai_name creates confusion when DT case X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" 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 X-Virus-Scanned: ClamAV using ClamSMTP 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; }