From patchwork Tue Sep 2 11:05:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 4824411 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AE91A9F2ED for ; Tue, 2 Sep 2014 11:08:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 98AAB201DD for ; Tue, 2 Sep 2014 11:08:43 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 1C326201BC for ; Tue, 2 Sep 2014 11:07:47 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id D3BCE2651FC; Tue, 2 Sep 2014 13:07:46 +0200 (CEST) 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 A926726546F; Tue, 2 Sep 2014 13:07:09 +0200 (CEST) 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 10E2E2654B5; Tue, 2 Sep 2014 13:07:09 +0200 (CEST) Received: from mail-pd0-f180.google.com (mail-pd0-f180.google.com [209.85.192.180]) by alsa0.perex.cz (Postfix) with ESMTP id CB0712651DB for ; Tue, 2 Sep 2014 13:05:34 +0200 (CEST) Received: by mail-pd0-f180.google.com with SMTP id p10so8315028pdj.11 for ; Tue, 02 Sep 2014 04:05:32 -0700 (PDT) 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=loV/yUazjCKRifoIrNNNYnztE/vwbbVV0FCuGCKepaQ=; b=qwGivN8GqCVhB2kGC0CPG6Btw6qKCQyqHCiecU1WsW+Keh8hQuCSWxBxZhnMiSSX5L iAq+ucNU7vjWEhAatZK5NQnJCHlWeseWQmPTrSe8M4tLHw8eiX8nhc8eaag61lYhl/RR h3vA2nO7qeqrCQEksXMgjqE/5GM/cSBHiodCQRPpX5CBampJzRrI41IMF7WaMcG7ab2N SpMHg98Q+E2UEVG0NTQuDUaSs0Bru0TMuSbP3whj3Tvpw725T5HUOp5TVMnThxoA475d TE5q0/XtAEKW0D44Wu7C3fjs4SGVWFrT4khUwFicHFtYX3Bto7Yei3/zgyfF/E6djyU9 aU7A== X-Received: by 10.70.43.229 with SMTP id z5mr3941237pdl.150.1409655931118; Tue, 02 Sep 2014 04:05:31 -0700 (PDT) Received: from remon.gmail.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPSA id sp2sm3686320pbc.23.2014.09.02.04.05.29 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 02 Sep 2014 04:05:30 -0700 (PDT) Date: Tue, 02 Sep 2014 04:05:30 -0700 (PDT) Message-ID: <877g1mjn9i.wl%kuninori.morimoto.gx@gmail.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 To: Jean-Francois Moine , Mark Brown In-Reply-To: <878um2jncd.wl%kuninori.morimoto.gx@gmail.com> References: <20140902090005.4a2c80b2@armhf> <878um2jncd.wl%kuninori.morimoto.gx@gmail.com> MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Cc: Linux-ALSA , Lars-Peter Clausen Subject: [alsa-devel] [PATCH][RFC] ASoC: simple-card: fixup cpu_dai_name clear 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 f687d900d30a61dda38db2a99239f5284a86a309 (ASoC: simple-card: cpu_dai_name creates confusion when DT case) cleared cpu_dai_name for caring fmt_single_name case, and 179949bc04c7157a4b2279f62a842638b61f78f9 (ASoC: simple-card: remove dai_link->cpu_dai_name when DT) cared multi dai-link case. but, cpu_dai_name matching is required when fmt_multiple_name was used Signed-off-by: Kuninori Morimoto Tested-by: Jean-Francois Moine --- >> Jean Can you please test this patch ? Is your issue solved ? sound/soc/generic/simple-card.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index fd8b045..b63860d 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -112,8 +112,10 @@ static int asoc_simple_card_sub_parse_of(struct device_node *np, struct asoc_simple_dai *dai, struct device_node **p_node, - const char **name) + const char **name, + int *args_count) { + struct of_phandle_args args; struct device_node *node; struct clk *clk; u32 val; @@ -123,10 +125,15 @@ asoc_simple_card_sub_parse_of(struct device_node *np, * get node via "sound-dai = <&phandle port>" * it will be used as xxx_of_node on soc_bind_dai_link() */ - node = of_parse_phandle(np, "sound-dai", 0); - if (!node) - return -ENODEV; - *p_node = node; + ret = of_parse_phandle_with_args(np, "sound-dai", + "#sound-dai-cells", 0, &args); + if (ret) + return ret; + + *p_node = args.np; + + if (args_count) + *args_count = args.args_count; /* get dai->name */ ret = snd_soc_of_get_dai_name(np, name); @@ -176,7 +183,7 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, char *name; char prop[128]; char *prefix = ""; - int ret; + int ret, cpu_args; if (is_top_level_node) prefix = "simple-audio-card,"; @@ -195,7 +202,8 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, ret = asoc_simple_card_sub_parse_of(np, &dai_props->cpu_dai, &dai_link->cpu_of_node, - &dai_link->cpu_dai_name); + &dai_link->cpu_dai_name, + &cpu_args); if (ret < 0) goto dai_link_of_err; @@ -226,7 +234,7 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, ret = asoc_simple_card_sub_parse_of(np, &dai_props->codec_dai, &dai_link->codec_of_node, - &dai_link->codec_dai_name); + &dai_link->codec_dai_name, NULL); if (ret < 0) goto dai_link_of_err; @@ -290,12 +298,13 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, * 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. + * remove cpu_dai_name if cpu_args was 0. * see * fmt_single_name() * fmt_multiple_name() */ - dai_link->cpu_dai_name = NULL; + if (!cpu_args) + dai_link->cpu_dai_name = NULL; dai_link_of_err: if (np)