aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/gpio.txt
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2008-07-25 04:46:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-25 13:53:30 -0400
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 <mb@bu3sch.de> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: David Brownell <david-b@pacbell.net> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Haavard Skinnemoen <hskinnemoen@atmel.com> Cc: Jesper Nilsson <jesper.nilsson@axis.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jean Delvare <khali@linux-fr.org> Cc: Samuel Ortiz <sameo@openedhand.com> Cc: Kumar Gala <galak@gate.crashing.org> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/gpio.txt')
-rw-r--r--Documentation/gpio.txt12
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.
389 389
390Platform Support 390Platform Support
391---------------- 391----------------
392To support this framework, a platform's Kconfig will "select HAVE_GPIO_LIB" 392To support this framework, a platform's Kconfig will "select" either
393ARCH_REQUIRE_GPIOLIB or ARCH_WANT_OPTIONAL_GPIOLIB
393and arrange that its <asm/gpio.h> includes <asm-generic/gpio.h> and defines 394and arrange that its <asm/gpio.h> includes <asm-generic/gpio.h> and defines
394three functions: gpio_get_value(), gpio_set_value(), and gpio_cansleep(). 395three functions: gpio_get_value(), gpio_set_value(), and gpio_cansleep().
395They may also want to provide a custom value for ARCH_NR_GPIOS. 396They may also want to provide a custom value for ARCH_NR_GPIOS.
396 397
398ARCH_REQUIRE_GPIOLIB means that the gpio-lib code will always get compiled
399into the kernel on that architecture.
400
401ARCH_WANT_OPTIONAL_GPIOLIB means the gpio-lib code defaults to off and the user
402can enable it and build it into the kernel optionally.
403
404If neither of these options are selected, the platform does not support
405GPIOs through GPIO-lib and the code cannot be enabled by the user.
406
397Trivial implementations of those functions can directly use framework 407Trivial implementations of those functions can directly use framework
398code, which always dispatches through the gpio_chip: 408code, which always dispatches through the gpio_chip:
399 409