Skip to content

arch-neutral GPIO calls

David Brownell lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 44 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6GPIO coreDocumentation/gpio.txt include/asm-arm/gpio.h include/asm-generic/gpio.h+303 -07 replies
2/6OMAP GPIO wrappersinclude/asm-arm/arch-omap/gpio.h+54 -00 replies
3/6AT91 GPIO wrappersarch/arm/mach-at91rm9200/gpio.c include/asm-arm/arch-at91rm9200/gpio.h+84 -12 replies
4/6PXA GPIO wrappersinclude/asm-arm/arch-pxa/gpio.h+72 -019 replies
5/6SA1100 GPIO wrappersinclude/asm-arm/arch-sa1100/gpio.h+81 -011 replies
6/6S3C2410 GPIO wrappersinclude/asm-arm/arch-s3c2410/gpio.h+65 -03 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [patch 2.6.20-rc1 0/6] arch-neutral GPIO calls

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 highly platform-specific.

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.

- Dave