873bffe302dbc7531b353eecd34c755141b6171c
[openwrt-10.03/.git] / target / linux / rdc / files-2.6.30 / arch / x86 / include / asm / mach-rdc321x / gpio.h
1 #ifndef _ASM_X86_MACH_RDC321X_GPIO_H
2 #define _ASM_X86_MACH_RDC321X_GPIO_H
3
4 #include <linux/kernel.h>
5
6 extern int rdc_gpio_get_value(unsigned gpio);
7 extern void rdc_gpio_set_value(unsigned gpio, int value);
8 extern int rdc_gpio_direction_input(unsigned gpio);
9 extern int rdc_gpio_direction_output(unsigned gpio, int value);
10 extern int rdc_gpio_request(unsigned gpio, const char *label);
11 extern void rdc_gpio_free(unsigned gpio);
12
13 /* Wrappers for the arch-neutral GPIO API */
14
15 static inline int gpio_request(unsigned gpio, const char *label)
16 {
17         return rdc_gpio_request(gpio, label);
18 }
19
20 static inline void gpio_free(unsigned gpio)
21 {
22         might_sleep();
23         rdc_gpio_free(gpio);
24 }
25
26 static inline int gpio_direction_input(unsigned gpio)
27 {
28         return rdc_gpio_direction_input(gpio);
29 }
30
31 static inline int gpio_direction_output(unsigned gpio, int value)
32 {
33         return rdc_gpio_direction_output(gpio, value);
34 }
35
36 static inline int gpio_get_value(unsigned gpio)
37 {
38         return rdc_gpio_get_value(gpio);
39 }
40
41 static inline void gpio_set_value(unsigned gpio, int value)
42 {
43         rdc_gpio_set_value(gpio, value);
44 }
45
46 static inline int gpio_to_irq(unsigned gpio)
47 {
48         return gpio;
49 }
50
51 static inline int irq_to_gpio(unsigned irq)
52 {
53         return irq;
54 }
55
56 /* For cansleep */
57 #include <asm-generic/gpio.h>
58
59 #endif /* _ASM_X86_MACH_RDC321X_GPIO_H */