linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: qcom: Set dai_link id to each dai_link
@ 2018-11-08 13:41 Rohit kumar
  2018-11-08 13:56 ` Srinivas Kandagatla
  2018-11-13 23:10 ` Applied "ASoC: qcom: Set dai_link id to each dai_link" to the asoc tree Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Rohit kumar @ 2018-11-08 13:41 UTC (permalink / raw)
  To: plai, bgoswami, lgirdwood, broonie, perex, tiwai, alsa-devel,
	linux-kernel, rohkumar, srinivas.kandagatla
  Cc: Rohit kumar

Frontend dai_link id is used for closing ADM sessions.
During concurrent usecase when one session is closed,
it closes other ADM session associated with other usecase
too. Dai_link->id should always point to Frontend dai id.
Set cpu_dai id as dai_link id to fix the issue.

Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
---
 sound/soc/qcom/common.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c
index eb1b9da..4715527 100644
--- a/sound/soc/qcom/common.c
+++ b/sound/soc/qcom/common.c
@@ -13,6 +13,7 @@ int qcom_snd_parse_of(struct snd_soc_card *card)
 	struct device_node *cpu = NULL;
 	struct device *dev = card->dev;
 	struct snd_soc_dai_link *link;
+	struct of_phandle_args args;
 	int ret, num_links;
 
 	ret = snd_soc_of_parse_card_name(card, "model");
@@ -47,12 +48,14 @@ int qcom_snd_parse_of(struct snd_soc_card *card)
 			goto err;
 		}
 
-		link->cpu_of_node = of_parse_phandle(cpu, "sound-dai", 0);
-		if (!link->cpu_of_node) {
+		ret = of_parse_phandle_with_args(cpu, "sound-dai",
+					"#sound-dai-cells", 0, &args);
+		if (ret) {
 			dev_err(card->dev, "error getting cpu phandle\n");
-			ret = -EINVAL;
 			goto err;
 		}
+		link->cpu_of_node = args.np;
+		link->id = args.args[0];
 
 		ret = snd_soc_of_get_dai_name(cpu, &link->cpu_dai_name);
 		if (ret) {
-- 
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc.,
is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: qcom: Set dai_link id to each dai_link
  2018-11-08 13:41 [PATCH] ASoC: qcom: Set dai_link id to each dai_link Rohit kumar
@ 2018-11-08 13:56 ` Srinivas Kandagatla
  2018-11-13 23:10 ` Applied "ASoC: qcom: Set dai_link id to each dai_link" to the asoc tree Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Srinivas Kandagatla @ 2018-11-08 13:56 UTC (permalink / raw)
  To: Rohit kumar, plai, bgoswami, lgirdwood, broonie, perex, tiwai,
	alsa-devel, linux-kernel, rohkumar

Hi Rohit,

On 08/11/18 13:41, Rohit kumar wrote:
> Frontend dai_link id is used for closing ADM sessions.
> During concurrent usecase when one session is closed,
> it closes other ADM session associated with other usecase
> too. Dai_link->id should always point to Frontend dai id.
> Set cpu_dai id as dai_link id to fix the issue.
> 
Nice catch! thanks for fixing this!

> Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>

Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

> ---
>   sound/soc/qcom/common.c | 9 ++++++---
>   1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c
> index eb1b9da..4715527 100644
> --- a/sound/soc/qcom/common.c
> +++ b/sound/soc/qcom/common.c
> @@ -13,6 +13,7 @@ int qcom_snd_parse_of(struct snd_soc_card *card)
>   	struct device_node *cpu = NULL;
>   	struct device *dev = card->dev;
>   	struct snd_soc_dai_link *link;
> +	struct of_phandle_args args;
>   	int ret, num_links;
>   
>   	ret = snd_soc_of_parse_card_name(card, "model");
> @@ -47,12 +48,14 @@ int qcom_snd_parse_of(struct snd_soc_card *card)
>   			goto err;
>   		}
>   
> -		link->cpu_of_node = of_parse_phandle(cpu, "sound-dai", 0);
> -		if (!link->cpu_of_node) {
> +		ret = of_parse_phandle_with_args(cpu, "sound-dai",
> +					"#sound-dai-cells", 0, &args);
> +		if (ret) {
>   			dev_err(card->dev, "error getting cpu phandle\n");
> -			ret = -EINVAL;
>   			goto err;
>   		}
> +		link->cpu_of_node = args.np;
> +		link->id = args.args[0];
>   
>   		ret = snd_soc_of_get_dai_name(cpu, &link->cpu_dai_name);
>   		if (ret) {
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Applied "ASoC: qcom: Set dai_link id to each dai_link" to the asoc tree
  2018-11-08 13:41 [PATCH] ASoC: qcom: Set dai_link id to each dai_link Rohit kumar
  2018-11-08 13:56 ` Srinivas Kandagatla
@ 2018-11-13 23:10 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2018-11-13 23:10 UTC (permalink / raw)
  To: Rohit kumar
  Cc: Srinivas Kandagatla, Mark Brown, plai, bgoswami, lgirdwood,
	broonie, perex, tiwai, alsa-devel, linux-kernel, rohkumar,
	srinivas.kandagatla, alsa-devel

The patch

   ASoC: qcom: Set dai_link id to each dai_link

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 67fd1437d11620de8768b22fe20942e752ed52e9 Mon Sep 17 00:00:00 2001
From: Rohit kumar <rohitkr@codeaurora.org>
Date: Thu, 8 Nov 2018 19:11:40 +0530
Subject: [PATCH] ASoC: qcom: Set dai_link id to each dai_link

Frontend dai_link id is used for closing ADM sessions.
During concurrent usecase when one session is closed,
it closes other ADM session associated with other usecase
too. Dai_link->id should always point to Frontend dai id.
Set cpu_dai id as dai_link id to fix the issue.

Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/qcom/common.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c
index eb1b9da05dd4..4715527054e5 100644
--- a/sound/soc/qcom/common.c
+++ b/sound/soc/qcom/common.c
@@ -13,6 +13,7 @@ int qcom_snd_parse_of(struct snd_soc_card *card)
 	struct device_node *cpu = NULL;
 	struct device *dev = card->dev;
 	struct snd_soc_dai_link *link;
+	struct of_phandle_args args;
 	int ret, num_links;
 
 	ret = snd_soc_of_parse_card_name(card, "model");
@@ -47,12 +48,14 @@ int qcom_snd_parse_of(struct snd_soc_card *card)
 			goto err;
 		}
 
-		link->cpu_of_node = of_parse_phandle(cpu, "sound-dai", 0);
-		if (!link->cpu_of_node) {
+		ret = of_parse_phandle_with_args(cpu, "sound-dai",
+					"#sound-dai-cells", 0, &args);
+		if (ret) {
 			dev_err(card->dev, "error getting cpu phandle\n");
-			ret = -EINVAL;
 			goto err;
 		}
+		link->cpu_of_node = args.np;
+		link->id = args.args[0];
 
 		ret = snd_soc_of_get_dai_name(cpu, &link->cpu_dai_name);
 		if (ret) {
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-13 23:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-08 13:41 [PATCH] ASoC: qcom: Set dai_link id to each dai_link Rohit kumar
2018-11-08 13:56 ` Srinivas Kandagatla
2018-11-13 23:10 ` Applied "ASoC: qcom: Set dai_link id to each dai_link" to the asoc tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).