Re: [RFC PATCH 1/3] mfd: syscon: Add reg_update_bits() callback support

From: Baolin Wang
Date: Thu Apr 09 2020 - 10:14:14 EST


On Thu, Apr 9, 2020 at 6:48 PM Mark Brown <broonie@xxxxxxxxxx> wrote:
>
> On Thu, Apr 09, 2020 at 04:57:57PM +0800, Baolin Wang wrote:
>
> > --- a/include/linux/regmap.h
> > +++ b/include/linux/regmap.h
> > @@ -340,6 +340,8 @@ struct regmap_access_table {
> > * read operation on a bus such as SPI, I2C, etc. Most of the
> > * devices do not need this.
> > * @reg_write: Same as above for writing.
> > + * @reg_update_bits: Optional, should only be provided for devices whose update
> > + * operation cannot be represented as read and write.
> > * @fast_io: Register IO is fast. Use a spinlock instead of a mutex
> > * to perform locking. This field is ignored if custom lock/unlock
> > * functions are used (see fields lock/unlock of struct regmap_config).
> > @@ -416,6 +418,8 @@ struct regmap_config {
> >
> > int (*reg_read)(void *context, unsigned int reg, unsigned int *val);
> > int (*reg_write)(void *context, unsigned int reg, unsigned int val);
> > + int (*reg_update_bits)(void *context, unsigned int reg,
> > + unsigned int mask, unsigned int val);
>
> This is fine, we already have this operation for buses, but why is this
> munged in with the MFD patch?

Originally I want to show a example usage of the new callback, but I
can spilt them into 2 patches as you suggested. Thanks.

--
Baolin Wang