mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Mark Brown <broonie@kernel.org>
Cc: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>,
	David Rhodes <david.rhodes@cirrus.com>,
	Richard Fitzgerald <rf@opensource.cirrus.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	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 13:10:43 +0100	[thread overview]
Message-ID: <arUTQzogoZ1TJCh7@opensource.cirrus.com> (raw)
In-Reply-To: <0a1eb6d0-262a-4e19-b947-e9c810a79261@sirena.org.uk>

On Thu, Sep 24, 2026 at 01:04:16PM +0100, Mark Brown wrote:
> On Thu, Sep 24, 2026 at 10:47:02AM +0100, Charles Keepax wrote:
> > On Thu, Sep 24, 2026 at 04:34:12PM +0800, Peng Fan (OSS) wrote:
> 
> > > 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.
> 
> > > -	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).
> 
> No, it's _assign_bits() not _update_bits() so it'll set the bits
> specified in the third argument if the fourth argument is true.
> 
> > Also would be better to split this patch into two, one for the
> > mediatek stuff, one for the cirrus stuff.
> 
> Yes.

oops yeah, thanks for the correction.

Thanks,
Charles

      reply	other threads:[~2026-09-24 12:11 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
2026-09-24 12:04   ` Mark Brown
2026-09-24 12:10     ` Charles Keepax [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=arUTQzogoZ1TJCh7@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®