struct snd_soc_dai;
struct snd_soc_dapm_route;
-/* object scan be loaded and unloaded in groups with identfying indexes */
-#define SND_SOC_TPLG_INDEX_ALL 0 /* ID that matches all FW objects */
-
/* dynamic object type */
enum snd_soc_dobj_type {
SND_SOC_DOBJ_NONE = 0, /* object is not dynamic */
/* Dynamic Object loading and removal for component drivers */
int snd_soc_tplg_component_load(struct snd_soc_component *comp,
- struct snd_soc_tplg_ops *ops, const struct firmware *fw,
- u32 index);
-int snd_soc_tplg_component_remove(struct snd_soc_component *comp, u32 index);
+ struct snd_soc_tplg_ops *ops, const struct firmware *fw);
+int snd_soc_tplg_component_remove(struct snd_soc_component *comp);
/* Binds event handlers to dynamic widgets */
int snd_soc_tplg_widget_bind_event(struct snd_soc_dapm_widget *w,
}
component_load:
-
- /*
- * The complete tplg for SKL is loaded as index 0, we don't use
- * any other index
- */
- ret = snd_soc_tplg_component_load(component, &skl_tplg_ops, fw, 0);
+ ret = snd_soc_tplg_component_load(component, &skl_tplg_ops, fw);
if (ret < 0) {
dev_err(bus->dev, "tplg component load failed%d\n", ret);
goto err;
list_del(&ppl->node);
/* clean up topology */
- snd_soc_tplg_component_remove(component, SND_SOC_TPLG_INDEX_ALL);
+ snd_soc_tplg_component_remove(component);
}
struct device *dev;
struct snd_soc_component *comp;
u32 index; /* current block index */
- u32 req_index; /* required index, only loaded/free matching blocks */
/* vendor specific kcontrol operations */
const struct snd_soc_tplg_kcontrol_ops *io_ops;
tplg->pos = tplg->hdr_pos + sizeof(struct snd_soc_tplg_hdr);
- /* check for matching ID */
- if (le32_to_cpu(hdr->index) != tplg->req_index &&
- tplg->req_index != SND_SOC_TPLG_INDEX_ALL)
- return 0;
-
tplg->index = le32_to_cpu(hdr->index);
switch (le32_to_cpu(hdr->type)) {
/* load audio component topology from "firmware" file */
int snd_soc_tplg_component_load(struct snd_soc_component *comp,
- struct snd_soc_tplg_ops *ops, const struct firmware *fw, u32 id)
+ struct snd_soc_tplg_ops *ops, const struct firmware *fw)
{
struct soc_tplg tplg;
int ret;
tplg.dev = comp->dev;
tplg.comp = comp;
tplg.ops = ops;
- tplg.req_index = id;
tplg.io_ops = ops->io_ops;
tplg.io_ops_count = ops->io_ops_count;
tplg.bytes_ext_ops = ops->bytes_ext_ops;
ret = soc_tplg_load(&tplg);
/* free the created components if fail to load topology */
if (ret)
- snd_soc_tplg_component_remove(comp, SND_SOC_TPLG_INDEX_ALL);
+ snd_soc_tplg_component_remove(comp);
return ret;
}
EXPORT_SYMBOL_GPL(snd_soc_tplg_component_load);
/* remove dynamic controls from the component driver */
-int snd_soc_tplg_component_remove(struct snd_soc_component *comp, u32 index)
+int snd_soc_tplg_component_remove(struct snd_soc_component *comp)
{
struct snd_soc_dobj *dobj, *next_dobj;
int pass = SOC_TPLG_PASS_END;
list_for_each_entry_safe(dobj, next_dobj, &comp->dobj_list,
list) {
- /* match index */
- if (dobj->index != index &&
- index != SND_SOC_TPLG_INDEX_ALL)
- continue;
-
switch (dobj->type) {
case SND_SOC_DOBJ_MIXER:
remove_mixer(comp, dobj, pass);