From: "Jaya Kumar" <jayakumar.lkml@gmail.com>
To: "David Brownell" <david-b@pacbell.net>
Cc: "Eric Miao" <eric.y.miao@gmail.com>,
"Sam Ravnborg" <sam@ravnborg.org>,
"Eric Miao" <eric.miao@marvell.com>,
"Haavard Skinnemoen" <hskinnemoen@atmel.com>,
"Philipp Zabel" <philipp.zabel@gmail.com>,
"Russell King" <rmk@arm.linux.org.uk>,
"Ben Gardner" <bgardner@wabtec.com>, "Greg KH" <greg@kroah.com>,
linux-arm-kernel@lists.arm.linux.org.uk,
linux-fbdev-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org, linux-embedded@vger.kernel.org
Subject: Re: [RFC 2.6.27 1/1] gpiolib: add support for batch set of pins
Date: Tue, 30 Dec 2008 23:45:58 +0800 [thread overview]
Message-ID: <45a44e480812300745p969f1dfi9ea837b611395a3e@mail.gmail.com> (raw)
In-Reply-To: <200812291132.14806.david-b@pacbell.net>
Hi David,
On Mon, Dec 29, 2008 at 2:32 PM, David Brownell <david-b@pacbell.net> wrote:
>
> - passing bitmasks as {unsigned long *bits, int count} tuples
> - separate calls to:
> * zero a set of bits (loop: gpio_set_value to 0)
> * fill a set of bits (loop: gpio_set_value to 1)
> * copy a set of bits (loop: gpio_set_value to src[i])
> * read a set of bits (loop: dst[i] = gpio_get_value)
> * ... maybe more
I had read bitmasks.h as per your recommendation and my thought on
that was: How do I reconcile such a substantial API when the use case
is just setting/getting a bunch of gpio pins?
>
> Any restriction to 32 bit value seems shortsighted. It would
> make sense to wrap the GPIO bitmask descriptions in a struct,
> letting drivers work with smaller sets -- probably most would
> fit into a single "unsigned long".
>
Hmm. Well. Currently, there's only been 1 bit support and its been
that way for years, hasn't it? It was not shortsighted at that time to
have only 1 bit access. No one raised a need for more. There weren't
any complaints about the 1-bit gpio API until am300epd.c came along.
You had correctly pointed out "I happen not to have come across the
need for such ganged access from Linux" in the start of this thread. I
think that you raised a strong point there. If I understood you
correctly, it implies it is NOT likely that there'll be many users of
this ganged access API.
Which is precisely why I took your suggestion to heart and stuck to
the middle path. For better or worse, we currently have a grand total
of just one use case for this ganged API: am300epd.c which does a
16-bit write. No one has spoken up with another concrete use case. So
I say we stick to the simple 32-bit startpin/mask/length API. Lets see
if people start using it. If more than a few do and issues are raised
with it being limited to "just 32 bits", then we can rearchitecht as
needed. After all, as you requested, it's an optional in-kernel only
API so we're in no danger of shooting ourselves in the foot here.
Further more, we've gone from years of 1-bit access with no complaints
to 32-bit access. A factor of 32 improvement seems a reasonably good
bet for the next few years to me. :-)
If any of my assertions are mistaken, I'll need your help to
understand which specific part of the conversation I've misunderstood.
Thanks,
jaya
next prev parent reply other threads:[~2008-12-30 15:46 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-25 22:52 Jaya Kumar
2008-11-26 1:20 ` Eric Miao
2008-11-26 3:27 ` Jaya Kumar
2008-11-26 4:15 ` David Brownell
2008-11-26 5:51 ` Jaya Kumar
2008-11-27 20:01 ` Sam Ravnborg
2008-11-27 23:43 ` Jaya Kumar
2008-11-28 5:47 ` Sam Ravnborg
2008-11-29 22:48 ` David Brownell
2008-11-29 23:33 ` Jaya Kumar
2008-11-29 22:54 ` David Brownell
2008-11-29 23:52 ` Jaya Kumar
2008-11-30 17:55 ` David Brownell
2008-12-01 1:10 ` Jaya Kumar
2008-12-27 14:55 ` Jaya Kumar
2008-12-28 18:46 ` Robin Getz
2008-12-28 22:00 ` Ben Nizette
2008-12-29 0:28 ` Jaya Kumar
2008-12-29 20:32 ` David Brownell
2008-12-29 19:59 ` David Brownell
2009-01-06 23:02 ` Robin Getz
2009-01-07 1:52 ` Ben Nizette
2008-12-29 19:56 ` David Brownell
2008-12-30 0:20 ` Jamie Lokier
2008-12-30 0:43 ` David Brownell
2008-12-31 4:55 ` Robin Getz
2008-12-31 4:58 ` Jaya Kumar
2008-12-31 5:02 ` Jaya Kumar
2008-12-31 17:38 ` Robin Getz
2008-12-31 18:05 ` Jaya Kumar
2009-01-06 22:41 ` Robin Getz
2009-01-10 7:37 ` Jaya Kumar
2008-12-29 19:32 ` David Brownell
2008-12-30 15:45 ` Jaya Kumar [this message]
2008-12-29 19:06 ` David Brownell
2008-11-26 9:09 ` Paulius Zaleckas
2008-11-26 9:18 ` Jaya Kumar
2008-11-26 10:08 ` [Linux-fbdev-devel] " Geert Uytterhoeven
2008-11-26 10:25 ` Jaya Kumar
2008-11-26 12:08 ` Geert Uytterhoeven
2008-11-29 22:47 ` David Brownell
2008-11-29 23:04 ` Jaya Kumar
2008-11-30 3:27 ` David Brownell
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=45a44e480812300745p969f1dfi9ea837b611395a3e@mail.gmail.com \
--to=jayakumar.lkml@gmail.com \
--cc=bgardner@wabtec.com \
--cc=david-b@pacbell.net \
--cc=eric.miao@marvell.com \
--cc=eric.y.miao@gmail.com \
--cc=greg@kroah.com \
--cc=hskinnemoen@atmel.com \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--cc=linux-embedded@vger.kernel.org \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=philipp.zabel@gmail.com \
--cc=rmk@arm.linux.org.uk \
--cc=sam@ravnborg.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®