mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-10 06:05:43 +01:00
topology: pre-process-obejct: add helper function to get the section config
Add a helper function to retrieve the config node pointing to the section name for a given object. For ex: for the object, Object.Widget.pga.1{}, the function returns the config with id, "SectionWidget" in the output config. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
571d1fe871
commit
48fef7a811
2 changed files with 19 additions and 0 deletions
|
@ -738,6 +738,24 @@ static const struct build_function_map *tplg_object_get_map(struct tplg_pre_proc
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* search for section name based on class type and name and return the config in output_cfg */
|
||||||
|
snd_config_t *tplg_object_get_section(struct tplg_pre_processor *tplg_pp, snd_config_t *class)
|
||||||
|
{
|
||||||
|
const struct build_function_map *map;
|
||||||
|
snd_config_t *cfg = NULL;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
map = tplg_object_get_map(tplg_pp, class);
|
||||||
|
if (!map)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
ret = snd_config_search(tplg_pp->output_cfg, map->section_name, &cfg);
|
||||||
|
if (ret < 0)
|
||||||
|
SNDERR("Section config for %s not found\n", map->section_name);
|
||||||
|
|
||||||
|
return cfg;
|
||||||
|
}
|
||||||
|
|
||||||
/* return 1 if attribute not found in search_config, 0 on success and negative value on error */
|
/* return 1 if attribute not found in search_config, 0 on success and negative value on error */
|
||||||
static int tplg_object_copy_and_add_param(struct tplg_pre_processor *tplg_pp,
|
static int tplg_object_copy_and_add_param(struct tplg_pre_processor *tplg_pp,
|
||||||
snd_config_t *obj,
|
snd_config_t *obj,
|
||||||
|
|
|
@ -61,6 +61,7 @@ snd_config_t *tplg_object_get_instance_config(struct tplg_pre_processor *tplg_pp
|
||||||
snd_config_t *class_type);
|
snd_config_t *class_type);
|
||||||
const char *tplg_object_get_name(struct tplg_pre_processor *tplg_pp,
|
const char *tplg_object_get_name(struct tplg_pre_processor *tplg_pp,
|
||||||
snd_config_t *object);
|
snd_config_t *object);
|
||||||
|
snd_config_t *tplg_object_get_section(struct tplg_pre_processor *tplg_pp, snd_config_t *class);
|
||||||
|
|
||||||
/* class helpers */
|
/* class helpers */
|
||||||
snd_config_t *tplg_class_lookup(struct tplg_pre_processor *tplg_pp, snd_config_t *cfg);
|
snd_config_t *tplg_class_lookup(struct tplg_pre_processor *tplg_pp, snd_config_t *cfg);
|
||||||
|
|
Loading…
Reference in a new issue