[PATCH v8 18/22] ASoC: qdsp6: audioreach: add topology support

Pierre-Louis Bossart pierre-louis.bossart at linux.intel.com
Mon Sep 27 18:21:00 CEST 2021


> +static int audioreach_control_load_mix(struct snd_soc_component *scomp,
> +				       struct snd_ar_control *scontrol,
> +				       struct snd_kcontrol_new *kc,
> +				       struct snd_soc_tplg_ctl_hdr *hdr)
> +{
> +	struct snd_soc_tplg_vendor_value_elem *c_elem;
> +	struct snd_soc_tplg_vendor_array *c_array;
> +	struct snd_soc_tplg_mixer_control *mc;
> +	int tkn_count = 0;
> +
> +	mc = container_of(hdr, struct snd_soc_tplg_mixer_control, hdr);
> +	c_array = (struct snd_soc_tplg_vendor_array *)mc->priv.data;
> +
> +	c_elem = c_array->value;
> +
> +	while (tkn_count <= (le32_to_cpu(c_array->num_elems) - 1)) {
> +		switch (le32_to_cpu(c_elem->token)) {
> +		case AR_TKN_U32_SUB_GRAPH_INSTANCE_ID:
> +			scontrol->sgid = le32_to_cpu(c_elem->value);
> +			break;
> +		default:
> +			/* Ignore other tokens */
> +		break;

indentation still off

> +
> +		}
> +		c_elem++;
> +		tkn_count++;
> +	}
> +
> +	return 0;
> +}


More information about the Alsa-devel mailing list