mirror of
https://github.com/torvalds/linux.git
synced 2024-11-19 18:41:48 +00:00
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. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
2ea659a9ef
commit
c8597af855
@ -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 @@ widget:
|
||||
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:
|
||||
|
Loading…
Reference in New Issue
Block a user