diff options
author | Florian Fainelli <florian.fainelli@telecomint.eu> | 2007-05-22 15:44:42 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2007-07-10 12:32:56 -0400 |
commit | 4ead16819b4c61fea9bb73eb470f6bb1d3350e5c (patch) | |
tree | a001b0f2d2893ee6e266b00da27cd02ccef1f671 /include/asm-mips/mach-au1x00 | |
parent | 82b8d2250c4b606e190853db9505b54b9fb71aa5 (diff) |
[MIPS] Add generic GPIO to Au1x00
This patch adds support for the generic GPIO API to Au1x00 boards. It requires
the generic GPIO patch for MIPS boards by Yoichi Yuasa. Now there is a MIPS
target using it, can you queue these patchset for 2.6.22 ? Thank you very
much in advance.
Signed-off-by: Florian Fainelli <florian.fainelli@telecomint.eu>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'include/asm-mips/mach-au1x00')
-rw-r--r-- | include/asm-mips/mach-au1x00/au1xxx_gpio.h | 20 | ||||
-rw-r--r-- | include/asm-mips/mach-au1x00/gpio.h | 69 |
2 files changed, 69 insertions, 20 deletions
diff --git a/include/asm-mips/mach-au1x00/au1xxx_gpio.h b/include/asm-mips/mach-au1x00/au1xxx_gpio.h deleted file mode 100644 index 27911e054ffc..000000000000 --- a/include/asm-mips/mach-au1x00/au1xxx_gpio.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | #ifndef __AU1XXX_GPIO_H | ||
2 | #define __AU1XXX_GPIO_H | ||
3 | |||
4 | void au1xxx_gpio1_set_inputs(void); | ||
5 | void au1xxx_gpio_tristate(int signal); | ||
6 | void au1xxx_gpio_write(int signal, int value); | ||
7 | int au1xxx_gpio_read(int signal); | ||
8 | |||
9 | typedef volatile struct | ||
10 | { | ||
11 | u32 dir; | ||
12 | u32 reserved; | ||
13 | u32 output; | ||
14 | u32 pinstate; | ||
15 | u32 inten; | ||
16 | u32 enable; | ||
17 | |||
18 | } AU1X00_GPIO2; | ||
19 | |||
20 | #endif //__AU1XXX_GPIO_H | ||
diff --git a/include/asm-mips/mach-au1x00/gpio.h b/include/asm-mips/mach-au1x00/gpio.h new file mode 100644 index 000000000000..2dc61e009a08 --- /dev/null +++ b/include/asm-mips/mach-au1x00/gpio.h | |||
@@ -0,0 +1,69 @@ | |||
1 | #ifndef _AU1XXX_GPIO_H_ | ||
2 | #define _AU1XXX_GPIO_H_ | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | #define AU1XXX_GPIO_BASE 200 | ||
7 | |||
8 | struct au1x00_gpio2 { | ||
9 | u32 dir; | ||
10 | u32 reserved; | ||
11 | u32 output; | ||
12 | u32 pinstate; | ||
13 | u32 inten; | ||
14 | u32 enable; | ||
15 | }; | ||
16 | |||
17 | extern int au1xxx_gpio_get_value(unsigned gpio); | ||
18 | extern void au1xxx_gpio_set_value(unsigned gpio, int value); | ||
19 | extern int au1xxx_gpio_direction_input(unsigned gpio); | ||
20 | extern int au1xxx_gpio_direction_output(unsigned gpio, int value); | ||
21 | |||
22 | |||
23 | /* Wrappers for the arch-neutral GPIO API */ | ||
24 | |||
25 | static inline int gpio_request(unsigned gpio, const char *label) | ||
26 | { | ||
27 | /* Not yet implemented */ | ||
28 | return 0; | ||
29 | } | ||
30 | |||
31 | static inline void gpio_free(unsigned gpio) | ||
32 | { | ||
33 | /* Not yet implemented */ | ||
34 | } | ||
35 | |||
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> | ||
68 | |||
69 | #endif /* _AU1XXX_GPIO_H_ */ | ||