mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	topology: treat all DAPM controls types the same when copying
Copy all DAPM controls types using the same method. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
		
							parent
							
								
									80a8283d17
								
							
						
					
					
						commit
						ecf7fdaeef
					
				
					 1 changed files with 3 additions and 8 deletions
				
			
		| 
						 | 
				
			
			@ -107,8 +107,6 @@ static int tplg_parse_dapm_enums(snd_config_t *cfg, struct tplg_elem *elem)
 | 
			
		|||
static int copy_dapm_control(struct tplg_elem *elem, struct tplg_elem *ref)
 | 
			
		||||
{
 | 
			
		||||
	struct snd_soc_tplg_dapm_widget *widget = elem->widget;
 | 
			
		||||
	struct snd_soc_tplg_mixer_control *mixer_ctrl = ref->mixer_ctrl;
 | 
			
		||||
	struct snd_soc_tplg_enum_control *enum_ctrl = ref->enum_ctrl;
 | 
			
		||||
 | 
			
		||||
	tplg_dbg("Control '%s' used by '%s'\n", ref->id, elem->id);
 | 
			
		||||
	tplg_dbg("\tparent size: %d + %d -> %d, priv size -> %d\n",
 | 
			
		||||
| 
						 | 
				
			
			@ -121,13 +119,10 @@ static int copy_dapm_control(struct tplg_elem *elem, struct tplg_elem *ref)
 | 
			
		|||
 | 
			
		||||
	elem->widget = widget;
 | 
			
		||||
 | 
			
		||||
	/* copy new widget at the end */
 | 
			
		||||
	if (ref->type == OBJECT_TYPE_MIXER)
 | 
			
		||||
		memcpy((void*)widget + elem->size, mixer_ctrl, ref->size);
 | 
			
		||||
	else if (ref->type == OBJECT_TYPE_ENUM)
 | 
			
		||||
		memcpy((void*)widget + elem->size, enum_ctrl, ref->size);
 | 
			
		||||
 | 
			
		||||
	/* append the control to the end of the widget */
 | 
			
		||||
	memcpy((void*)widget + elem->size, ref->obj, ref->size);
 | 
			
		||||
	elem->size += ref->size;
 | 
			
		||||
 | 
			
		||||
	widget->num_kcontrols++;
 | 
			
		||||
	ref->compound_elem = 1;
 | 
			
		||||
	return 0;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue