|| ||David Brownell <firstname.lastname@example.org>|
|| ||Linux Kernel list <email@example.com>|
|| ||[patch 2.6.20-rc1 0/6] arch-neutral GPIO calls|
|| ||Wed, 20 Dec 2006 13:04:02 -0800|
|| ||Andrew Morton <firstname.lastname@example.org>,
Andrew Victor <email@example.com>,
Bill Gatliff <firstname.lastname@example.org>,
Haavard Skinnemoen <email@example.com>, firstname.lastname@example.org,
Kevin Hilman <email@example.com>,
Nicolas Pitre <firstname.lastname@example.org>,
Russell King <email@example.com>,
Tony Lindgren <firstname.lastname@example.org>,
pHilipp Zabel <email@example.com>|
Based on earlier discussion, I'm sending a refresh of the generic GPIO
patch, with several (ARM based) implementations in separate patches:
- Core patch, doc + <asm-arm/gpio.h> + <asm-generic/gpio.h>
- OMAP implementation
- AT91 implementation
- PXA implementation
- SA1100 implementation
- S3C2410 implementation
I know there's an AVR32 implementation too; and there's been interest
in this for some PPC support as well.
This time I'm proposing that at least the core patch go into the MM
tree; I think there's been enough discussion, and a general acceptance
that we need this kind of API. Russell usually wants ARM patches to
go through his system, so those implementations above should probably
not go through MM.
With the exception of the AT91 implementation, those are all trivial
wrappers around the existing calls ... which should highlight the fact
that this API reflects existing practice, but with more generic syntax.
AT91 differed only because it needed to split out a "configure as GPIO"
primitive, not merged with the "set gpio direction" call.
Other than clarifications, the main change in the doc is defining
new calls safe for use with GPIOs on things like pcf8574 I2C gpio
expanders; those new calls can sleep, but are otherwise the same as
the spinlock-safe versions. The implementations above implement that
as a wrapper (the asm-generic header) around the spinlock-safe calls.
This API is orthogonal to pin configuration (configure ball X17 as
GPIO 23 rather than R33, with pulldown, etc) which is in any case
Also, as an API rather than an implementation framework, this does
not expose a notion of a "GPIO controller", of which any given
system might have several. It's allowed by the API (e.g. see the
OMAP code), but is not required. I expect that sort of thing will
come later; it's common enough to have SOC-based boards with GPIOs
on the SOC as well as a couple external chips.