avoid eval leaks
[openwrt.git] / package / switch / src / gpio.h
1 /*
2 * Copyright (C) 2006 OpenWrt.org
3 *
4 * This is free software, licensed under the GNU General Public License v2.
5 * See /LICENSE for more information.
6 */
7
8 #ifndef __GPIO_H
9 #define __GPIO_H
10
11 #if defined(BCMGPIO2)
12
13 #ifdef LINUX_2_4
14 #define sbh bcm947xx_sbh
15 extern void *bcm947xx_sbh;
16 #else
17 extern void *sbh;
18 #endif
19
20 extern __u32 sb_gpioin(void *sbh);
21 extern __u32 sb_gpiointpolarity(void *sbh, __u32 mask, __u32 val, __u8 prio);
22 extern __u32 sb_gpiointmask(void *sbh, __u32 mask, __u32 val, __u8 prio);
23 extern __u32 sb_gpioouten(void *sbh, __u32 mask, __u32 val, __u8 prio);
24 extern __u32 sb_gpioout(void *sbh, __u32 mask, __u32 val, __u8 prio);
25
26 #define gpioin() sb_gpioin(sbh)
27 #define gpiointpolarity(mask,val) sb_gpiointpolarity(sbh, mask, val, 0)
28 #define gpiointmask(mask,val) sb_gpiointmask(sbh, mask, val, 0)
29 #define gpioouten(mask,val) sb_gpioouten(sbh, mask, val, 0)
30 #define gpioout(mask,val) sb_gpioout(sbh, mask, val, 0)
31
32 #elif defined(BCMGPIO)
33
34 #define sbh bcm947xx_sbh
35 extern void *bcm947xx_sbh;
36 extern __u32 sb_gpioin(void *sbh);
37 extern __u32 sb_gpiointpolarity(void *sbh, __u32 mask, __u32 val);
38 extern __u32 sb_gpiointmask(void *sbh, __u32 mask, __u32 val);
39 extern __u32 sb_gpioouten(void *sbh, __u32 mask, __u32 val);
40 extern __u32 sb_gpioout(void *sbh, __u32 mask, __u32 val);
41
42 #define gpioin() sb_gpioin(sbh)
43 #define gpiointpolarity(mask,val) sb_gpiointpolarity(sbh, mask, val)
44 #define gpiointmask(mask,val) sb_gpiointmask(sbh, mask, val)
45 #define gpioouten(mask,val) sb_gpioouten(sbh, mask, val)
46 #define gpioout(mask,val) sb_gpioout(sbh, mask, val)
47
48 #else
49 #error Unsupported/unknown GPIO configuration
50 #endif
51
52 #endif /* __GPIO_H */
This page took 0.046078 seconds and 5 git commands to generate.