diff options
author | Florian Fainelli <florian@openwrt.org> | 2009-01-15 10:46:48 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2009-03-30 08:49:42 -0400 |
commit | 47c969ee54e142eba71626f99b3d99cc461b84f3 (patch) | |
tree | 79f23092fd31e4482477958a2b5fa081b7000d8a /arch/mips/include/asm | |
parent | 12e22e8e60add9e1ccd61509ab7fd6fc1c214c52 (diff) |
MIPS: Au1000: convert to using gpiolib
This patch converts the GPIO board code to use gpiolib.
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/include/asm')
-rw-r--r-- | arch/mips/include/asm/mach-au1x00/gpio.h | 70 |
1 files changed, 17 insertions, 53 deletions
diff --git a/arch/mips/include/asm/mach-au1x00/gpio.h b/arch/mips/include/asm/mach-au1x00/gpio.h index 2dc61e009a08..34d9b7279024 100644 --- a/arch/mips/include/asm/mach-au1x00/gpio.h +++ b/arch/mips/include/asm/mach-au1x00/gpio.h | |||
@@ -5,65 +5,29 @@ | |||
5 | 5 | ||
6 | #define AU1XXX_GPIO_BASE 200 | 6 | #define AU1XXX_GPIO_BASE 200 |
7 | 7 | ||
8 | struct au1x00_gpio2 { | 8 | /* GPIO bank 1 offsets */ |
9 | u32 dir; | 9 | #define AU1000_GPIO1_TRI_OUT 0x0100 |
10 | u32 reserved; | 10 | #define AU1000_GPIO1_OUT 0x0108 |
11 | u32 output; | 11 | #define AU1000_GPIO1_ST 0x0110 |
12 | u32 pinstate; | 12 | #define AU1000_GPIO1_CLR 0x010C |
13 | u32 inten; | ||
14 | u32 enable; | ||
15 | }; | ||
16 | 13 | ||
17 | extern int au1xxx_gpio_get_value(unsigned gpio); | 14 | /* GPIO bank 2 offsets */ |
18 | extern void au1xxx_gpio_set_value(unsigned gpio, int value); | 15 | #define AU1000_GPIO2_DIR 0x00 |
19 | extern int au1xxx_gpio_direction_input(unsigned gpio); | 16 | #define AU1000_GPIO2_RSVD 0x04 |
20 | extern int au1xxx_gpio_direction_output(unsigned gpio, int value); | 17 | #define AU1000_GPIO2_OUT 0x08 |
18 | #define AU1000_GPIO2_ST 0x0C | ||
19 | #define AU1000_GPIO2_INT 0x10 | ||
20 | #define AU1000_GPIO2_EN 0x14 | ||
21 | 21 | ||
22 | #define GPIO2_OUT_EN_MASK 0x00010000 | ||
22 | 23 | ||
23 | /* Wrappers for the arch-neutral GPIO API */ | 24 | #define gpio_to_irq(gpio) NULL |
24 | 25 | ||
25 | static inline int gpio_request(unsigned gpio, const char *label) | 26 | #define gpio_get_value __gpio_get_value |
26 | { | 27 | #define gpio_set_value __gpio_set_value |
27 | /* Not yet implemented */ | ||
28 | return 0; | ||
29 | } | ||
30 | 28 | ||
31 | static inline void gpio_free(unsigned gpio) | 29 | #define gpio_cansleep __gpio_cansleep |
32 | { | ||
33 | /* Not yet implemented */ | ||
34 | } | ||
35 | 30 | ||
36 | static inline int gpio_direction_input(unsigned gpio) | ||
37 | { | ||
38 | return au1xxx_gpio_direction_input(gpio); | ||
39 | } | ||
40 | |||
41 | static inline int gpio_direction_output(unsigned gpio, int value) | ||
42 | { | ||
43 | return au1xxx_gpio_direction_output(gpio, value); | ||
44 | } | ||
45 | |||
46 | static inline int gpio_get_value(unsigned gpio) | ||
47 | { | ||
48 | return au1xxx_gpio_get_value(gpio); | ||
49 | } | ||
50 | |||
51 | static inline void gpio_set_value(unsigned gpio, int value) | ||
52 | { | ||
53 | au1xxx_gpio_set_value(gpio, value); | ||
54 | } | ||
55 | |||
56 | static inline int gpio_to_irq(unsigned gpio) | ||
57 | { | ||
58 | return gpio; | ||
59 | } | ||
60 | |||
61 | static inline int irq_to_gpio(unsigned irq) | ||
62 | { | ||
63 | return irq; | ||
64 | } | ||
65 | |||
66 | /* For cansleep */ | ||
67 | #include <asm-generic/gpio.h> | 31 | #include <asm-generic/gpio.h> |
68 | 32 | ||
69 | #endif /* _AU1XXX_GPIO_H_ */ | 33 | #endif /* _AU1XXX_GPIO_H_ */ |