Skip to contentSkip to conversation

ASoC: core: Update for DSP systems

PATCH In review Vinod Koul 2 participants 19 messages Nov 9, 2015 – Jan 4, 2016

Subsystems (2)
lore
Share & tools
lore

Vinod Koul

author
#0 lore raw

cover ASoC: core: Update for DSP systems

This patch series tried to do two things

1. Add support to have cpu based loopback dai_links supported, so the CPU based DSPs can have non hostless streams

2. Add kcontrol to bytes tlv callbacks and fix the topology core info callback for TLV byte controls

Comments welcome...

Jeeja KP (1):
ASoC: core: Adds support for cpu loopback dai_link

Mythri P K (1):
ASoC: core: Pass kcontrol to bytes tlv callbacks

Omair M Abdullah (1):
ASoC: topology: fix info callback for TLV byte control

Vinod Koul (1):
ASoC: core: refactor soc_link_dai_widgets()

 include/sound/soc-topology.h |  6 ++++--
 include/sound/soc.h          |  9 +++++++--
 sound/soc/soc-core.c         | 38 +++++++++++++++++++++++++-------------
 sound/soc/soc-ops.c          |  4 ++--
 sound/soc/soc-topology.c     |  2 +-
 5 files changed, 39 insertions(+), 20 deletions(-)
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/4 ASoC: core: refactor soc_link_dai_widgets()

In soc_link_dai_widgets() we refer to local widget variables as playback/capture_widget, but they are really sink/source widgets, so change the names accordingly

---
 sound/soc/soc-core.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
sound/soc/soc-core.c +13 -13
index 24b096066a07..d5e0bcbafb70 100644
@@ -1283,35 +1283,35 @@ static int soc_link_dai_widgets(struct snd_soc_card *card,
 {
 	struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
 	struct snd_soc_dai *codec_dai = rtd->codec_dai;
-	struct snd_soc_dapm_widget *play_w, *capture_w;
+	struct snd_soc_dapm_widget *sink, *source;
 	int ret;
 
 	if (rtd->num_codecs > 1)
 		dev_warn(card->dev, "ASoC: Multiple codecs not supported yet\n");
 
 	/* link the DAI widgets */
-	play_w = codec_dai->playback_widget;
-	capture_w = cpu_dai->capture_widget;
-	if (play_w && capture_w) {
+	sink = codec_dai->playback_widget;
+	source = cpu_dai->capture_widget;
+	if (sink && source) {
 		ret = snd_soc_dapm_new_pcm(card, dai_link->params,
-					   dai_link->num_params, capture_w,
-					   play_w);
+					   dai_link->num_params,
+					   source, sink);
 		if (ret != 0) {
 			dev_err(card->dev, "ASoC: Can't link %s to %s: %d\n",
-				play_w->name, capture_w->name, ret);
+				sink->name, source->name, ret);
 			return ret;
 		}
 	}
 
-	play_w = cpu_dai->playback_widget;
-	capture_w = codec_dai->capture_widget;
-	if (play_w && capture_w) {
+	sink = cpu_dai->playback_widget;
+	source = codec_dai->capture_widget;
+	if (sink && source) {
 		ret = snd_soc_dapm_new_pcm(card, dai_link->params,
-					   dai_link->num_params, capture_w,
-					   play_w);
+					   dai_link->num_params,
+					   source, sink);
 		if (ret != 0) {
 			dev_err(card->dev, "ASoC: Can't link %s to %s: %d\n",
-				play_w->name, capture_w->name, ret);
+				sink->name, source->name, ret);
 			return ret;
 		}
 	}
Signature · 1 line
1.9.1
maintainer
#2 lore raw

Applied "ASoC: core: refactor soc_link_dai_widgets()" to the asoc tree

The patch

ASoC: core: refactor soc_link_dai_widgets()

has been applied to the asoc tree at

git://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

Quoted 1 line

From 3de7c420a2b1737844d893cbfc689a9b2b5528cd Mon Sep 17 00:00:00 2001

From: Vinod Koul <[email protected]>
Date: Mon, 9 Nov 2015 23:19:58 +0530
Subject: [PATCH] ASoC: core: refactor soc_link_dai_widgets()

In soc_link_dai_widgets() we refer to local widget variables as playback/capture_widget, but they are really sink/source widgets, so change the names accordingly

