diff options
author | Aurelien Jarno <aurelien@aurel32.net> | 2007-09-25 09:42:09 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2007-10-11 18:46:07 -0400 |
commit | 34cc662f8aae0ce1db5c64d55a39a5081f9e3cd8 (patch) | |
tree | 69447356fb052c8aa3a74154f2dee082b64f275d /include/asm-mips | |
parent | 25e5fb97419f73d39b37e9f73f9492c394de07b2 (diff) |
[MIPS] Add gpio support to the BCM47XX platform
Add GPIO support to the BCM47XX platform. It will be used by a GPIO
LED driver.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'include/asm-mips')
-rw-r--r-- | include/asm-mips/mach-bcm47xx/gpio.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/include/asm-mips/mach-bcm47xx/gpio.h b/include/asm-mips/mach-bcm47xx/gpio.h new file mode 100644 index 000000000000..cfc8f4d618ce --- /dev/null +++ b/include/asm-mips/mach-bcm47xx/gpio.h | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2007 Aurelien Jarno <aurelien@aurel32.net> | ||
7 | */ | ||
8 | |||
9 | #ifndef __BCM47XX_GPIO_H | ||
10 | #define __BCM47XX_GPIO_H | ||
11 | |||
12 | #define BCM47XX_EXTIF_GPIO_LINES 5 | ||
13 | #define BCM47XX_CHIPCO_GPIO_LINES 16 | ||
14 | |||
15 | extern int bcm47xx_gpio_to_irq(unsigned gpio); | ||
16 | extern int bcm47xx_gpio_get_value(unsigned gpio); | ||
17 | extern void bcm47xx_gpio_set_value(unsigned gpio, int value); | ||
18 | extern int bcm47xx_gpio_direction_input(unsigned gpio); | ||
19 | extern int bcm47xx_gpio_direction_output(unsigned gpio, int value); | ||
20 | |||
21 | static inline int gpio_request(unsigned gpio, const char *label) | ||
22 | { | ||
23 | return 0; | ||
24 | } | ||
25 | |||
26 | static inline void gpio_free(unsigned gpio) | ||
27 | { | ||
28 | } | ||
29 | |||
30 | static inline int gpio_to_irq(unsigned gpio) | ||
31 | { | ||
32 | return bcm47xx_gpio_to_irq(gpio); | ||
33 | } | ||
34 | |||
35 | static inline int gpio_get_value(unsigned gpio) | ||
36 | { | ||
37 | return bcm47xx_gpio_get_value(gpio); | ||
38 | } | ||
39 | |||
40 | static inline void gpio_set_value(unsigned gpio, int value) | ||
41 | { | ||
42 | bcm47xx_gpio_set_value(gpio, value); | ||
43 | } | ||
44 | |||
45 | static inline int gpio_direction_input(unsigned gpio) | ||
46 | { | ||
47 | return bcm47xx_gpio_direction_input(gpio); | ||
48 | } | ||
49 | |||
50 | static inline int gpio_direction_output(unsigned gpio, int value) | ||
51 | { | ||
52 | return bcm47xx_gpio_direction_output(gpio, value); | ||
53 | } | ||
54 | |||
55 | |||
56 | /* cansleep wrappers */ | ||
57 | #include <asm-generic/gpio.h> | ||
58 | |||
59 | #endif /* __BCM47XX_GPIO_H */ | ||