aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
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 /drivers/gpio
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 'drivers/gpio')
-rw-r--r--drivers/gpio/Kconfig33
-rw-r--r--drivers/gpio/Makefile2
2 files changed, 30 insertions, 5 deletions
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index de202dbe5300..5a355f829167 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -2,15 +2,40 @@
2# GPIO infrastructure and expanders 2# GPIO infrastructure and expanders
3# 3#
4 4
5config HAVE_GPIO_LIB 5config ARCH_WANT_OPTIONAL_GPIOLIB
6 bool 6 bool
7 help 7 help
8 Select this config option from the architecture Kconfig, if
9 it is possible to use gpiolib on the architecture, but let the
10 user decide whether to actually build it or not.
11 Select this instead of ARCH_REQUIRE_GPIOLIB, if your architecture does
12 not depend on GPIOs being available, but rather let the user
13 decide whether he needs it or not.
14
15config ARCH_REQUIRE_GPIOLIB
16 bool
17 select GPIOLIB
18 help
8 Platforms select gpiolib if they use this infrastructure 19 Platforms select gpiolib if they use this infrastructure
9 for all their GPIOs, usually starting with ones integrated 20 for all their GPIOs, usually starting with ones integrated
10 into SOC processors. 21 into SOC processors.
22 Selecting this from the architecture code will cause the gpiolib
23 code to always get built in.
24
25
26
27menuconfig GPIOLIB
28 bool "GPIO Support"
29 depends on ARCH_WANT_OPTIONAL_GPIOLIB || ARCH_REQUIRE_GPIOLIB
30 select GENERIC_GPIO
31 help
32 This enables GPIO support through the generic GPIO library.
33 You only need to enable this, if you also want to enable
34 one or more of the GPIO expansion card drivers below.
35
36 If unsure, say N.
11 37
12menu "GPIO Support" 38if GPIOLIB
13 depends on HAVE_GPIO_LIB
14 39
15config DEBUG_GPIO 40config DEBUG_GPIO
16 bool "Debug GPIO calls" 41 bool "Debug GPIO calls"
@@ -116,4 +141,4 @@ config GPIO_MCP23S08
116 SPI driver for Microchip MCP23S08 I/O expander. This provides 141 SPI driver for Microchip MCP23S08 I/O expander. This provides
117 a GPIO interface supporting inputs and outputs. 142 a GPIO interface supporting inputs and outputs.
118 143
119endmenu 144endif
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index eeb2f2b20282..8c45948d1fe7 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -2,7 +2,7 @@
2 2
3ccflags-$(CONFIG_DEBUG_GPIO) += -DDEBUG 3ccflags-$(CONFIG_DEBUG_GPIO) += -DDEBUG
4 4
5obj-$(CONFIG_HAVE_GPIO_LIB) += gpiolib.o 5obj-$(CONFIG_GPIOLIB) += gpiolib.o
6 6
7obj-$(CONFIG_GPIO_MAX7301) += max7301.o 7obj-$(CONFIG_GPIO_MAX7301) += max7301.o
8obj-$(CONFIG_GPIO_MCP23S08) += mcp23s08.o 8obj-$(CONFIG_GPIO_MCP23S08) += mcp23s08.o