diff options
author | Felix Fietkau <nbd@openwrt.org> | 2006-10-13 22:51:49 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2016-03-20 17:29:15 +0100 |
commit | 60c1f0f64d23003a19a07d6b9638542130f6641d (patch) | |
tree | 8fb2787f4c49baded97cd55e0c371fe1cffce2b6 /package/switch/src/gpio.h | |
parent | d58a09110ccfa95f06c983fe796806f2e035c9d2 (diff) | |
parent | b3ce218b51746d3a576221ea542facf3a1703ab2 (diff) | |
download | mtk-20170518-60c1f0f64d23003a19a07d6b9638542130f6641d.zip mtk-20170518-60c1f0f64d23003a19a07d6b9638542130f6641d.tar.gz mtk-20170518-60c1f0f64d23003a19a07d6b9638542130f6641d.tar.bz2 |
finally move buildroot-ng to trunk
Diffstat (limited to 'package/switch/src/gpio.h')
-rw-r--r-- | package/switch/src/gpio.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/package/switch/src/gpio.h b/package/switch/src/gpio.h new file mode 100644 index 0000000..800ae25 --- /dev/null +++ b/package/switch/src/gpio.h @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2006 OpenWrt.org + * + * This is free software, licensed under the GNU General Public License v2. + * See /LICENSE for more information. + */ + +#ifndef __GPIO_H +#define __GPIO_H + +#if defined(BCMGPIO2) + +#ifdef LINUX_2_4 +#define sbh bcm947xx_sbh +extern void *bcm947xx_sbh; +#else +extern void *sbh; +#endif + +extern __u32 sb_gpioin(void *sbh); +extern __u32 sb_gpiointpolarity(void *sbh, __u32 mask, __u32 val, __u8 prio); +extern __u32 sb_gpiointmask(void *sbh, __u32 mask, __u32 val, __u8 prio); +extern __u32 sb_gpioouten(void *sbh, __u32 mask, __u32 val, __u8 prio); +extern __u32 sb_gpioout(void *sbh, __u32 mask, __u32 val, __u8 prio); + +#define gpioin() sb_gpioin(sbh) +#define gpiointpolarity(mask,val) sb_gpiointpolarity(sbh, mask, val, 0) +#define gpiointmask(mask,val) sb_gpiointmask(sbh, mask, val, 0) +#define gpioouten(mask,val) sb_gpioouten(sbh, mask, val, 0) +#define gpioout(mask,val) sb_gpioout(sbh, mask, val, 0) + +#elif defined(BCMGPIO) + +#define sbh bcm947xx_sbh +extern void *bcm947xx_sbh; +extern __u32 sb_gpioin(void *sbh); +extern __u32 sb_gpiointpolarity(void *sbh, __u32 mask, __u32 val); +extern __u32 sb_gpiointmask(void *sbh, __u32 mask, __u32 val); +extern __u32 sb_gpioouten(void *sbh, __u32 mask, __u32 val); +extern __u32 sb_gpioout(void *sbh, __u32 mask, __u32 val); + +#define gpioin() sb_gpioin(sbh) +#define gpiointpolarity(mask,val) sb_gpiointpolarity(sbh, mask, val) +#define gpiointmask(mask,val) sb_gpiointmask(sbh, mask, val) +#define gpioouten(mask,val) sb_gpioouten(sbh, mask, val) +#define gpioout(mask,val) sb_gpioout(sbh, mask, val) + +#else +#error Unsupported/unknown GPIO configuration +#endif + +#endif /* __GPIO_H */ |