Re: [PATCH v3 6/9] gpio: i8255: Migrate to gpio-regmap API

From: William Breathitt Gray
Date: Sun Nov 27 2022 - 12:19:45 EST


On Wed, Nov 23, 2022 at 07:42:24PM +0200, Andy Shevchenko wrote:
> On Tue, Nov 22, 2022 at 02:11:03AM -0500, William Breathitt Gray wrote:
> > +/**
> > + * struct i8255_regmap_config - Configuration for the register map of an i8255
> > + * @parent: parent device
> > + * @map: regmap for the i8255
> > + * @num_ppi: number of i8255 Programmable Peripheral Interface
> > + * @names: (optional) array of names for gpios
> > + * @domain: (optional) IRQ domain if the controller is interrupt-capable
>
> > + * Note: The regmap is expected to have cache enabled and i8255 control
> > + * registers not marked as volatile.
>
> Have you considered to catch wrong configurations by BUILD_BUG_ON() /
> static_assert() / another means of validation?

Ideally, I'd like to check for these configurations, but struct regmap
is an opaque type (the definition is in drivers/base/regmap/internal.h).
Do you know if there is some way to query a struct regmap for whether a
particular register has cache enabled or is marked as volatile?

William Breathitt Gray

Attachment: signature.asc
Description: PGP signature