1 From b77665c545bc260d2b93add129413e4a724d7e6e Mon Sep 17 00:00:00 2001
2 From: David Brownell <dbrownell@users.sourceforge.net>
3 Date: Fri, 18 Jan 2008 00:35:00 +0300
4 Subject: [PATCH 21/64] Add an empty drivers/gpio directory for gpiolib infrastructure and GPIO
5 expanders. It will be populated by later patches.
7 This won't be the only place to hold such gpio_chip code. Many external chips
8 add a few GPIOs as secondary functionality (such as MFD drivers) and platform
9 code frequently needs to closely integrate GPIO and IRQ support.
11 This is placed *early* in the build/link sequence since it's common for other
12 drivers to depend on GPIOs to do their work, so they must be initialized early
13 in the device_initcall() sequence.
15 Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
16 Acked-by: Jean Delvare <khali@linux-fr.org>
17 Cc: Eric Miao <eric.miao@marvell.com>
18 Cc: Sam Ravnborg <sam@ravnborg.org>
19 Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
20 Cc: Philipp Zabel <philipp.zabel@gmail.com>
21 Cc: Russell King <rmk@arm.linux.org.uk>
22 Cc: Ben Gardner <bgardner@wabtec.com>
23 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
25 arch/arm/Kconfig | 2 ++
26 drivers/Kconfig | 2 ++
27 drivers/Makefile | 1 +
28 drivers/gpio/Kconfig | 32 ++++++++++++++++++++++++++++++++
29 drivers/gpio/Makefile | 3 +++
30 5 files changed, 40 insertions(+), 0 deletions(-)
31 create mode 100644 drivers/gpio/Kconfig
32 create mode 100644 drivers/gpio/Makefile
34 diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
35 index 10faf9c..06ca241 100644
36 --- a/arch/arm/Kconfig
37 +++ b/arch/arm/Kconfig
38 @@ -1042,6 +1042,8 @@ source "drivers/i2c/Kconfig"
40 source "drivers/spi/Kconfig"
42 +source "drivers/gpio/Kconfig"
44 source "drivers/w1/Kconfig"
46 source "drivers/power/Kconfig"
47 diff --git a/drivers/Kconfig b/drivers/Kconfig
48 index f4076d9..90e295a 100644
51 @@ -52,6 +52,8 @@ source "drivers/i2c/Kconfig"
53 source "drivers/spi/Kconfig"
55 +source "drivers/gpio/Kconfig"
57 source "drivers/w1/Kconfig"
59 source "drivers/power/Kconfig"
60 diff --git a/drivers/Makefile b/drivers/Makefile
61 index 8cb37e3..8e5101f 100644
62 --- a/drivers/Makefile
63 +++ b/drivers/Makefile
65 # Rewritten to use lists instead of if-statements.
68 +obj-$(CONFIG_HAVE_GPIO_LIB) += gpio/
69 obj-$(CONFIG_PCI) += pci/
70 obj-$(CONFIG_PARISC) += parisc/
71 obj-$(CONFIG_RAPIDIO) += rapidio/
72 diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
74 index 0000000..560687c
76 +++ b/drivers/gpio/Kconfig
79 +# GPIO infrastructure and expanders
85 + Platforms select gpiolib if they use this infrastructure
86 + for all their GPIOs, usually starting with ones integrated
87 + into SOC processors.
90 + depends on HAVE_GPIO_LIB
93 + bool "Debug GPIO calls"
94 + depends on DEBUG_KERNEL
96 + Say Y here to add some extra checks and diagnostics to GPIO calls.
97 + The checks help ensure that GPIOs have been properly initialized
98 + before they are used and that sleeping calls aren not made from
99 + nonsleeping contexts. They can make bitbanged serial protocols
100 + slower. The diagnostics help catch the type of setup errors
101 + that are most common when setting up new platforms or boards.
103 +# put expanders in the right section, in alphabetical order
105 +comment "I2C GPIO expanders:"
107 +comment "SPI GPIO expanders:"
110 diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
112 index 0000000..cdbba6b
114 +++ b/drivers/gpio/Makefile
116 +# gpio support: dedicated expander chips, etc
118 +ccflags-$(CONFIG_DEBUG_GPIO) += -DDEBUG