[PATCH v3 12/16] ASoC: tegra: Fix kcontrol put callback in MVC
Mark Brown
broonie at kernel.org
Thu Nov 18 14:49:49 CET 2021
On Thu, Nov 18, 2021 at 02:32:07PM +0100, Takashi Iwai wrote:
> Sameer Pujar wrote:
> > + old_mask = (value >> TEGRA210_MVC_MUTE_SHIFT) & TEGRA210_MUTE_MASK_EN;
> > + new_mask = ucontrol->value.integer.value[0];
> > +
> > + if (new_mask == old_mask) {
> > + err = 0;
> > + goto end;
> > + }
> >
> > err = regmap_update_bits(mvc->regmap, mc->reg,
> > TEGRA210_MVC_MUTE_MASK,
> > - mute_mask << TEGRA210_MVC_MUTE_SHIFT);
> > + new_mask << TEGRA210_MVC_MUTE_SHIFT);
> I guess this test-and-update procedure can be simplified with
> regmap_update_bits_check().
Yes, this is exactly the application that _update_bits_check() was
written for.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20211118/38044863/attachment.sig>
More information about the Alsa-devel
mailing list