[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAEVJM+qkLtTfBOeG_UaCZjBHycdiUAnsuKJSxzz9yK=95vr9rw@mail.gmail.com>
Date: Wed, 8 Nov 2023 15:33:52 +0100
From: Brandon Cheo Fusi <fusibrandon13@...il.com>
To: linux-kernel@...r.kernel.org
Subject: Fwd: [PATCH] regmap: add regmap_update_bits variant to autoshift mask
---------- Forwarded message ---------
From: Brandon Cheo Fusi <fusibrandon13@...il.com>
Date: Wed, Nov 8, 2023 at 11:18 AM
Subject: Re: [PATCH] regmap: add regmap_update_bits variant to autoshift mask
To: Mark Brown <broonie@...nel.org>
On Mon, Nov 6, 2023 at 5:54 PM Mark Brown <broonie@...nel.org> wrote:
>
> On Mon, Nov 06, 2023 at 05:34:06PM +0100, Brandon Cheo Fusi wrote:
>
> > +static inline int regmap_update_bits_autoshift_val(struct regmap *map, unsigned int reg,
> > + unsigned int mask, unsigned int val)
> > +{
>
> Really not a fan of the name here, and in any case if the shifting of
> the value is an issue wouldn't this be a good case for using a field?
True. But all this does is handle the special and very common case of
'regmap_update_bits(regmap, reg, GENMASK(hi,lo), val)' where [hi,lo]
isn't at the bottom of reg. Most drivers don't resort to allocating
regmap_fields for each bit range they manipulate.
>
> Please also add kunit testcases for new APIs.
I'd be happy to send a v2 with kunit testcases, if you think the API is
worthwhile.
Powered by blists - more mailing lists