提交 0a938b97 编写于 作者: D David Brownell 提交者: Linus Torvalds

[PATCH] add CONFIG_GENERIC_GPIO

Most drivers using GPIOs already know they are running on a system that
supports the generic GPIO calls, because of other platform dependencies.
But the generic GPIO-based LED and input button drivers can't know that.

So this patch adds a Kconfig hook, GENERIC_GPIO, to mark the platforms
where <asm/gpio.h> will do the right thing.  Currently that's a bunch of
ARMs, and AVR32; more are on the way.

It also fixes a dependency bug for the gpio button input driver; it was
wrong to start with, now it covers all platforms with GENERIC_GPIO.
Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
Acked-by: NRichard Purdie <rpurdie@rpsys.net>
Cc: Arnaud Patard <arnaud.patard@rtp-net.org>
Cc: <raph@8d.com>
Cc: <msvoboda@ra.rockwell.com>
Cc: pHilipp Zabel <philipp.zabel@gmail.com>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 1ad7c311
...@@ -21,6 +21,10 @@ config ARM ...@@ -21,6 +21,10 @@ config ARM
config SYS_SUPPORTS_APM_EMULATION config SYS_SUPPORTS_APM_EMULATION
bool bool
config GENERIC_GPIO
bool
default n
config GENERIC_TIME config GENERIC_TIME
bool bool
default n default n
...@@ -163,6 +167,7 @@ config ARCH_VERSATILE ...@@ -163,6 +167,7 @@ config ARCH_VERSATILE
config ARCH_AT91 config ARCH_AT91
bool "Atmel AT91" bool "Atmel AT91"
select GENERIC_GPIO
help help
This enables support for systems based on the Atmel AT91RM9200 This enables support for systems based on the Atmel AT91RM9200
and AT91SAM9xxx processors. and AT91SAM9xxx processors.
...@@ -304,6 +309,7 @@ config ARCH_PXA ...@@ -304,6 +309,7 @@ config ARCH_PXA
bool "PXA2xx-based" bool "PXA2xx-based"
depends on MMU depends on MMU
select ARCH_MTD_XIP select ARCH_MTD_XIP
select GENERIC_GPIO
select GENERIC_TIME select GENERIC_TIME
help help
Support for Intel's PXA2XX processor line. Support for Intel's PXA2XX processor line.
...@@ -325,11 +331,13 @@ config ARCH_SA1100 ...@@ -325,11 +331,13 @@ config ARCH_SA1100
select ISA select ISA
select ARCH_DISCONTIGMEM_ENABLE select ARCH_DISCONTIGMEM_ENABLE
select ARCH_MTD_XIP select ARCH_MTD_XIP
select GENERIC_GPIO
help help
Support for StrongARM 11x0 based boards. Support for StrongARM 11x0 based boards.
config ARCH_S3C2410 config ARCH_S3C2410
bool "Samsung S3C2410, S3C2412, S3C2413, S3C2440, S3C2442, S3C2443" bool "Samsung S3C2410, S3C2412, S3C2413, S3C2440, S3C2442, S3C2443"
select GENERIC_GPIO
help help
Samsung S3C2410X CPU based systems, such as the Simtec Electronics Samsung S3C2410X CPU based systems, such as the Simtec Electronics
BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or
...@@ -354,6 +362,7 @@ config ARCH_LH7A40X ...@@ -354,6 +362,7 @@ config ARCH_LH7A40X
config ARCH_OMAP config ARCH_OMAP
bool "TI OMAP" bool "TI OMAP"
select GENERIC_GPIO
help help
Support for TI's OMAP platform (OMAP1 and OMAP2). Support for TI's OMAP platform (OMAP1 and OMAP2).
......
...@@ -22,6 +22,10 @@ config AVR32 ...@@ -22,6 +22,10 @@ config AVR32
config UID16 config UID16
bool bool
config GENERIC_GPIO
bool
default y
config GENERIC_HARDIRQS config GENERIC_HARDIRQS
bool bool
default y default y
......
...@@ -215,14 +215,16 @@ config KEYBOARD_AAED2000 ...@@ -215,14 +215,16 @@ config KEYBOARD_AAED2000
module will be called aaed2000_kbd. module will be called aaed2000_kbd.
config KEYBOARD_GPIO config KEYBOARD_GPIO
tristate "Buttons on CPU GPIOs (PXA)" tristate "GPIO Buttons"
depends on (ARCH_SA1100 || ARCH_PXA || ARCH_S3C2410) depends on GENERIC_GPIO
help help
This driver implements support for buttons connected This driver implements support for buttons connected
directly to GPIO pins of SA1100, PXA or S3C24xx CPUs. to GPIO pins of various CPUs (and some other chips).
Say Y here if your device has buttons connected Say Y here if your device has buttons connected
directly to GPIO pins of the CPU. directly to such GPIO pins. Your board-specific
setup logic must also provide a platform device,
with configuration data saying which GPIOs are used.
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called gpio-keys. module will be called gpio-keys.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册