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
- References:
- Prev by Date: Re: [PATCH v3 0/2] Fixes for McASP and dmaengine_pcm
- Next by Date: [PATCH v2] ASoC: mediatek: mt6358: Add "Dmic Mode Switch" kcontrol for switch DMIC mode.
- Previous by thread: [PATCH] ASoC: mediatek: mt6358: Add "Dmic Mode Switch" kcontrol for switch DMIC mode.
- Next by thread: [PATCH v2] dt-bindings: ASoC: wlf,wm8782: Convert to dtschema
- Index(es):