lkml.org 
[lkml]   [2020]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 10/16] gpio: add a reusable generic gpio_chip using regmap
On Tue, Apr 14, 2020 at 08:36:23PM +0200, Michael Walle wrote:
> Am 2020-04-14 19:21, schrieb Mark Brown:

> > You could define REGMAP_INVALID_ADDR to be (unsigned int)(-1) or some
> > other suitably implausible address and use that as a value. It's
> > possible that there might be a collision with a real address on some
> > device but it should be sufficiently unlikely to be useful, especially
> > if it's not something regmap in general goes and evaluates. For extra
> > safety we could have an API for allowing users to query the register
> > validity information regmap has (or can be given) and gpiolib could then
> > use that to figure out if the value was actually a dummy value but
> > that's probably overdoing it.

> If possible, I'd like to have the opposite logic. That is, if it is not
> set it should be invalid. If we have a magic macro like
> REGMAP_INVALID_ADDR, we must assign it to all the unused addresses. Thus
> every driver would have to assign all addresses and if in the future
> there will be some added, we'd have to touch all the drivers which use
> gpio_regmap.

Sure, for that you'd need a separate flag since zero is such a commonly
valid address.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2020-04-14 20:41    [W:0.870 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site