From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
Cc: David Rhodes <david.rhodes@cirrus.com>,
Richard Fitzgerald <rf@opensource.cirrus.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
linux-kernel@vger.kernel.org, Peng Fan <peng.fan@nxp.com>,
linux-sound@vger.kernel.org, patches@opensource.cirrus.com,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org
Subject: Re: [PATCH] ASoC: use regmap_assign_bits() for conditional set/clear
Date: Thu, 24 Sep 2026 10:47:02 +0100 [thread overview]
Message-ID: <arTxlkxUFjg8EOJ2@opensource.cirrus.com> (raw)
In-Reply-To: <20260924083420.461715-1-peng.fan@oss.nxp.com>
On Thu, Sep 24, 2026 at 04:34:12PM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
>
> Replace if/else blocks using regmap_set_bits()/regmap_clear_bits() with
> the simpler regmap_assign_bits() calls in the cs35l45 codec and the
> mediatek mt8188 ADDA and DMIC DAI drivers.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
> sound/soc/codecs/cs35l45.c | 6 ++----
> sound/soc/mediatek/mt8188/mt8188-dai-adda.c | 5 +----
> sound/soc/mediatek/mt8188/mt8188-dai-dmic.c | 10 ++--------
> 3 files changed, 5 insertions(+), 16 deletions(-)
>
> diff --git a/sound/soc/codecs/cs35l45.c b/sound/soc/codecs/cs35l45.c
> index 0ab76824f00f1..9eef7c8b1837e 100644
> --- a/sound/soc/codecs/cs35l45.c
> +++ b/sound/soc/codecs/cs35l45.c
> @@ -224,10 +224,8 @@ static int cs35l45_sync_en_put(struct snd_kcontrol *kcontrol,
> return 0;
> }
>
> - if ((bool)ucontrol->value.integer.value[0])
> - regmap_set_bits(cs35l45->regmap, CS35L45_BLOCK_ENABLES2, CS35L45_SYNC_EN_MASK);
> - else
> - regmap_clear_bits(cs35l45->regmap, CS35L45_BLOCK_ENABLES2, CS35L45_SYNC_EN_MASK);
> + regmap_assign_bits(cs35l45->regmap, CS35L45_BLOCK_ENABLES2, CS35L45_SYNC_EN_MASK,
> + (bool)ucontrol->value.integer.value[0]);
This doesn't work value will be bit(0) but SYNC_EN is bit(8).
Also would be better to split this patch into two, one for the
mediatek stuff, one for the cirrus stuff.
Thanks,
Charles
next prev parent reply other threads:[~2026-09-24 9:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 8:34 Peng Fan (OSS)
2026-09-24 9:47 ` Charles Keepax [this message]
2026-09-24 12:04 ` Mark Brown
2026-09-24 12:10 ` Charles Keepax
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=arTxlkxUFjg8EOJ2@opensource.cirrus.com \
--to=ckeepax@opensource.cirrus.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=broonie@kernel.org \
--cc=david.rhodes@cirrus.com \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=lgirdwood@gmail.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 \
--cc=matthias.bgg@gmail.com \
--cc=patches@opensource.cirrus.com \
--cc=peng.fan@nxp.com \
--cc=peng.fan@oss.nxp.com \
--cc=perex@perex.cz \
--cc=rf@opensource.cirrus.com \
--cc=tiwai@suse.com \
/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®