---
 sound/soc/soc-core.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
sound/soc/soc-core.c +13 -13
index 24b096066a07..d5e0bcbafb70 100644
@@ -1283,35 +1283,35 @@ static int soc_link_dai_widgets(struct snd_soc_card *card,
 {
 	struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
 	struct snd_soc_dai *codec_dai = rtd->codec_dai;
-	struct snd_soc_dapm_widget *play_w, *capture_w;
+	struct snd_soc_dapm_widget *sink, *source;
 	int ret;
 
 	if (rtd->num_codecs > 1)
 		dev_warn(card->dev, "ASoC: Multiple codecs not supported yet\n");
 
 	/* link the DAI widgets */
-	play_w = codec_dai->playback_widget;
-	capture_w = cpu_dai->capture_widget;
-	if (play_w && capture_w) {
+	sink = codec_dai->playback_widget;
+	source = cpu_dai->capture_widget;
+	if (sink && source) {
 		ret = snd_soc_dapm_new_pcm(card, dai_link->params,
-					   dai_link->num_params, capture_w,
-					   play_w);
+					   dai_link->num_params,
+					   source, sink);
 		if (ret != 0) {
 			dev_err(card->dev, "ASoC: Can't link %s to %s: %d\n",
-				play_w->name, capture_w->name, ret);
+				sink->name, source->name, ret);
 			return ret;
 		}
 	}
 
-	play_w = cpu_dai->playback_widget;
-	capture_w = codec_dai->capture_widget;
-	if (play_w && capture_w) {
+	sink = cpu_dai->playback_widget;
+	source = codec_dai->capture_widget;
+	if (sink && source) {
 		ret = snd_soc_dapm_new_pcm(card, dai_link->params,
-					   dai_link->num_params, capture_w,
-					   play_w);
+					   dai_link->num_params,
+					   source, sink);
 		if (ret != 0) {
 			dev_err(card->dev, "ASoC: Can't link %s to %s: %d\n",
-				play_w->name, capture_w->name, ret);
+				sink->name, source->name, ret);
 			return ret;
 		}
 	}
Signature · 1 line
2.6.2
author
#3 lore raw

PATCH 2/4 ASoC: core: Adds support for cpu loopback dai_link

In reply to Vinod Koul

From: Jeeja KP <[email protected]>

soc_link_dai_widgets() creates codec-codec loopback link which allows DPCM to trigger these links and program the parameters for these links These links are:

	Codec1 Tx (Pb)  ----------> Rx Codec2 (Cap)
	Codec2 Tx (Cap) <---------- Tx Codec1 (Pb)

But as we try to model a CPU based loops for non host links like modem to codec loop, the above mapping gets wrong as:

	CPU Tx (Pb)  -----------> Codec Tx (Pb)
	CPU Rx (Cap) <----------- Codec Rx (Cap)

So we add a new flag to handle above scenario and link widgets as depecited above

---
 include/sound/soc.h  |  3 +++
 sound/soc/soc-core.c | 20 ++++++++++++++++----
 2 files changed, 19 insertions(+), 4 deletions(-)
include/sound/soc.h +3 -0
index a8b4b9c8b1d2..e93927789d98 100644
@@ -992,6 +992,9 @@ struct snd_soc_dai_link {
 	const struct snd_soc_pcm_stream *params;
 	unsigned int num_params;
 
+	/* flag to create cpu based loopback link */
+	unsigned int cpu_loopback:1;
+
 	unsigned int dai_fmt;           /* format to set on init */
 
 	enum snd_soc_dpcm_trigger trigger[2]; /* trigger type for DPCM */
sound/soc/soc-core.c +16 -4
index d5e0bcbafb70..40077fbd2495 100644
@@ -1290,8 +1290,14 @@ static int soc_link_dai_widgets(struct snd_soc_card *card,
 		dev_warn(card->dev, "ASoC: Multiple codecs not supported yet\n");
 
 	/* link the DAI widgets */
-	sink = codec_dai->playback_widget;
-	source = cpu_dai->capture_widget;
+	if (!dai_link->cpu_loopback) {
+		sink = codec_dai->playback_widget;
+		source = cpu_dai->capture_widget;
+	} else {
+		sink = codec_dai->playback_widget;
+		source = cpu_dai->playback_widget;
+	}
+
 	if (sink && source) {
 		ret = snd_soc_dapm_new_pcm(card, dai_link->params,
 					   dai_link->num_params,
@@ -1303,8 +1309,14 @@ static int soc_link_dai_widgets(struct snd_soc_card *card,
 		}
 	}
 
-	sink = cpu_dai->playback_widget;
-	source = codec_dai->capture_widget;
+	if (!dai_link->cpu_loopback) {
+		sink = cpu_dai->playback_widget;
+		source = codec_dai->capture_widget;
+	} else {
+		sink = cpu_dai->capture_widget;
+		source = codec_dai->capture_widget;
+	}
+
 	if (sink && source) {
 		ret = snd_soc_dapm_new_pcm(card, dai_link->params,
 					   dai_link->num_params,
Signature · 1 line
1.9.1
maintainer
#4 lore raw

Re: [PATCH 2/4] ASoC: core: Adds support for cpu loopback dai_link

Quoted 9 lines · Vinod Koul

From: Jeeja KP <[email protected]>

soc_link_dai_widgets() creates codec-codec loopback link which allows DPCM to trigger these links and program the parameters for these links These links are:

	Codec1 Tx (Pb)  ----------> Rx Codec2 (Cap)
	Codec2 Tx (Cap) <---------- Tx Codec1 (Pb)
Quoted 8 lines

But as we try to model a CPU based loops for non host links like modem to codec loop, the above mapping gets wrong as:

	CPU Tx (Pb)  -----------> Codec Tx (Pb)
	CPU Rx (Cap) <----------- Codec Rx (Cap)

So we add a new flag to handle above scenario and link widgets as depecited above

So, what I was really thinking of with the renaming was a bigger rename that updates the names in snd_soc_dai_driver and everything that comes from that. That's a much bigger thing though, let me think about it a bit more.

author
#5 lore raw

Re: [PATCH 2/4] ASoC: core: Adds support for cpu loopback dai_link

Quoted 16 lines · Mark Brown
Quoted 15 lines · Vinod Koul

From: Jeeja KP <[email protected]>

soc_link_dai_widgets() creates codec-codec loopback link which allows DPCM to trigger these links and program the parameters for these links These links are:

	Codec1 Tx (Pb)  ----------> Rx Codec2 (Cap)
	Codec2 Tx (Cap) <---------- Tx Codec1 (Pb)

But as we try to model a CPU based loops for non host links like modem to codec loop, the above mapping gets wrong as:

	CPU Tx (Pb)  -----------> Codec Tx (Pb)
	CPU Rx (Cap) <----------- Codec Rx (Cap)
Quoted 7 lines
Quoted 2 lines

So we add a new flag to handle above scenario and link widgets as depecited above

So, what I was really thinking of with the renaming was a bigger rename that updates the names in snd_soc_dai_driver and everything that comes from that. That's a much bigger thing though, let me think about it a bit more.

ah, yes that kind of change does make sense, but as you observed that will be a larger rework. And I think I am up for it in parallel to my SKL work :)

But that will take a bit of time and I would like update these in bits rather than one shot

Let me know what you think and how you would like to approach this

Thanks

Signature · 1 line
~Vinod
author
#6 lore raw

Re: [PATCH 2/4] ASoC: core: Adds support for cpu loopback dai_link

Quoted 25 lines · Vinod Koul
Quoted 16 lines · Mark Brown
Quoted 15 lines · Vinod Koul

From: Jeeja KP <[email protected]>

soc_link_dai_widgets() creates codec-codec loopback link which allows DPCM to trigger these links and program the parameters for these links These links are:

	Codec1 Tx (Pb)  ----------> Rx Codec2 (Cap)
	Codec2 Tx (Cap) <---------- Tx Codec1 (Pb)

But as we try to model a CPU based loops for non host links like modem to codec loop, the above mapping gets wrong as:

	CPU Tx (Pb)  -----------> Codec Tx (Pb)
	CPU Rx (Cap) <----------- Codec Rx (Cap)
Quoted 7 lines
Quoted 2 lines

So we add a new flag to handle above scenario and link widgets as depecited above

So, what I was really thinking of with the renaming was a bigger rename that updates the names in snd_soc_dai_driver and everything that comes from that. That's a much bigger thing though, let me think about it a bit more.

Quoted 7 lines

ah, yes that kind of change does make sense, but as you observed that will be a larger rework. And I think I am up for it in parallel to my SKL work :)

But that will take a bit of time and I would like update these in bits rather than one shot

Let me know what you think and how you would like to approach this

Hi Mark,

Any recommendations on this, how do we go about this

Thanks

Signature · 1 line
~Vinod
maintainer
#7 lore raw

Re: [PATCH 2/4] ASoC: core: Adds support for cpu loopback dai_link

In reply to Vinod Koul
Quoted 7 lines · Vinod Koul
Quoted 4 lines · Mark Brown

So, what I was really thinking of with the renaming was a bigger rename that updates the names in snd_soc_dai_driver and everything that comes from that. That's a much bigger thing though, let me think about it a bit more.

Quoted 7 lines

ah, yes that kind of change does make sense, but as you observed that will be a larger rework. And I think I am up for it in parallel to my SKL work :)

But that will take a bit of time and I would like update these in bits rather than one shot

Let me know what you think and how you would like to approach this

Can we make the temporary hack be to check if there's a CODEC defined in the DAI? It's nasty and fragile but it keeps the hack much better isolated.

author
#8 lore raw

Re: [PATCH 2/4] ASoC: core: Adds support for cpu loopback dai_link

Quoted 11 lines · Mark Brown
Quoted 9 lines · Vinod Koul
Quoted 4 lines · Mark Brown

So, what I was really thinking of with the renaming was a bigger rename that updates the names in snd_soc_dai_driver and everything that comes from that. That's a much bigger thing though, let me think about it a bit more.

ah, yes that kind of change does make sense, but as you observed that will be a larger rework. And I think I am up for it in parallel to my SKL work :)

Quoted 8 lines
Quoted 4 lines

But that will take a bit of time and I would like update these in bits rather than one shot

Let me know what you think and how you would like to approach this

Can we make the temporary hack be to check if there's a CODEC defined in the DAI? It's nasty and fragile but it keeps the hack much better isolated.

The flag added here, cpu_loopback would do that and keep this isolated from the rest. The problem with checking if codec is defined will be for dsp based loops which terminate in codec. It will not work as we will find codec in the dailink for the voice call (modem-dsp-codec) loop

Thanks

Signature · 1 line
~Vinod
maintainer
#9 lore raw

Re: [PATCH 2/4] ASoC: core: Adds support for cpu loopback dai_link

Quoted 8 lines · Vinod Koul
Quoted 3 lines · Mark Brown

Can we make the temporary hack be to check if there's a CODEC defined in the DAI? It's nasty and fragile but it keeps the hack much better isolated.

The flag added here, cpu_loopback would do that and keep this isolated from the rest. The problem with checking if codec is defined will be for dsp

No, it means that the drivers need to set the flag to work around the core which is what I want to avoid.

Quoted 2 lines

based loops which terminate in codec. It will not work as we will find codec in the dailink for the voice call (modem-dsp-codec) loop

I'm confused about the situation you're describing here. The connections are DAI to DAI so why would any CODEC behind the CPU DAI have an impact?

author
#10 lore raw

Re: [PATCH 2/4] ASoC: core: Adds support for cpu loopback dai_link

Quoted 7 lines · Mark Brown
Quoted 5 lines · Vinod Koul
Quoted 3 lines · Mark Brown

Can we make the temporary hack be to check if there's a CODEC defined in the DAI? It's nasty and fragile but it keeps the hack much better isolated.

Quoted 5 lines
Quoted 2 lines

The flag added here, cpu_loopback would do that and keep this isolated from the rest. The problem with checking if codec is defined will be for dsp

No, it means that the drivers need to set the flag to work around the core which is what I want to avoid.

ok fine then

Quoted 7 lines
Quoted 3 lines

based loops which terminate in codec. It will not work as we will find codec in the dailink for the voice call (modem-dsp-codec) loop

I'm confused about the situation you're describing here. The connections are DAI to DAI so why would any CODEC behind the CPU DAI have an impact?

let me try again,

So I would like to for example do a voice call. So I need to DAIlinks for this. First one is modem-SSP-A and second SSP-B to codec.

I am taking example of SSP-B to codec for configuration

Currently the code envisions that loop is connected as modem-codec, so DAI links are linked per this assumption

     Modem Tx (Pb)  ----------> Rx Codec (Cap)
     Modem Rx (Cap) <---------- Tx Codec (Pb)

So we link pb-cap and cap-pb connected

But if we do wrt from CPU the situation is different

     CPU Tx (Pb)  -----------> Codec Tx (Pb)
     CPU Rx (Cap) <----------- Codec Rx (Cap)

Since this follows normal playback kind of scenario, we need to link pb-pb and cap-cap

Now we cannot change this unilaterally so added a flag to signify we want second mapping for dailink rather then first one

Am okay to change this to something different way, which results in second mapping from CPU based loops, pls do suggest :)

Thanks

Signature · 1 line
~Vinod
maintainer
#11 lore raw

Re: [PATCH 2/4] ASoC: core: Adds support for cpu loopback dai_link

Quoted 7 lines · Vinod Koul

But if we do wrt from CPU the situation is different

     CPU Tx (Pb)  -----------> Codec Tx (Pb)
     CPU Rx (Cap) <----------- Codec Rx (Cap)

Since this follows normal playback kind of scenario, we need to link pb-pb and cap-cap

But neither of these is a CODEC so why would the CODEC flag be set in the DAI? Unless your "Codec" here is genuinely the CODEC rather than the CPU DAI connected to the CODEC in which case surely this is just a normal DAI link?

author
#12 lore raw

Re: [PATCH 2/4] ASoC: core: Adds support for cpu loopback dai_link

Quoted 7 lines · Mark Brown
Quoted 4 lines · Vinod Koul

But if we do wrt from CPU the situation is different

     CPU Tx (Pb)  -----------> Codec Tx (Pb)
     CPU Rx (Cap) <----------- Codec Rx (Cap)
Quoted 7 lines
Quoted 2 lines

Since this follows normal playback kind of scenario, we need to link pb-pb and cap-cap

But neither of these is a CODEC so why would the CODEC flag be set in the DAI? Unless your "Codec" here is genuinely the CODEC rather than the CPU DAI connected to the CODEC in which case surely this is just a normal DAI link?

Sorry Mark for late reply..

You are right this is like a normal link, and yes that is _exactly_ we need, but we also need parameters to be specified for this as this is hostless.

The moment I add 'params" core will do different connections which do not work for us.

I am okay if you have something else in mind which solves our problem :)

Thanks

Signature · 1 line
~Vinod
maintainer
#13 lore raw

Re: [PATCH 2/4] ASoC: core: Adds support for cpu loopback dai_link

Quoted 9 lines · Vinod Koul
Quoted 4 lines · Mark Brown

But neither of these is a CODEC so why would the CODEC flag be set in the DAI? Unless your "Codec" here is genuinely the CODEC rather than the CPU DAI connected to the CODEC in which case surely this is just a normal DAI link?

Sorry Mark for late reply..

Quoted 7 lines

You are right this is like a normal link, and yes that is _exactly_ we need, but we also need parameters to be specified for this as this is hostless.

The moment I add 'params" core will do different connections which do not work for us.

I am okay if you have something else in mind which solves our problem :)

Isn't this what the DPCM fixup() is supposed to handle? As I keep saying I really think these systems would work a lot better if they were representing the DSP as a CODEC, that makes everything much more consistent and less riddled with special cases.

author
#14 lore raw

Re: [PATCH 2/4] ASoC: core: Adds support for cpu loopback dai_link

Quoted 13 lines · Mark Brown
Quoted 11 lines · Vinod Koul
Quoted 4 lines · Mark Brown

But neither of these is a CODEC so why would the CODEC flag be set in the DAI? Unless your "Codec" here is genuinely the CODEC rather than the CPU DAI connected to the CODEC in which case surely this is just a normal DAI link?

Sorry Mark for late reply..

You are right this is like a normal link, and yes that is _exactly_ we need, but we also need parameters to be specified for this as this is hostless.

Quoted 6 lines
Quoted 4 lines

The moment I add 'params" core will do different connections which do not work for us.

I am okay if you have something else in mind which solves our problem :)

Isn't this what the DPCM fixup() is supposed to handle?

Yes you are right but it doesn't. Fixup will be invoked only when someone invoked hw_params, but for the loop in this case since we register a PCM and not a dai-link widget the DAPM trigger for loop patch does not find any dailink widgets and does not invoke hw_params or fixup.

Looking at this I think we should modify the snd_soc_dapm_new_dai_widgets() and add template.event, but not sure if it was cause other issues..

Quoted 4 lines

As I keep
saying I really think these systems would work a lot better if they were representing the DSP as a CODEC, that makes everything much more consistent and less riddled with special cases.

The problem is manging DMAs and params, today codec approach does not help me with these, but yes I will keep looking for ways to enhnace to core as discussed in the ELC with you :)

Thanks

Signature · 1 line
~Vinod
author
#15 lore raw

PATCH 3/4 ASoC: core: Pass kcontrol to bytes tlv callbacks

In reply to Vinod Koul

From: Mythri P K <[email protected]>

Add kcontrol to the tlv callbacks in soc_bytes_ext, as it is needed for referencing the corresponding control in the driver code

Also fix the only upstream user in topology core

---
 include/sound/soc-topology.h | 6 ++++--
 include/sound/soc.h          | 6 ++++--
 sound/soc/soc-ops.c          | 4 ++--
 3 files changed, 10 insertions(+), 6 deletions(-)
include/sound/soc-topology.h +4 -2
index 086cd7ff6ddc..5b68e3f5aa85 100644
@@ -92,8 +92,10 @@ struct snd_soc_tplg_kcontrol_ops {
 /* Bytes ext operations, for TLV byte controls */
 struct snd_soc_tplg_bytes_ext_ops {
 	u32 id;
-	int (*get)(unsigned int __user *bytes, unsigned int size);
-	int (*put)(const unsigned int __user *bytes, unsigned int size);
+	int (*get)(struct snd_kcontrol *kcontrol, unsigned int __user *bytes,
+							unsigned int size);
+	int (*put)(struct snd_kcontrol *kcontrol,
+			const unsigned int __user *bytes, unsigned int size);
 };
 
 /*
include/sound/soc.h +4 -2
index e93927789d98..e09673dbae1b 100644
@@ -1228,8 +1228,10 @@ struct soc_bytes_ext {
 	struct snd_soc_dobj dobj;
 
 	/* used for TLV byte control */
-	int (*get)(unsigned int __user *bytes, unsigned int size);
-	int (*put)(const unsigned int __user *bytes, unsigned int size);
+	int (*get)(struct snd_kcontrol *kcontrol, unsigned int __user *bytes,
+			unsigned int size);
+	int (*put)(struct snd_kcontrol *kcontrol, const unsigned int __user *bytes,
+			unsigned int size);
 };
 
 /* multi register control */
sound/soc/soc-ops.c +2 -2
index ecd38e52285a..ba3e49010ac3 100644
@@ -779,11 +779,11 @@ int snd_soc_bytes_tlv_callback(struct snd_kcontrol *kcontrol, int op_flag,
 	switch (op_flag) {
 	case SNDRV_CTL_TLV_OP_READ:
 		if (params->get)
-			ret = params->get(tlv, count);
+			ret = params->get(kcontrol, tlv, count);
 		break;
 	case SNDRV_CTL_TLV_OP_WRITE:
 		if (params->put)
-			ret = params->put(tlv, count);
+			ret = params->put(kcontrol, tlv, count);
 		break;
 	}
 	return ret;
Signature · 1 line
1.9.1
maintainer
#16 lore raw

Applied "ASoC: core: Pass kcontrol to bytes tlv callbacks" to the asoc tree

The patch

ASoC: core: Pass kcontrol to bytes tlv callbacks

has been applied to the asoc tree at

git://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

Quoted 1 line

From a1e5e7e9b36f360bf75e4f0f7ceb899682f213bd Mon Sep 17 00:00:00 2001

From: Mythri P K <[email protected]>
Date: Mon, 9 Nov 2015 23:20:00 +0530
Subject: [PATCH] ASoC: core: Pass kcontrol to bytes tlv callbacks

Add kcontrol to the tlv callbacks in soc_bytes_ext, as it is needed for referencing the corresponding control in the driver code

Also fix the only upstream user in topology core

---
 include/sound/soc-topology.h | 6 ++++--
 include/sound/soc.h          | 6 ++++--
 sound/soc/soc-ops.c          | 4 ++--
 3 files changed, 10 insertions(+), 6 deletions(-)
include/sound/soc-topology.h +4 -2
index 086cd7ff6ddc..5b68e3f5aa85 100644
@@ -92,8 +92,10 @@ struct snd_soc_tplg_kcontrol_ops {
 /* Bytes ext operations, for TLV byte controls */
 struct snd_soc_tplg_bytes_ext_ops {
 	u32 id;
-	int (*get)(unsigned int __user *bytes, unsigned int size);
-	int (*put)(const unsigned int __user *bytes, unsigned int size);
+	int (*get)(struct snd_kcontrol *kcontrol, unsigned int __user *bytes,
+							unsigned int size);
+	int (*put)(struct snd_kcontrol *kcontrol,
+			const unsigned int __user *bytes, unsigned int size);
 };
 
 /*
include/sound/soc.h +4 -2
index a8b4b9c8b1d2..6603155f50ca 100644
@@ -1225,8 +1225,10 @@ struct soc_bytes_ext {
 	struct snd_soc_dobj dobj;
 
 	/* used for TLV byte control */
-	int (*get)(unsigned int __user *bytes, unsigned int size);
-	int (*put)(const unsigned int __user *bytes, unsigned int size);
+	int (*get)(struct snd_kcontrol *kcontrol, unsigned int __user *bytes,
+			unsigned int size);
+	int (*put)(struct snd_kcontrol *kcontrol, const unsigned int __user *bytes,
+			unsigned int size);
 };
 
 /* multi register control */
sound/soc/soc-ops.c +2 -2
index ecd38e52285a..ba3e49010ac3 100644
@@ -779,11 +779,11 @@ int snd_soc_bytes_tlv_callback(struct snd_kcontrol *kcontrol, int op_flag,
 	switch (op_flag) {
 	case SNDRV_CTL_TLV_OP_READ:
 		if (params->get)
-			ret = params->get(tlv, count);
+			ret = params->get(kcontrol, tlv, count);
 		break;
 	case SNDRV_CTL_TLV_OP_WRITE:
 		if (params->put)
-			ret = params->put(tlv, count);
+			ret = params->put(kcontrol, tlv, count);
 		break;
 	}
 	return ret;
Signature · 1 line
2.6.2
author
#17 lore raw

PATCH 4/4 ASoC: topology: fix info callback for TLV byte control

In reply to Vinod Koul

From: Omair M Abdullah <[email protected]>

topology core used wrong callback for TLV bytes control, it should be snd_soc_bytes_info_ext and not snd_soc_bytes_info

---
 sound/soc/soc-topology.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/soc-topology.c +1 -1
index 69d01cd925ce..a697f9fc8495 100644
@@ -531,7 +531,7 @@ static int soc_tplg_kcontrol_bind_io(struct snd_soc_tplg_ctl_hdr *hdr,
 		/* TLV bytes controls need standard kcontrol info handler,
 		 * TLV callback and extended put/get handlers.
 		 */
-		k->info = snd_soc_bytes_info;
+		k->info = snd_soc_bytes_info_ext;
 		k->tlv.c = snd_soc_bytes_tlv_callback;
 
 		ext_ops = tplg->bytes_ext_ops;
Signature · 1 line
1.9.1
maintainer
#18 lore raw

Applied "ASoC: topology: fix info callback for TLV byte control" to the asoc tree

The patch

ASoC: topology: fix info callback for TLV byte control

has been applied to the asoc tree at

git://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

Quoted 1 line

From f4be978b9611c94f20cdc8cee540ef1a52f8875c Mon Sep 17 00:00:00 2001

From: Omair M Abdullah <[email protected]>
Date: Mon, 9 Nov 2015 23:20:01 +0530
Subject: [PATCH] ASoC: topology: fix info callback for TLV byte control

topology core used wrong callback for TLV bytes control, it should be snd_soc_bytes_info_ext and not snd_soc_bytes_info

---
 sound/soc/soc-topology.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/soc-topology.c +1 -1
index 8d7ec80af51b..50f21ed00cfa 100644
@@ -531,7 +531,7 @@ static int soc_tplg_kcontrol_bind_io(struct snd_soc_tplg_ctl_hdr *hdr,
 		/* TLV bytes controls need standard kcontrol info handler,
 		 * TLV callback and extended put/get handlers.
 		 */
-		k->info = snd_soc_bytes_info;
+		k->info = snd_soc_bytes_info_ext;
 		k->tlv.c = snd_soc_bytes_tlv_callback;
 
 		ext_ops = tplg->bytes_ext_ops;
Signature · 1 line
2.6.2