mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sameer Pujar <spujar@nvidia.com>
To: <broonie@kernel.org>, <perex@perex.cz>, <tiwai@suse.com>,
	<kuninori.morimoto.gx@renesas.com>, <robh+dt@kernel.org>,
	<lgirdwood@gmail.com>
Cc: <thierry.reding@gmail.com>, <jonathanh@nvidia.com>,
	<alsa-devel@alsa-project.org>, <linux-tegra@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <sharadg@nvidia.com>,
	<mkumard@nvidia.com>, <viswanathl@nvidia.com>,
	<rlokhande@nvidia.com>, <dramesh@nvidia.com>,
	<atalambedu@nvidia.com>, <nwartikar@nvidia.com>,
	<swarren@nvidia.com>, <nicoleotsuka@gmail.com>,
	Sameer Pujar <spujar@nvidia.com>
Subject: [PATCH 03/10] ASoC: audio-graph: Support Codec with multiple endpoints
Date: Sun, 19 Jul 2020 10:40:10 +0530	[thread overview]
Message-ID: <1595135417-16589-4-git-send-email-spujar@nvidia.com> (raw)
In-Reply-To: <1595135417-16589-1-git-send-email-spujar@nvidia.com>

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 <spujar@nvidia.com>
---
 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


  parent reply	other threads:[~2020-07-19  5:10 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-19  5:10 [PATCH 00/10] Audio graph card updates and usage with Tegra210 audio Sameer Pujar
2020-07-19  5:10 ` [PATCH 01/10] ASoC: soc-core: Fix component name_prefix parsing Sameer Pujar
2020-07-19  5:10 ` [PATCH 02/10] ASoC: audio-graph: Use of_node and DAI for DPCM DAI link names Sameer Pujar
2020-07-19  5:10 ` Sameer Pujar [this message]
2020-07-19 23:37   ` [PATCH 03/10] ASoC: audio-graph: Support Codec with multiple endpoints Kuninori Morimoto
2020-07-20  4:14     ` Sameer Pujar
2020-07-20  5:13       ` Kuninori Morimoto
2020-08-03 12:02         ` Sameer Pujar
2020-07-19  5:10 ` [PATCH 04/10] ASoC: audio-graph: Support for empty end point Sameer Pujar
2020-07-19  5:10 ` [PATCH 05/10] ASoC: audio-graph: Identify 'no_pcm' DAI links for DPCM Sameer Pujar
2020-07-19  5:10 ` [PATCH 06/10] ASoC: soc-pcm: Get all BEs along DAPM path Sameer Pujar
2020-07-19  5:10 ` [PATCH 07/10] ASoC: dt-bindings: audio-graph-card: Support for component chaining Sameer Pujar
2020-07-19  5:10 ` [PATCH 08/10] ASoC: audio-graph: Add support " Sameer Pujar
2020-07-19  5:10 ` [PATCH 09/10] arm64: tegra: Audio graph header for Tegra210 Sameer Pujar
2020-07-20  0:10   ` Kuninori Morimoto
2020-07-20  4:17     ` Sameer Pujar
2020-07-20  4:51       ` Kuninori Morimoto
2020-08-03 12:06         ` Sameer Pujar
2020-07-19  5:10 ` [PATCH 10/10] arm64: tegra: Audio graph sound card for Jetson Nano and TX1 Sameer Pujar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1595135417-16589-4-git-send-email-spujar@nvidia.com \
    --to=spujar@nvidia.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=atalambedu@nvidia.com \
    --cc=broonie@kernel.org \
    --cc=dramesh@nvidia.com \
    --cc=jonathanh@nvidia.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mkumard@nvidia.com \
    --cc=nicoleotsuka@gmail.com \
    --cc=nwartikar@nvidia.com \
    --cc=perex@perex.cz \
    --cc=rlokhande@nvidia.com \
    --cc=robh+dt@kernel.org \
    --cc=sharadg@nvidia.com \
    --cc=swarren@nvidia.com \
    --cc=thierry.reding@gmail.com \
    --cc=tiwai@suse.com \
    --cc=viswanathl@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®