dd2c0f3d5579c5580ff786603cf39ef57b79ae7c
[openwrt/svn-archive/archive.git] / target / linux / brcm63xx / files / include / asm-mips / mach-bcm63xx / gpio.h
1 #ifndef __ASM_MIPS_MACH_BCM63XX_GPIO_H
2 #define __ASM_MIPS_MACH_BCM63XX_GPIO_H
3
4 #include <bcm63xx_gpio.h>
5
6 static inline int gpio_is_valid(int number)
7 {
8 return (number >= BCM63XX_GPIO_COUNT) ? 0 : 1;
9 }
10
11 static inline int gpio_request(unsigned gpio, const char *label)
12 {
13 return 0;
14 }
15
16 static inline void gpio_free(unsigned gpio)
17 {
18 }
19
20 static inline int gpio_direction_input(unsigned gpio)
21 {
22 bcm63xx_gpio_set_direction(gpio, GPIO_DIR_IN);
23 return 0;
24 }
25
26 static inline int gpio_direction_output(unsigned gpio, int value)
27 {
28 bcm63xx_gpio_set_direction(gpio, GPIO_DIR_OUT);
29 return 0;
30 }
31
32 static inline int gpio_get_value(unsigned gpio)
33 {
34 return bcm63xx_gpio_get_datain(gpio);
35 }
36
37 static inline void gpio_set_value(unsigned gpio, int value)
38 {
39 bcm63xx_gpio_set_dataout(gpio, value);
40 }
41
42 static inline int gpio_to_irq(unsigned gpio)
43 {
44 return gpio;
45 }
46
47 static inline int irq_to_gpio(unsigned irq)
48 {
49 return irq;
50 }
51
52 #endif /* __ASM_MIPS_MACH_BCM63XX_GPIO_H */