Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp788046ybh; Sat, 18 Jul 2020 22:11:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjvurNGmcsd83C0OHm+AFe5a5xinDdcoBEqbYlCmOKYsSOi68wtV3/Iwemmy9AV942GL+O X-Received: by 2002:a17:906:abc9:: with SMTP id kq9mr15754700ejb.493.1595135492327; Sat, 18 Jul 2020 22:11:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595135492; cv=none; d=google.com; s=arc-20160816; b=A27JymTAr+R2ImJD3TAWvkraHLp9A5BH3aTR/7qQT8Dh6bxUaCrO+u2JsSL8YVhYYv yACsWE6/cn87oIWoHdlRLR5xM1U+N70klAk51/CLi932NPL4ExzLLgHQy3juf8UliMQQ b+IW2mD1aotrDl1LX+hPoyDbZkoEcoo0Gq4Na25oI4XTIMFAXXAtELOrUrgE7rkOupvs lz5qIzhGSao6fmm6DMqKUfRefSB3Us1z6NpvIpGrsFMX4zAzEaqOinS6KbSeV6GGzj17 WIqVfAi5b0qw1PQx/YbliRlvZOvpQSRsP3p29sA1HalbYLtSDYMAuSOxel3FCyVoR6iG GpLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from; bh=IQlK96/RLPdpEAiXfNPlP7nM1ld3WcJT6cego6KI2FA=; b=Hr7wVzJADZlMl9DPRsQYoK/ChgQJq7GOeHdtwS7sc4D8QCOTSvvB4eIDFzeEK3NiOg g/iMfSLNhxClPH8zlLklfQwBprEYxM0Szl8UqoTlL6sZoSDq1tUMFHJPbhRvShSQY18Y ccFKGWtHj5xWBjbFg1EDCePmZLf/aWF7lmkNnW2JMh4YJdU5eJzyWmwHVFFHBSBIpHOf dS2eXaTalaSZgcEHm6sSjLKXdXqGBjatcW3Hx3zNaeTykA3CQC8Jw+55KL7gun1tjwwj hFxyo+Vlgvq50s47Ai0uBMi68+4c1vLXvOJDSGDjwrf+Ik+EwTv6QzANZnqYvnbVZL33 oK8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=LIbzgJd2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gy14si7669170ejb.313.2020.07.18.22.11.09; Sat, 18 Jul 2020 22:11:32 -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; dkim=pass header.i=@nvidia.com header.s=n1 header.b=LIbzgJd2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726359AbgGSFKy (ORCPT + 99 others); Sun, 19 Jul 2020 01:10:54 -0400 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:4639 "EHLO hqnvemgate25.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725272AbgGSFKy (ORCPT ); Sun, 19 Jul 2020 01:10:54 -0400 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Sat, 18 Jul 2020 22:09:53 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Sat, 18 Jul 2020 22:10:53 -0700 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Sat, 18 Jul 2020 22:10:53 -0700 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Sun, 19 Jul 2020 05:10:53 +0000 Received: from hqnvemgw03.nvidia.com (10.124.88.68) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Sun, 19 Jul 2020 05:10:53 +0000 Received: from audio.nvidia.com (Not Verified[10.24.34.185]) by hqnvemgw03.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Sat, 18 Jul 2020 22:10:53 -0700 From: Sameer Pujar To: , , , , , CC: , , , , , , , , , , , , , , Sameer Pujar Subject: [PATCH 03/10] ASoC: audio-graph: Support Codec with multiple endpoints Date: Sun, 19 Jul 2020 10:40:10 +0530 Message-ID: <1595135417-16589-4-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1595135417-16589-1-git-send-email-spujar@nvidia.com> References: <1595135417-16589-1-git-send-email-spujar@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1595135393; bh=IQlK96/RLPdpEAiXfNPlP7nM1ld3WcJT6cego6KI2FA=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:X-NVConfidentiality:MIME-Version: Content-Type; b=LIbzgJd2p1LajQMZBTEYpLmcVs0GFAoawdRHl4VRVjAeBxatmdM5Ue5Th8E4E1VtO 0w1wxE16PmmQKIKDvLpYDE+Bk/euGPN65RgJv4A8yZkPDc9rLlfCfBmZJpo+7XJjzc 3qKF3ujedOVaINW0M3+oOYc60Ta91FsBgBZq67an6si1pTQdpQbw7X7xmAaO6Uyb7F qRQ2JyyBim2xGdqtU4G3x6LA00pCGtG6/Ty+729AcZ45nKhYRl0wzLtXl1i2yoSEnr 9DT0vaShq3QN7IqChWy+9RgbTm+WBYHaMxO47GZLsEaokhMnqVKEx0bGmUQEKR3YUg 0GPanwvJla+Kw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If a Codec port has multiple endpoints, only first endpoint gets parsed and remaining are ignored. This can be fixed by removing 'dup_codec' flag passed to graph_dai_link_of_dpcm() and thus it loops over all endpoints of Codec. Similarly graph_count_dpcm() is updated as well. Signed-off-by: Sameer Pujar --- sound/soc/generic/audio-graph-card.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 1e20562..b1903f9 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -201,8 +201,7 @@ static void graph_parse_mclk_fs(struct device_node *top, static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv, struct device_node *cpu_ep, struct device_node *codec_ep, - struct link_info *li, - int dup_codec) + struct link_info *li) { struct device *dev = simple_priv_to_dev(priv); struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link); @@ -217,10 +216,6 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv, struct snd_soc_dai_link_component *codecs = dai_link->codecs; int ret; - /* Do it all CPU endpoint, and 1st Codec endpoint */ - if (!li->cpu && dup_codec) - return 0; - port = of_get_parent(ep); ports = of_get_parent(port); node = of_graph_get_port_parent(ep); @@ -415,7 +410,7 @@ static int graph_for_each_link(struct asoc_simple_priv *priv, int (*func_dpcm)(struct asoc_simple_priv *priv, struct device_node *cpu_ep, struct device_node *codec_ep, - struct link_info *li, int dup_codec)) + struct link_info *li)) { struct of_phandle_iterator it; struct device *dev = simple_priv_to_dev(priv); @@ -424,7 +419,6 @@ static int graph_for_each_link(struct asoc_simple_priv *priv, struct device_node *cpu_ep; struct device_node *codec_ep; struct device_node *codec_port; - struct device_node *codec_port_old = NULL; struct asoc_simple_data adata; uintptr_t dpcm_selectable = (uintptr_t)of_device_get_match_data(dev); int rc, ret; @@ -457,8 +451,7 @@ static int graph_for_each_link(struct asoc_simple_priv *priv, if (dpcm_selectable && ((of_get_child_count(codec_port) > 1) || adata.convert_rate || adata.convert_channels)) - ret = func_dpcm(priv, cpu_ep, codec_ep, li, - (codec_port_old == codec_port)); + ret = func_dpcm(priv, cpu_ep, codec_ep, li); /* else normal sound */ else ret = func_noml(priv, cpu_ep, codec_ep, li); @@ -468,8 +461,6 @@ static int graph_for_each_link(struct asoc_simple_priv *priv, if (ret < 0) return ret; - - codec_port_old = codec_port; } } @@ -532,19 +523,18 @@ static int graph_count_noml(struct asoc_simple_priv *priv, static int graph_count_dpcm(struct asoc_simple_priv *priv, struct device_node *cpu_ep, struct device_node *codec_ep, - struct link_info *li, - int dup_codec) + struct link_info *li) { struct device *dev = simple_priv_to_dev(priv); + /* CPU */ li->link++; /* 1xCPU-dummy */ li->dais++; /* 1xCPU */ - if (!dup_codec) { - li->link++; /* 1xdummy-Codec */ - li->conf++; /* 1xdummy-Codec */ - li->dais++; /* 1xCodec */ - } + /* Codec */ + li->link++; /* 1xdummy-Codec */ + li->conf++; /* 1xdummy-Codec */ + li->dais++; /* 1xCodec */ dev_dbg(dev, "Count As DPCM\n"); -- 2.7.4