3f8512128a4203233fda626e23f5be0ce6ce8bab
[openembedded.git] /
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.
6
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.
10
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.
14
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>
24 ---
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
33
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"
39  
40  source "drivers/spi/Kconfig"
41  
42 +source "drivers/gpio/Kconfig"
43 +
44  source "drivers/w1/Kconfig"
45  
46  source "drivers/power/Kconfig"
47 diff --git a/drivers/Kconfig b/drivers/Kconfig
48 index f4076d9..90e295a 100644
49 --- a/drivers/Kconfig
50 +++ b/drivers/Kconfig
51 @@ -52,6 +52,8 @@ source "drivers/i2c/Kconfig"
52  
53  source "drivers/spi/Kconfig"
54  
55 +source "drivers/gpio/Kconfig"
56 +
57  source "drivers/w1/Kconfig"
58  
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
64 @@ -5,6 +5,7 @@
65  # Rewritten to use lists instead of if-statements.
66  #
67  
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
73 new file mode 100644
74 index 0000000..560687c
75 --- /dev/null
76 +++ b/drivers/gpio/Kconfig
77 @@ -0,0 +1,32 @@
78 +#
79 +# GPIO infrastructure and expanders
80 +#
81 +
82 +config HAVE_GPIO_LIB
83 +       bool
84 +       help
85 +         Platforms select gpiolib if they use this infrastructure
86 +         for all their GPIOs, usually starting with ones integrated
87 +         into SOC processors.
88 +
89 +menu "GPIO Support"
90 +       depends on HAVE_GPIO_LIB
91 +
92 +config DEBUG_GPIO
93 +       bool "Debug GPIO calls"
94 +       depends on DEBUG_KERNEL
95 +       help
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.
102 +
103 +# put expanders in the right section, in alphabetical order
104 +
105 +comment "I2C GPIO expanders:"
106 +
107 +comment "SPI GPIO expanders:"
108 +
109 +endmenu
110 diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
111 new file mode 100644
112 index 0000000..cdbba6b
113 --- /dev/null
114 +++ b/drivers/gpio/Makefile
115 @@ -0,0 +1,3 @@
116 +# gpio support: dedicated expander chips, etc
117 +
118 +ccflags-$(CONFIG_DEBUG_GPIO)   += -DDEBUG
119 -- 
120 1.5.3.8
121