Re: [PATCH v2 2/4] gpio: add viperboard gpio driver

From: Mark Brown
Date: Wed Oct 24 2012 - 12:31:49 EST


On Wed, Oct 24, 2012 at 09:53:06AM +0200, Linus Walleij wrote:
> On Tue, Oct 23, 2012 at 5:24 PM, Lars Poeschel <poeschel@xxxxxxxxxxx> wrote:

> > Ok, I tried to implement it (at least for the gpioa part of the driver).
> > It does not work. I got stuck. There are three problems I could not solve:

> So I'm looping in Mark Brown to get some hints whether the following
> can be resolved easily or needs to be given up on...

Some context would've been enormously useful for working out what the
discussion is all about... this is *very* verbose and not at all clear.

> > Setting the direction to output is an atomic set direction and set value.
> > The register number is different from setting the value only. So after a
> > successful call, I want to update the cache of output value using
> > regcache_write. This is also not publicy available api. The only thing I could
> > do is invalidate the whole cache using regcache_mark_dirty. (3rd problem)

> Same thing.

The above doesn't sound like marking the register as dirty is going to
be helpful... at most you'd want to discard the cache which is already
supported per register. Marking the register as dirty would leave the
existing (presumably wrong if there's a problem) value in place in the
cache. It's not at all clear to me that a cache is even useful for
these registers.

> > I attach my current working state here. This is NOT WORKING and only as
> > reference.

> So if you want to do this with regmap, I suggest the way forward would
> be to go solve it at the root by implementing something like
> drivers/base/regmap/regmap-usb-ctrl.c with your desired semantics
> and using that.

So the issue is that we're trying to use regmap for some USB device?

Attachment: signature.asc
Description: Digital signature