path: root/Documentation/gpio.txt
diff options
authorMichael Buesch <>2008-07-25 01:46:11 -0700
committerLinus Torvalds <>2008-07-25 10:53:30 -0700
commit7444a72effa632fcd8edc566f880d96fe213c73b (patch)
tree89d3e70c22751a6b00091df2b4dce7202eb3b1f5 /Documentation/gpio.txt
parentff1d5c2f0268f4e32103536e2e65480b5b7b6530 (diff)
gpiolib: allow user-selection
This patch adds functionality to the gpio-lib subsystem to make it possible to enable the gpio-lib code even if the architecture code didn't request to get it built in. The archtitecture code does still need to implement the gpiolib accessor functions in its asm/gpio.h file. This patch adds the implementations for x86 and PPC. With these changes it is possible to run generic GPIO expansion cards on every architecture that implements the trivial wrapper functions. Support for more architectures can easily be added. Signed-off-by: Michael Buesch <> Cc: Benjamin Herrenschmidt <> Cc: Stephen Rothwell <> Cc: David Brownell <> Cc: Russell King <> Cc: Haavard Skinnemoen <> Cc: Jesper Nilsson <> Cc: Ralf Baechle <> Cc: Paul Mackerras <> Cc: Benjamin Herrenschmidt <> Cc: Ingo Molnar <> Cc: Thomas Gleixner <> Cc: Jean Delvare <> Cc: Samuel Ortiz <> Cc: Kumar Gala <> Cc: Sam Ravnborg <> Cc: Adrian Bunk <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'Documentation/gpio.txt')
1 files changed, 11 insertions, 1 deletions
diff --git a/Documentation/gpio.txt b/Documentation/gpio.txt
index 8b69811a9642..18022e249c53 100644
--- a/Documentation/gpio.txt
+++ b/Documentation/gpio.txt
@@ -389,11 +389,21 @@ either NULL or the label associated with that GPIO when it was requested.
Platform Support
-To support this framework, a platform's Kconfig will "select HAVE_GPIO_LIB"
+To support this framework, a platform's Kconfig will "select" either
and arrange that its <asm/gpio.h> includes <asm-generic/gpio.h> and defines
three functions: gpio_get_value(), gpio_set_value(), and gpio_cansleep().
They may also want to provide a custom value for ARCH_NR_GPIOS.
+ARCH_REQUIRE_GPIOLIB means that the gpio-lib code will always get compiled
+into the kernel on that architecture.
+ARCH_WANT_OPTIONAL_GPIOLIB means the gpio-lib code defaults to off and the user
+can enable it and build it into the kernel optionally.
+If neither of these options are selected, the platform does not support
+GPIOs through GPIO-lib and the code cannot be enabled by the user.
Trivial implementations of those functions can directly use framework
code, which always dispatches through the gpio_chip: