[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZmoFLizJO-J0N-m2@finisterre.sirena.org.uk>
Date: Wed, 12 Jun 2024 21:29:34 +0100
From: Mark Brown <broonie@...nel.org>
To: Jiaxin Yu <jiaxin.yu@...iatek.com>
Cc: linux-sound@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org,
angelogioacchino.delregno@...labora.com
Subject: Re: [PATCH] ASoC: mediatek: mt6358: Add "Dmic Mode Switch" kcontrol
for switch DMIC mode.
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.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists