Re: [PATCH] ASoC: mediatek: mt6358: Add "Dmic Mode Switch" kcontrol for switch DMIC mode.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Wed, Jun 12, 2024 at 05:41:55PM +0800, Jiaxin Yu wrote:

> +static int mt6358_dmic_mode_set(struct snd_kcontrol *kcontrol,
> +				struct snd_ctl_elem_value *ucontrol)
> +{
> +	struct snd_soc_component *c = snd_soc_kcontrol_component(kcontrol);
> +	struct mt6358_priv *priv = snd_soc_component_get_drvdata(c);
> +	int enabled = ucontrol->value.integer.value[0];
> +
> +	if (priv->dmic_one_wire_mode != enabled) {
> +		priv->dmic_one_wire_mode = enabled;

This will allow any value to be written rather than just 0 or 1,
mixer-test should report that this is a bug - there should either be
validation or clamping of the value so it stays as either 0 or 1.  Both
options are valid.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Pulseaudio]     [Linux Audio Users]     [ALSA Devel]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux