summaryrefslogtreecommitdiff
path: root/arch/arm/mach-u300/gpio.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@stericsson.com>2009-09-28 15:36:18 +0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-10-01 19:26:15 +0400
commitee17962e249024ebba72acbfe7cf54f8ea5b72f8 (patch)
tree2e13e55fa2023e5b841b342d942ee358ccb37266 /arch/arm/mach-u300/gpio.c
parentaa45ee8fc0ee87c1711b5fe8eb3556d06530c39e (diff)
downloadlinux-ee17962e249024ebba72acbfe7cf54f8ea5b72f8.tar.xz
ARM: 5731/2: Fix U300 generic GPIO, remove ifdefs from MMCI v3
The #ifdefs in the MMCI driver were erroneous and just masking a bug in the U300 generic GPIO implementation. This removes the ifdefs and fixes the U300 generic GPIO instead. Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-u300/gpio.c')
-rw-r--r--arch/arm/mach-u300/gpio.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/arm/mach-u300/gpio.c b/arch/arm/mach-u300/gpio.c
index 63c8f27fb15a..0b35826b7d1d 100644
--- a/arch/arm/mach-u300/gpio.c
+++ b/arch/arm/mach-u300/gpio.c
@@ -281,6 +281,16 @@ int gpio_unregister_callback(unsigned gpio)
}
EXPORT_SYMBOL(gpio_unregister_callback);
+/* Non-zero means valid */
+int gpio_is_valid(int number)
+{
+ if (number >= 0 &&
+ number < (U300_GPIO_NUM_PORTS * U300_GPIO_PINS_PER_PORT))
+ return 1;
+ return 0;
+}
+EXPORT_SYMBOL(gpio_is_valid);
+
int gpio_request(unsigned gpio, const char *label)
{
if (gpio_pin[gpio].users)