mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	topology: Add element ID so we can look up references by name.
Add support to lookup elements by name. This is in preparation for adding some new API calls that will allow building topology data using a C API. This will allow applications to build their own topology data directly. Signed-off-by: Jin Yao <yao.jin@linux.intel.com> Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
		
							parent
							
								
									1bb4c2fc30
								
							
						
					
					
						commit
						120b3b8ead
					
				
					 7 changed files with 24 additions and 18 deletions
				
			
		| 
						 | 
				
			
			@ -264,7 +264,7 @@ int tplg_parse_tlv(snd_tplg_t *tplg, snd_config_t *cfg,
 | 
			
		|||
	int err = 0;
 | 
			
		||||
	struct tplg_elem *elem;
 | 
			
		||||
 | 
			
		||||
	elem = tplg_elem_new_common(tplg, cfg, OBJECT_TYPE_TLV);
 | 
			
		||||
	elem = tplg_elem_new_common(tplg, cfg, NULL, OBJECT_TYPE_TLV);
 | 
			
		||||
	if (!elem)
 | 
			
		||||
		return -ENOMEM;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -298,7 +298,7 @@ int tplg_parse_control_bytes(snd_tplg_t *tplg,
 | 
			
		|||
	const char *id, *val = NULL;
 | 
			
		||||
	int err;
 | 
			
		||||
 | 
			
		||||
	elem = tplg_elem_new_common(tplg, cfg, OBJECT_TYPE_BYTES);
 | 
			
		||||
	elem = tplg_elem_new_common(tplg, cfg, NULL, OBJECT_TYPE_BYTES);
 | 
			
		||||
	if (!elem)
 | 
			
		||||
		return -ENOMEM;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -403,11 +403,10 @@ int tplg_parse_control_enum(snd_tplg_t *tplg, snd_config_t *cfg,
 | 
			
		|||
	const char *id, *val = NULL;
 | 
			
		||||
	int err, j;
 | 
			
		||||
 | 
			
		||||
	elem = tplg_elem_new_common(tplg, cfg, OBJECT_TYPE_ENUM);
 | 
			
		||||
	elem = tplg_elem_new_common(tplg, cfg, NULL, OBJECT_TYPE_ENUM);
 | 
			
		||||
	if (!elem)
 | 
			
		||||
		return -ENOMEM;
 | 
			
		||||
 | 
			
		||||
	/* init new mixer */
 | 
			
		||||
	ec = elem->enum_ctrl;
 | 
			
		||||
	elem_copy_text(ec->hdr.name, elem->id, SNDRV_CTL_ELEM_ID_NAME_MAXLEN);
 | 
			
		||||
	ec->hdr.type = SND_SOC_TPLG_TYPE_ENUM;
 | 
			
		||||
| 
						 | 
				
			
			@ -501,7 +500,7 @@ int tplg_parse_control_mixer(snd_tplg_t *tplg,
 | 
			
		|||
	const char *id, *val = NULL;
 | 
			
		||||
	int err, j;
 | 
			
		||||
 | 
			
		||||
	elem = tplg_elem_new_common(tplg, cfg, OBJECT_TYPE_MIXER);
 | 
			
		||||
	elem = tplg_elem_new_common(tplg, cfg, NULL, OBJECT_TYPE_MIXER);
 | 
			
		||||
	if (!elem)
 | 
			
		||||
		return -ENOMEM;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue