From: Lars Poeschel <poeschel@lemonage.de>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Lars Poeschel <larsi@wh2.tu-dresden.de>,
sameo@linux.intel.com, linux-kernel@vger.kernel.org,
jic23@cam.ac.uk, khali@linux-fr.org, ben-linux@fluff.org,
w.sang@pengutronix.de, grant.likely@secretlab.ca
Subject: Re: [PATCH v2 2/4] gpio: add viperboard gpio driver
Date: Fri, 26 Oct 2012 11:16:01 +0200 [thread overview]
Message-ID: <201210261116.01507.poeschel@lemonage.de> (raw)
In-Reply-To: <20121025160651.GO18814@opensource.wolfsonmicro.com>
On Thursday 25 October 2012 at 18:06:51, Mark Brown wrote:
> Are you saying that whoever designed this USB device has done it so that
> it takes a byte stream with something like RRVV where RR is the register
> and VV is the value? That's the marshalling, as you'll have seen that's
> done before the buses see the data.
Aaah, I understand! Now your hint that the marshalling should be made
pluggable makes sense to me.
The device is more complicated and worse. For the first 16 gpio pins it is
something like 01RR0000FD00VV for setting the value and 03RR00FF00FEVV00 for
setting the direction. For the second 16 gpio pins it is completly different.
And yes, for this I completely remarshal what I get marshalled from regmap in
my bus implementation. This is bad. Thank you for your clarification. This
was not that clear to me as I began to use regmap and I think it also was not
to Linus Walleji, as he asked me to change the driver to use regmap. This is
why he brought you into our discussion.
I am a bit unsure what to do now. Since Linus said he would take my driver
without regmap, this will be my way for the driver.
I had a look at the regmap code in sense of making the marshalling pluggable.
It seems that the current assumption is that the register is always the first
value in the buffer after the marshalling happend which would not fit for my
device. Changing that is a bit hard. This marshalling is not the only issue.
For reading values I would need a split buffer or two seperate buffers.
Reading the device means doing a usb write using the first buffer telling the
device which register I am interested in and then doing a usb read into the
second buffer which then contains the actual value of the register. (Both
transfers marshalled different of course.)
> Is the I/O selection per GPIO or per device?
The I/O selection is per GPIO.
> > > So just invalidate the cache and it'll get restored next time we look
> > > at the register.
> >
> > Yes, this is exactly what I gave as an alternative in my second to last
> > mail. But this invalidates the whole register map although I just want
> > to update one register value.
>
> So add that functionality to the core if it's not there.
If I reach the limitations of some api/framework/something it is not my first
idea to change that api but if I did something wrong. But this word from a
maintainer is clear!
next prev parent reply other threads:[~2012-10-26 9:15 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-27 13:08 [PATCH] mfd: viperboard driver added larsi
2012-09-19 15:29 ` Samuel Ortiz
2012-09-24 16:46 ` Lars Poeschel
2012-09-25 8:55 ` Samuel Ortiz
2012-09-28 13:59 ` Lars Poeschel
2012-10-12 14:34 ` [PATCH v2 1/4] mfd: add viperboard driver Lars Poeschel
2012-10-12 14:34 ` [PATCH v2 2/4] gpio: add viperboard gpio driver Lars Poeschel
2012-10-15 13:00 ` Linus Walleij
2012-10-16 6:51 ` Lars Poeschel
2012-10-16 10:00 ` Linus Walleij
2012-10-16 13:38 ` Lars Poeschel
2012-10-16 17:11 ` Linus Walleij
2012-10-23 15:24 ` Lars Poeschel
2012-10-24 7:53 ` Linus Walleij
2012-10-24 16:31 ` Mark Brown
2012-10-25 10:02 ` Lars Poeschel
2012-10-25 14:00 ` Mark Brown
2012-10-25 16:02 ` Lars Poeschel
2012-10-25 16:06 ` Mark Brown
2012-10-26 9:16 ` Lars Poeschel [this message]
2012-10-27 16:14 ` Linus Walleij
2012-10-27 21:35 ` Mark Brown
2012-10-12 14:34 ` [PATCH v2 3/4] i2c: add viperboard i2c master driver Lars Poeschel
2012-10-12 14:34 ` [PATCH v2 4/4] iio: adc: add viperboard adc driver Lars Poeschel
2012-10-15 14:26 ` Lars-Peter Clausen
2012-10-16 7:11 ` Lars Poeschel
2012-10-15 17:09 ` [PATCH v2 1/4] mfd: add viperboard driver Peter Meerwald
2012-10-16 7:15 ` Lars Poeschel
2012-10-16 8:40 ` Lars-Peter Clausen
2012-10-16 9:43 ` Lars Poeschel
2012-10-16 10:58 ` Lars-Peter Clausen
2012-10-18 7:29 ` Lars Poeschel
2012-10-18 14:13 ` Lars-Peter Clausen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201210261116.01507.poeschel@lemonage.de \
--to=poeschel@lemonage.de \
--cc=ben-linux@fluff.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=grant.likely@secretlab.ca \
--cc=jic23@cam.ac.uk \
--cc=khali@linux-fr.org \
--cc=larsi@wh2.tu-dresden.de \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sameo@linux.intel.com \
--cc=w.sang@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.