From: Mark Brown <broonie@kernel.org>
To: Jiaxin Yu <jiaxin.yu@mediatek.com>
Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org,
angelogioacchino.delregno@collabora.com
Subject: Re: [PATCH] ASoC: mediatek: mt6358: Add "Dmic Mode Switch" kcontrol for switch DMIC mode.
Date: Wed, 12 Jun 2024 21:29:34 +0100 [thread overview]
Message-ID: <ZmoFLizJO-J0N-m2@finisterre.sirena.org.uk> (raw)
In-Reply-To: <20240612094155.23354-1-jiaxin.yu@mediatek.com>
[-- Attachment #1: Type: text/plain, Size: 682 bytes --]
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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2024-06-12 20:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-12 9:41 Jiaxin Yu
2024-06-12 20:29 ` Mark Brown [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZmoFLizJO-J0N-m2@finisterre.sirena.org.uk \
--to=broonie@kernel.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=jiaxin.yu@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-sound@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®