All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: topology: create tlv before soc_tplg_init_kcontrol
@ 2019-03-13 13:49 Bard liao
  2019-03-14  5:12 ` Pierre-Louis Bossart
  2019-03-15 17:15 ` Applied "ASoC: topology: create tlv before soc_tplg_init_kcontrol" to the asoc tree Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Bard liao @ 2019-03-13 13:49 UTC (permalink / raw)
  To: broonie
  Cc: tiwai, liam.r.girdwood, alsa-devel, pierre-louis.bossart, bard.liao

Component driver may want to use tlv data. Create tlv before
soc_tplg_init_kcontrol so component driver can use the tlv data
in the control_load ops.

Signed-off-by: Bard liao <yung-chuan.liao@linux.intel.com>
---
 sound/soc/soc-topology.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index 25fca7055464..fbee4720b834 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -894,19 +894,20 @@ static int soc_tplg_dmixer_create(struct soc_tplg *tplg, unsigned int count,
 			continue;
 		}
 
+		/* create any TLV data */
+		soc_tplg_create_tlv(tplg, &kc, &mc->hdr);
+
 		/* pass control to driver for optional further init */
 		err = soc_tplg_init_kcontrol(tplg, &kc,
 			(struct snd_soc_tplg_ctl_hdr *) mc);
 		if (err < 0) {
 			dev_err(tplg->dev, "ASoC: failed to init %s\n",
 				mc->hdr.name);
+			soc_tplg_free_tlv(tplg, &kc);
 			kfree(sm);
 			continue;
 		}
 
-		/* create any TLV data */
-		soc_tplg_create_tlv(tplg, &kc, &mc->hdr);
-
 		/* register control here */
 		err = soc_tplg_add_kcontrol(tplg, &kc,
 			&sm->dobj.control.kcontrol);
@@ -1324,18 +1325,19 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_dmixer_create(
 			continue;
 		}
 
+		/* create any TLV data */
+		soc_tplg_create_tlv(tplg, &kc[i], &mc->hdr);
+
 		/* pass control to driver for optional further init */
 		err = soc_tplg_init_kcontrol(tplg, &kc[i],
 			(struct snd_soc_tplg_ctl_hdr *)mc);
 		if (err < 0) {
 			dev_err(tplg->dev, "ASoC: failed to init %s\n",
 				mc->hdr.name);
+			soc_tplg_free_tlv(tplg, &kc[i]);
 			kfree(sm);
 			continue;
 		}
-
-		/* create any TLV data */
-		soc_tplg_create_tlv(tplg, &kc[i], &mc->hdr);
 	}
 	return kc;
 
-- 
2.17.1

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

* Re: [PATCH] ASoC: topology: create tlv before soc_tplg_init_kcontrol
  2019-03-13 13:49 [PATCH] ASoC: topology: create tlv before soc_tplg_init_kcontrol Bard liao
@ 2019-03-14  5:12 ` Pierre-Louis Bossart
  2019-03-15 17:15 ` Applied "ASoC: topology: create tlv before soc_tplg_init_kcontrol" to the asoc tree Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Pierre-Louis Bossart @ 2019-03-14  5:12 UTC (permalink / raw)
  To: Bard liao, broonie; +Cc: tiwai, liam.r.girdwood, alsa-devel, bard.liao

On 3/13/19 8:49 AM, Bard liao wrote:
> Component driver may want to use tlv data. Create tlv before
> soc_tplg_init_kcontrol so component driver can use the tlv data
> in the control_load ops.
> 
> Signed-off-by: Bard liao <yung-chuan.liao@linux.intel.com>

Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

> ---
>   sound/soc/soc-topology.c | 14 ++++++++------
>   1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
> index 25fca7055464..fbee4720b834 100644
> --- a/sound/soc/soc-topology.c
> +++ b/sound/soc/soc-topology.c
> @@ -894,19 +894,20 @@ static int soc_tplg_dmixer_create(struct soc_tplg *tplg, unsigned int count,
>   			continue;
>   		}
>   
> +		/* create any TLV data */
> +		soc_tplg_create_tlv(tplg, &kc, &mc->hdr);
> +
>   		/* pass control to driver for optional further init */
>   		err = soc_tplg_init_kcontrol(tplg, &kc,
>   			(struct snd_soc_tplg_ctl_hdr *) mc);
>   		if (err < 0) {
>   			dev_err(tplg->dev, "ASoC: failed to init %s\n",
>   				mc->hdr.name);
> +			soc_tplg_free_tlv(tplg, &kc);
>   			kfree(sm);
>   			continue;
>   		}
>   
> -		/* create any TLV data */
> -		soc_tplg_create_tlv(tplg, &kc, &mc->hdr);
> -
>   		/* register control here */
>   		err = soc_tplg_add_kcontrol(tplg, &kc,
>   			&sm->dobj.control.kcontrol);
> @@ -1324,18 +1325,19 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_dmixer_create(
>   			continue;
>   		}
>   
> +		/* create any TLV data */
> +		soc_tplg_create_tlv(tplg, &kc[i], &mc->hdr);
> +
>   		/* pass control to driver for optional further init */
>   		err = soc_tplg_init_kcontrol(tplg, &kc[i],
>   			(struct snd_soc_tplg_ctl_hdr *)mc);
>   		if (err < 0) {
>   			dev_err(tplg->dev, "ASoC: failed to init %s\n",
>   				mc->hdr.name);
> +			soc_tplg_free_tlv(tplg, &kc[i]);
>   			kfree(sm);
>   			continue;
>   		}
> -
> -		/* create any TLV data */
> -		soc_tplg_create_tlv(tplg, &kc[i], &mc->hdr);
>   	}
>   	return kc;
>   
> 

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

* Applied "ASoC: topology: create tlv before soc_tplg_init_kcontrol" to the asoc tree
  2019-03-13 13:49 [PATCH] ASoC: topology: create tlv before soc_tplg_init_kcontrol Bard liao
  2019-03-14  5:12 ` Pierre-Louis Bossart
@ 2019-03-15 17:15 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2019-03-15 17:15 UTC (permalink / raw)
  To: Bard liao
  Cc: alsa-devel, tiwai, pierre-louis.bossart, liam.r.girdwood,
	broonie, bard.liao

The patch

   ASoC: topology: create tlv before soc_tplg_init_kcontrol

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 3789debfc379ac84b90e2db32d7a6b66d28a2c7c Mon Sep 17 00:00:00 2001
From: Bard liao <yung-chuan.liao@linux.intel.com>
Date: Wed, 13 Mar 2019 21:49:43 +0800
Subject: [PATCH] ASoC: topology: create tlv before soc_tplg_init_kcontrol

Component driver may want to use tlv data. Create tlv before
soc_tplg_init_kcontrol so component driver can use the tlv data
in the control_load ops.

Signed-off-by: Bard liao <yung-chuan.liao@linux.intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/soc-topology.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index 25fca7055464..fbee4720b834 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -894,19 +894,20 @@ static int soc_tplg_dmixer_create(struct soc_tplg *tplg, unsigned int count,
 			continue;
 		}
 
+		/* create any TLV data */
+		soc_tplg_create_tlv(tplg, &kc, &mc->hdr);
+
 		/* pass control to driver for optional further init */
 		err = soc_tplg_init_kcontrol(tplg, &kc,
 			(struct snd_soc_tplg_ctl_hdr *) mc);
 		if (err < 0) {
 			dev_err(tplg->dev, "ASoC: failed to init %s\n",
 				mc->hdr.name);
+			soc_tplg_free_tlv(tplg, &kc);
 			kfree(sm);
 			continue;
 		}
 
-		/* create any TLV data */
-		soc_tplg_create_tlv(tplg, &kc, &mc->hdr);
-
 		/* register control here */
 		err = soc_tplg_add_kcontrol(tplg, &kc,
 			&sm->dobj.control.kcontrol);
@@ -1324,18 +1325,19 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_dmixer_create(
 			continue;
 		}
 
+		/* create any TLV data */
+		soc_tplg_create_tlv(tplg, &kc[i], &mc->hdr);
+
 		/* pass control to driver for optional further init */
 		err = soc_tplg_init_kcontrol(tplg, &kc[i],
 			(struct snd_soc_tplg_ctl_hdr *)mc);
 		if (err < 0) {
 			dev_err(tplg->dev, "ASoC: failed to init %s\n",
 				mc->hdr.name);
+			soc_tplg_free_tlv(tplg, &kc[i]);
 			kfree(sm);
 			continue;
 		}
-
-		/* create any TLV data */
-		soc_tplg_create_tlv(tplg, &kc[i], &mc->hdr);
 	}
 	return kc;
 
-- 
2.20.1

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

end of thread, other threads:[~2019-03-15 17:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-13 13:49 [PATCH] ASoC: topology: create tlv before soc_tplg_init_kcontrol Bard liao
2019-03-14  5:12 ` Pierre-Louis Bossart
2019-03-15 17:15 ` Applied "ASoC: topology: create tlv before soc_tplg_init_kcontrol" to the asoc tree Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.