Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2393000ybt; Sun, 28 Jun 2020 18:25:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZgGMZWKGm0chmutgrov46gpJJsCR1oe5rMpdtQvY1waqBPDy1HcRK+CX4HRki8nECJHmN X-Received: by 2002:a17:906:8595:: with SMTP id v21mr12340006ejx.333.1593393951897; Sun, 28 Jun 2020 18:25:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593393951; cv=none; d=google.com; s=arc-20160816; b=MEZbKbZ3rZER3Oj4pWayF9PDyzJh80L2jTq88h+o41ZhDT6LcpjwwrtDo+p5w1mqdd jJarlG8rYHG/u5LXAsPYyWXJ9wZw3tcw1unjRDbKAM/2AFBQ2cA4LIRHbckS+AQBS/1Y go9bxkhvhE+k86H0xUYboj/zYhYDtfWj3nugvfp8cA4FmqBDBRJVhYobK4y+92GSVIyk PBPVcTKsnXfhbozhRsfQYbhuQMtxoEKQbh4oWbeS8J25s1/KByu9VWY6J/bimRe5flrn ZQx+CN86pFtQzMrmKcsU51dQeEoDo7AExsMUsCSBSaUAVhA6Ljd/hSJRLQIs9bzd7Od9 KaRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date; bh=or3EEx5L2LB7dfmqY0Eyh8THWZHl8M2scXuf6hdUXVQ=; b=CkboE+oBtBy+CQ/1HkB4RJZovbpMQCEslXAm4JAUbN4e+K65lXo4kWqXN9cAv7Aegp 07CAchc8HnAyA86fRd861NalckwI+ThGffA5eh0DmgP8l2StOGJRDDY6RplnjRrXBPdt r71WHb1o5a+Ik1lUvmjLT+UJgLE13NNMswj7MXiwLQ6Yhc3qZSU6308HsRAc6uBEEsAj Q3bk6WARAtiM62RBkj3wpw/SkRVQzdXpufMyDbWIhIjMSu1u2c8veHni/XRsFkGltXpZ 0GSrl6ix73DDZiYQHWrJee27kllUAGp0Hvw8poRCV8vm2gQvq6EfHFtYtmv5AWxJJOCW RiIw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f15si12483593edt.552.2020.06.28.18.25.28; Sun, 28 Jun 2020 18:25:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726718AbgF2BYj (ORCPT + 99 others); Sun, 28 Jun 2020 21:24:39 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:60741 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726395AbgF2BYi (ORCPT ); Sun, 28 Jun 2020 21:24:38 -0400 Date: 29 Jun 2020 10:24:37 +0900 X-IronPort-AV: E=Sophos;i="5.75,293,1589209200"; d="scan'208";a="50573471" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 29 Jun 2020 10:24:37 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id EB6F44142EEB; Mon, 29 Jun 2020 10:24:36 +0900 (JST) Message-ID: <874kqu1x70.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: Sameer Pujar Cc: , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v4 12/23] ASoC: simple-card: Support DPCM DAI link with multiple Codecs In-Reply-To: <1593233625-14961-13-git-send-email-spujar@nvidia.com> References: <1593233625-14961-1-git-send-email-spujar@nvidia.com> <1593233625-14961-13-git-send-email-spujar@nvidia.com> User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sameer > The simple-card driver supports multiple CPU and single Codec entries > for DPCM DAI links. In some cases it is required to have multiple > CPU/Codecs. Currently parsing logic for DPCM link loops over all > children of DAI link but assumes that there is a single Codec entry. > When DAI link has multiple Codecs it considers only the first Codec > entry and remaining Codecs are wrongly treated as CPU. This happens > because first Codec is used as reference for parsing all other child > nodes. (snip) > @@ -137,8 +136,13 @@ static int simple_dai_link_of_dpcm(struct asoc_simple_priv *priv, > * Codec |return|Pass > * np > */ > - if (li->cpu == (np == codec)) > - return 0; > + if (li->cpu) { > + if (!strcmp(np->name, "codec")) > + return 0; > + } else { > + if (!strcmp(np->name, "cpu")) > + return 0; > + } Checking node name is maybe nice idea, but please consider "prefix" here. Maybe base issue for multiple codec support is that simple_for_each_link() is caring first codec only ? simple_for_each_link(...) { ... do { => /* get codec */ => codec = of_get_child_by_name(...); ... } } Remove above and having simple_node_is_codec(np, xxx) function or something can help it ? Thank you for your help !! Best regards --- Kuninori Morimoto