mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-09 13:30:03 -05:00
topology: Store number of strings of a text section
Enum controls may use text elements and need the number of strings. This patch adds a text child object for a generic element. When parsing a text section from the configuation file, store the text strings and number of strings (num_items) in the text child object of the element. Reported-by: G Kranthi <gudishax.kranthikumar@intel.com> Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com> Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
f9633ed852
commit
f53ff68562
4 changed files with 14 additions and 6 deletions
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
static int parse_text_values(snd_config_t *cfg, struct tplg_elem *elem)
|
||||
{
|
||||
struct tplg_texts *texts = elem->texts;
|
||||
snd_config_iterator_t i, next;
|
||||
snd_config_t *n;
|
||||
const char *value = NULL;
|
||||
|
|
@ -44,13 +45,14 @@ static int parse_text_values(snd_config_t *cfg, struct tplg_elem *elem)
|
|||
if (snd_config_get_string(n, &value) < 0)
|
||||
continue;
|
||||
|
||||
elem_copy_text(&elem->texts[j][0], value,
|
||||
elem_copy_text(&texts->items[j][0], value,
|
||||
SNDRV_CTL_ELEM_ID_NAME_MAXLEN);
|
||||
tplg_dbg("\t%s\n", &elem->texts[j][0]);
|
||||
tplg_dbg("\t%s\n", &texts->items[j][0]);
|
||||
|
||||
j++;
|
||||
}
|
||||
|
||||
texts->num_items = j;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue