patch nvram library for new nas version (thx to Vincent Bernat)
[openwrt.git] / openwrt / target / linux / package / switch / src / gpio.h
1 #ifndef __GPIO_H
2 #define __GPIO_H
3
4 #if defined(BCMGPIO2)
5
6 #ifdef LINUX_2_4
7 #define sbh bcm947xx_sbh
8 extern void *bcm947xx_sbh;
9 #else
10 extern void *sbh;
11 #endif
12
13 extern __u32 sb_gpioin(void *sbh);
14 extern __u32 sb_gpiointpolarity(void *sbh, __u32 mask, __u32 val, __u8 prio);
15 extern __u32 sb_gpiointmask(void *sbh, __u32 mask, __u32 val, __u8 prio);
16 extern __u32 sb_gpioouten(void *sbh, __u32 mask, __u32 val, __u8 prio);
17 extern __u32 sb_gpioout(void *sbh, __u32 mask, __u32 val, __u8 prio);
18
19 #define gpioin() sb_gpioin(sbh)
20 #define gpiointpolarity(mask,val) sb_gpiointpolarity(sbh, mask, val, 0)
21 #define gpiointmask(mask,val) sb_gpiointmask(sbh, mask, val, 0)
22 #define gpioouten(mask,val) sb_gpioouten(sbh, mask, val, 0)
23 #define gpioout(mask,val) sb_gpioout(sbh, mask, val, 0)
24
25 #elif defined(BCMGPIO)
26
27 #define sbh bcm947xx_sbh
28 extern void *bcm947xx_sbh;
29 extern __u32 sb_gpioin(void *sbh);
30 extern __u32 sb_gpiointpolarity(void *sbh, __u32 mask, __u32 val);
31 extern __u32 sb_gpiointmask(void *sbh, __u32 mask, __u32 val);
32 extern __u32 sb_gpioouten(void *sbh, __u32 mask, __u32 val);
33 extern __u32 sb_gpioout(void *sbh, __u32 mask, __u32 val);
34
35 #define gpioin() sb_gpioin(sbh)
36 #define gpiointpolarity(mask,val) sb_gpiointpolarity(sbh, mask, val)
37 #define gpiointmask(mask,val) sb_gpiointmask(sbh, mask, val)
38 #define gpioouten(mask,val) sb_gpioouten(sbh, mask, val)
39 #define gpioout(mask,val) sb_gpioout(sbh, mask, val)
40
41 #else
42 #error Unsupported/unknown GPIO configuration
43 #endif
44
45 #endif /* __GPIO_H */
This page took 0.052864 seconds and 5 git commands to generate.