ASoC: topology: Fix build by declaring snd_kcontrol_new and soc_dai_link.
PATCH 1/1 ASoC: topology: Fix build by declaring snd_kcontrol_new and soc_dai_link.
Both are used within this header so need to be declared.
--- include/sound/soc-topology.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
include/sound/soc-topology.h +7 -1
@@ -28,6 +28,8 @@ struct snd_soc_component;struct snd_soc_tplg_pcm_fe ;struct snd_soc_dapm_context ;struct snd_soc_card ; +struct snd_kcontrol_new ; +struct snd_soc_dai_link ;/* object scan be loaded and unloaded in groups with identfying indexes */ #define SND_SOC_TPLG_INDEX_ALL 0/* ID that matches all FW objects */
@@ -116,12 +118,16 @@ struct snd_soc_tplg_ops {int (*widget_load)(struct snd_soc_component *,struct snd_soc_dapm_widget *,struct snd_soc_tplg_dapm_widget *); +int (*widget_ready)(struct snd_soc_component *, +struct snd_soc_dapm_widget *, +struct snd_soc_tplg_dapm_widget *);int (*widget_unload)(struct snd_soc_component *,struct snd_soc_dobj *);/* FE DAI - used for any driver specific init */ int (*dai_load)(struct snd_soc_component *, -struct snd_soc_dai_driver *dai_drv); +struct snd_soc_dai_driver *dai_drv, +struct snd_soc_tplg_pcm *pcm,struct snd_soc_dai *dai);int (*dai_unload)(struct snd_soc_component *,struct snd_soc_dobj *);
Signature · 1 line
2.11.0
PATCH 1/1 ASoC: topology: Allow bespoke configuration post widget creation
Current topology only allows for widget configuration before the widget is registered. This patch also allows further configuration and usage after registration is complete.
--- sound/soc/soc-topology.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-)
sound/soc/soc-topology.c +22 -2
@@ -344,12 +344,24 @@ static int soc_tplg_widget_load(struct soc_tplg *tplg,return 0 ; } +/* optionally pass new dynamic widget to component driver. This is mainly for +* external widgets where we can assign private data/ops */ +static int soc_tplg_widget_ready (struct soc_tplg *tplg, +struct snd_soc_dapm_widget *w,struct snd_soc_tplg_dapm_widget *tplg_w) +{ +if (tplg->comp && tplg->ops && tplg->ops->widget_ready) +return tplg->ops->widget_ready (tplg->comp, w, tplg_w); + +return 0 ; +} +/* pass DAI configurations to component driver for extra initialization */ static int soc_tplg_dai_load (struct soc_tplg *tplg, -struct snd_soc_dai_driver *dai_drv) +struct snd_soc_dai_driver *dai_drv, +struct snd_soc_tplg_pcm *pcm,struct snd_soc_dai *dai) {if (tplg->comp && tplg->ops && tplg->ops->dai_load) -return tplg->ops->dai_load (tplg->comp, dai_drv); +return tplg->ops->dai_load (tplg->comp, dai_drv, pcm, dai);return 0 ; }
@@ -1580,8 +1592,16 @@ static int soc_tplg_dapm_widget_create(struct soc_tplg *tplg,kfree (template.sname);kfree (template.name);list_add (&widget->dobj.list, &tplg->comp->dobj_list); + + ret =soc_tplg_widget_ready (tplg, widget, w); +if (ret <0 ) + goto ready_err; +return 0 ; +ready_err: +snd_soc_tplg_widget_remove (widget); +snd_soc_dapm_free_widget (widget); hdr_err:kfree (template.sname); err:
Signature · 1 line
2.11.0
Mark Brown
maintainerApplied "ASoC: topology: Allow bespoke configuration post widget creation" to the asoc tree
The patch
ASoC: topology: Allow bespoke configuration post widget creation
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
c8597af855f3e34aaebaff0e5c3dbd07611c87f1Mon Sep 17 00:00:00 2001
From: Liam Girdwood <[email protected]>
Date: Tue, 6 Jun 2017 15:45:07 +0100
Subject: [PATCH] ASoC: topology: Allow bespoke configuration post widget
creation
Current topology only allows for widget configuration before the widget is registered. This patch also allows further configuration and usage after registration is complete.
--- sound/soc/soc-topology.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-)
sound/soc/soc-topology.c +22 -2
@@ -344,12 +344,24 @@ static int soc_tplg_widget_load(struct soc_tplg *tplg,return 0 ; } +/* optionally pass new dynamic widget to component driver. This is mainly for +* external widgets where we can assign private data/ops */ +static int soc_tplg_widget_ready (struct soc_tplg *tplg, +struct snd_soc_dapm_widget *w,struct snd_soc_tplg_dapm_widget *tplg_w) +{ +if (tplg->comp && tplg->ops && tplg->ops->widget_ready) +return tplg->ops->widget_ready (tplg->comp, w, tplg_w); + +return 0 ; +} +/* pass DAI configurations to component driver for extra initialization */ static int soc_tplg_dai_load (struct soc_tplg *tplg, -struct snd_soc_dai_driver *dai_drv) +struct snd_soc_dai_driver *dai_drv, +struct snd_soc_tplg_pcm *pcm,struct snd_soc_dai *dai) {if (tplg->comp && tplg->ops && tplg->ops->dai_load) -return tplg->ops->dai_load (tplg->comp, dai_drv); +return tplg->ops->dai_load (tplg->comp, dai_drv, pcm, dai);return 0 ; }
@@ -1580,8 +1592,16 @@ static int soc_tplg_dapm_widget_create(struct soc_tplg *tplg,kfree (template.sname);kfree (template.name);list_add (&widget->dobj.list, &tplg->comp->dobj_list); + + ret =soc_tplg_widget_ready (tplg, widget, w); +if (ret <0 ) + goto ready_err; +return 0 ; +ready_err: +snd_soc_tplg_widget_remove (widget); +snd_soc_dapm_free_widget (widget); hdr_err:kfree (template.sname); err:
Signature · 1 line
2.11.0
PATCH 1/1 ASoC: topology: rephrase deferred binding warning.
In reply to Liam GirdwoodRewrite the message to be more meaningful.
--- sound/soc/soc-topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/soc-topology.c +1 -1
@@ -1648,7 +1648,7 @@ static int soc_tplg_dapm_complete(struct soc_tplg *tplg)*/ if (!card || !card->instantiated) {dev_warn (tplg->dev,"ASoC: Parent card not yet available," -"Do not add new widgets now\n" ); +" widget card binding deferred\n" );return 0 ; }
Signature · 1 line
2.11.0
Mark Brown
maintainerApplied "ASoC: topology: rephrase deferred binding warning." to the asoc tree
The patch
ASoC: topology: rephrase deferred binding warning.
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
cc9d4714a8da98f905c63d74e9897fc6f4563fcaMon Sep 17 00:00:00 2001
From: Liam Girdwood <[email protected]>
Date: Tue, 6 Jun 2017 15:45:08 +0100
Subject: [PATCH] ASoC: topology: rephrase deferred binding warning.
Rewrite the message to be more meaningful.
--- sound/soc/soc-topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/soc-topology.c +1 -1
@@ -1648,7 +1648,7 @@ static int soc_tplg_dapm_complete(struct soc_tplg *tplg)*/ if (!card || !card->instantiated) {dev_warn (tplg->dev,"ASoC: Parent card not yet available," -"Do not add new widgets now\n" ); +" widget card binding deferred\n" );return 0 ; }
Signature · 1 line
2.11.0
PATCH 1/1 ASoC: topology: Dont free template strings whilst they are in use.
In reply to Liam GirdwoodTemplate name pointers are copied when creating new widgets and are freed in widget destroy.
--- sound/soc/soc-topology.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
sound/soc/soc-topology.c +1 -2
@@ -1477,6 +1477,7 @@ static int soc_tplg_dapm_widget_create(struct soc_tplg *tplg,if (template.id <0 )return template.id; +/* strings are allocated here, but used and freed by the widget */ template.name =kstrdup (w->name,GFP_KERNEL );if (!template.name)return -ENOMEM ;
@@ -1589,8 +1590,6 @@ static int soc_tplg_dapm_widget_create(struct soc_tplg *tplg, widget->dobj.widget.kcontrol_type = kcontrol_type; widget->dobj.ops = tplg->ops; widget->dobj.index = tplg->index; -kfree (template.sname); -kfree (template.name);list_add (&widget->dobj.list, &tplg->comp->dobj_list); ret =soc_tplg_widget_ready (tplg, widget, w);
Signature · 1 line
2.11.0
Mark Brown
maintainerApplied "ASoC: topology: Dont free template strings whilst they are in use." to the asoc tree
The patch
ASoC: topology: Dont free template strings whilst they are in use.
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
c3421a6a65abc636b067eb15a4c5e9cb59e91c95Mon Sep 17 00:00:00 2001
From: Liam Girdwood <[email protected]>
Date: Tue, 6 Jun 2017 15:45:09 +0100
Subject: [PATCH] ASoC: topology: Dont free template strings whilst they are in
use.
Template name pointers are copied when creating new widgets and are freed in widget destroy.
--- sound/soc/soc-topology.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
sound/soc/soc-topology.c +1 -2
@@ -1477,6 +1477,7 @@ static int soc_tplg_dapm_widget_create(struct soc_tplg *tplg,if (template.id <0 )return template.id; +/* strings are allocated here, but used and freed by the widget */ template.name =kstrdup (w->name,GFP_KERNEL );if (!template.name)return -ENOMEM ;
@@ -1589,8 +1590,6 @@ static int soc_tplg_dapm_widget_create(struct soc_tplg *tplg, widget->dobj.widget.kcontrol_type = kcontrol_type; widget->dobj.ops = tplg->ops; widget->dobj.index = tplg->index; -kfree (template.sname); -kfree (template.name);list_add (&widget->dobj.list, &tplg->comp->dobj_list); ret =soc_tplg_widget_ready (tplg, widget, w);
Signature · 1 line
2.11.0
Apologies, this one has changes from a future patch. Please ignore it.
Quoted 38 lines · Liam Girdwood
Both are used within this header so need to be declared.
Signed-off-by Liam Girdwood <[email protected]>--- include/sound/soc-topology.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)include/sound/soc-topology.h +7
-1@@ -28,6 +28,8 @@ struct snd_soc_component;struct snd_soc_tplg_pcm_fe ;struct snd_soc_dapm_context ;struct snd_soc_card ; +struct snd_kcontrol_new ; +struct snd_soc_dai_link ;/* object scan be loaded and unloaded in groups with identfying indexes */ #define SND_SOC_TPLG_INDEX_ALL 0/* ID that matches all FW objects */ @@ -116,12 +118,16 @@ struct snd_soc_tplg_ops {int (*widget_load)(struct snd_soc_component *,struct snd_soc_dapm_widget *,struct snd_soc_tplg_dapm_widget *); +int (*widget_ready)(struct snd_soc_component *, +struct snd_soc_dapm_widget *, +struct snd_soc_tplg_dapm_widget *);int (*widget_unload)(struct snd_soc_component *,struct snd_soc_dobj *);/* FE DAI - used for any driver specific init */ int (*dai_load)(struct snd_soc_component *, -struct snd_soc_dai_driver *dai_drv); +struct snd_soc_dai_driver *dai_drv, +struct snd_soc_tplg_pcm *pcm,struct snd_soc_dai *dai);int (*dai_unload)(struct snd_soc_component *,struct snd_soc_dobj *);