mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	topology: Add support for vendor tokens
Vendor can define a token list in SectionVendorTokens. Each token element is a pair of string ID and integer value. And both the ID and value are vendor-specific. Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
		
							parent
							
								
									768a006089
								
							
						
					
					
						commit
						9b751b38cb
					
				
					 5 changed files with 79 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -173,6 +173,14 @@ static int tplg_parse_config(snd_tplg_t *tplg, snd_config_t *cfg)
 | 
			
		|||
			continue;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if (strcmp(id, "SectionVendorTokens") == 0) {
 | 
			
		||||
			err = tplg_parse_compound(tplg, n, tplg_parse_tokens,
 | 
			
		||||
				NULL);
 | 
			
		||||
			if (err < 0)
 | 
			
		||||
				return err;
 | 
			
		||||
			continue;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		SNDERR("error: unknown section %s\n", id);
 | 
			
		||||
	}
 | 
			
		||||
	return 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -407,6 +415,7 @@ snd_tplg_t *snd_tplg_new(void)
 | 
			
		|||
	INIT_LIST_HEAD(&tplg->mixer_list);
 | 
			
		||||
	INIT_LIST_HEAD(&tplg->enum_list);
 | 
			
		||||
	INIT_LIST_HEAD(&tplg->bytes_ext_list);
 | 
			
		||||
	INIT_LIST_HEAD(&tplg->token_list);
 | 
			
		||||
 | 
			
		||||
	return tplg;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -426,6 +435,7 @@ void snd_tplg_free(snd_tplg_t *tplg)
 | 
			
		|||
	tplg_elem_free_list(&tplg->mixer_list);
 | 
			
		||||
	tplg_elem_free_list(&tplg->enum_list);
 | 
			
		||||
	tplg_elem_free_list(&tplg->bytes_ext_list);
 | 
			
		||||
	tplg_elem_free_list(&tplg->token_list);
 | 
			
		||||
 | 
			
		||||
	free(tplg);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue