[alsa-devel] [PATCH 0/4] 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(-)
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
Suggested-by: Mark Brown broonie@kernel.org Signed-off-by: Vinod Koul vinod.koul@intel.com --- sound/soc/soc-core.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 24b096066a07..d5e0bcbafb70 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -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; } }
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
From 3de7c420a2b1737844d893cbfc689a9b2b5528cd Mon Sep 17 00:00:00 2001
From: Vinod Koul vinod.koul@intel.com 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
Suggested-by: Mark Brown broonie@kernel.org Signed-off-by: Vinod Koul vinod.koul@intel.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/soc-core.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 24b096066a07..d5e0bcbafb70 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -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; } }
From: Jeeja KP jeeja.kp@intel.com
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
Signed-off-by: Jeeja KP jeeja.kp@intel.com Signed-off-by: Vinod Koul vinod.koul@intel.com --- include/sound/soc.h | 3 +++ sound/soc/soc-core.c | 20 ++++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/include/sound/soc.h b/include/sound/soc.h index a8b4b9c8b1d2..e93927789d98 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -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 */ diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index d5e0bcbafb70..40077fbd2495 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -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,
On Mon, Nov 09, 2015 at 11:19:59PM +0530, Vinod Koul wrote:
From: Jeeja KP jeeja.kp@intel.com
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
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.
On Wed, Nov 18, 2015 at 01:17:57PM +0000, Mark Brown wrote:
On Mon, Nov 09, 2015 at 11:19:59PM +0530, Vinod Koul wrote:
From: Jeeja KP jeeja.kp@intel.com
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
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
On Wed, Nov 18, 2015 at 07:18:43PM +0530, Vinod Koul wrote:
On Wed, Nov 18, 2015 at 01:17:57PM +0000, Mark Brown wrote:
On Mon, Nov 09, 2015 at 11:19:59PM +0530, Vinod Koul wrote:
From: Jeeja KP jeeja.kp@intel.com
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
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
Hi Mark,
Any recommendations on this, how do we go about this
Thanks
On Wed, Nov 18, 2015 at 07:18:43PM +0530, Vinod Koul wrote:
On Wed, Nov 18, 2015 at 01:17:57PM +0000, Mark Brown wrote:
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
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.
On Mon, Nov 30, 2015 at 04:25:48PM +0000, Mark Brown wrote:
On Wed, Nov 18, 2015 at 07:18:43PM +0530, Vinod Koul wrote:
On Wed, Nov 18, 2015 at 01:17:57PM +0000, Mark Brown wrote:
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
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
On Tue, Dec 01, 2015 at 08:26:54AM +0530, Vinod Koul wrote:
On Mon, Nov 30, 2015 at 04:25:48PM +0000, Mark Brown wrote:
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.
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?
On Tue, Dec 01, 2015 at 12:27:47PM +0000, Mark Brown wrote:
On Tue, Dec 01, 2015 at 08:26:54AM +0530, Vinod Koul wrote:
On Mon, Nov 30, 2015 at 04:25:48PM +0000, Mark Brown wrote:
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.
ok fine then
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
On Wed, Dec 02, 2015 at 10:53:30AM +0530, Vinod Koul wrote:
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?
On Wed, Dec 02, 2015 at 10:32:41AM +0000, Mark Brown wrote:
On Wed, Dec 02, 2015 at 10:53:30AM +0530, Vinod Koul wrote:
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?
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
On Wed, Dec 16, 2015 at 08:18:06PM +0530, Vinod Koul wrote:
On Wed, Dec 02, 2015 at 10:32:41AM +0000, Mark Brown wrote:
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 :)
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.
On Wed, Dec 30, 2015 at 06:03:44PM +0000, Mark Brown wrote:
On Wed, Dec 16, 2015 at 08:18:06PM +0530, Vinod Koul wrote:
On Wed, Dec 02, 2015 at 10:32:41AM +0000, Mark Brown wrote:
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 :)
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..
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
From: Mythri P K mythri.p.k@intel.com
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
Signed-off-by: Mythri P K mythri.p.k@intel.com Signed-off-by: Jeeja KP jeeja.kp@intel.com Signed-off-by: Vinod Koul vinod.koul@intel.com --- include/sound/soc-topology.h | 6 ++++-- include/sound/soc.h | 6 ++++-- sound/soc/soc-ops.c | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/include/sound/soc-topology.h b/include/sound/soc-topology.h index 086cd7ff6ddc..5b68e3f5aa85 100644 --- a/include/sound/soc-topology.h +++ b/include/sound/soc-topology.h @@ -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); };
/* diff --git a/include/sound/soc.h b/include/sound/soc.h index e93927789d98..e09673dbae1b 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -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 */ diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c index ecd38e52285a..ba3e49010ac3 100644 --- a/sound/soc/soc-ops.c +++ b/sound/soc/soc-ops.c @@ -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;
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
From a1e5e7e9b36f360bf75e4f0f7ceb899682f213bd Mon Sep 17 00:00:00 2001
From: Mythri P K mythri.p.k@intel.com 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
Signed-off-by: Mythri P K mythri.p.k@intel.com Signed-off-by: Jeeja KP jeeja.kp@intel.com Signed-off-by: Vinod Koul vinod.koul@intel.com Signed-off-by: Mark Brown broonie@kernel.org --- include/sound/soc-topology.h | 6 ++++-- include/sound/soc.h | 6 ++++-- sound/soc/soc-ops.c | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/include/sound/soc-topology.h b/include/sound/soc-topology.h index 086cd7ff6ddc..5b68e3f5aa85 100644 --- a/include/sound/soc-topology.h +++ b/include/sound/soc-topology.h @@ -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); };
/* diff --git a/include/sound/soc.h b/include/sound/soc.h index a8b4b9c8b1d2..6603155f50ca 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -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 */ diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c index ecd38e52285a..ba3e49010ac3 100644 --- a/sound/soc/soc-ops.c +++ b/sound/soc/soc-ops.c @@ -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;
From: Omair M Abdullah omair.m.abdullah@intel.com
topology core used wrong callback for TLV bytes control, it should be snd_soc_bytes_info_ext and not snd_soc_bytes_info
Signed-off-by: Omair M Abdullah omair.m.abdullah@intel.com Signed-off-by: Vinod Koul vinod.koul@intel.com --- sound/soc/soc-topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 69d01cd925ce..a697f9fc8495 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -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;
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
From f4be978b9611c94f20cdc8cee540ef1a52f8875c Mon Sep 17 00:00:00 2001
From: Omair M Abdullah omair.m.abdullah@intel.com 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
Signed-off-by: Omair M Abdullah omair.m.abdullah@intel.com Signed-off-by: Vinod Koul vinod.koul@intel.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/soc-topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 8d7ec80af51b..50f21ed00cfa 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -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;
participants (2)
-
Mark Brown
-
Vinod Koul