Re: [PATCH v8 5/9] ASoC: qcom: lpass-va-macro: Add SoundWire microphone support

From: Mark Brown

Date: Fri Dec 04 2026 - 13:12:32 EST


> The VA decimators can currently capture audio only from DMIC inputs.
> Add support for routing audio from SoundWire microphone (SMIC) inputs
> as well.

> +static int va_macro_put_dec_mux(struct snd_kcontrol *kcontrol,
> + struct snd_ctl_elem_value *ucontrol)
> +{
> + struct snd_soc_dapm_widget *widget = snd_soc_dapm_kcontrol_to_widget(kcontrol);
> + struct snd_soc_component *component =
> + snd_soc_dapm_to_component(widget->dapm);
> + struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
> + unsigned int val;
> + u16 mic_sel_reg;
> +
> + val = ucontrol->value.enumerated.item[0];

...

> + /*
> + * This mux selects the input domain of the decimator, so ADC_DMIC_SEL
> + * has to follow it. When both sub muxes have an input selected the
> + * decimator stays powered across the switch, so va_macro_enable_dec()
> + * does not run and would leave ADC_DMIC_SEL on the previous domain.
> + */
> + snd_soc_component_update_bits(component, mic_sel_reg,
> + CDC_VA_TX_PATH_ADC_DMIC_SEL_MASK,
> + val ? CDC_VA_TX_PATH_ADC_DMIC_SEL_ADC :
> + CDC_VA_TX_PATH_ADC_DMIC_SEL_DMIC);

The value ends up being constrained by this ternery but we should really
validate the enum passed in from userspace. Should we also have some
sync with DAPM here - I think these get read during power up?

--
Mark Brown <broonie@xxxxxxxxxx>