diff options
author | Felix Fietkau <nbd@openwrt.org> | 2006-05-31 16:01:46 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2006-05-31 16:01:46 +0000 |
commit | 337621e4682ad459b28f23c2cacebc29a88fbde1 (patch) | |
tree | d68bde34fb72b60dfebbac350ca4de6f60de1589 /openwrt/package/switch/src/gpio.h | |
parent | 7486d2e8d5b442143ce94c0524e86a67b5c338b9 (diff) | |
download | mtk-20170518-337621e4682ad459b28f23c2cacebc29a88fbde1.zip mtk-20170518-337621e4682ad459b28f23c2cacebc29a88fbde1.tar.gz mtk-20170518-337621e4682ad459b28f23c2cacebc29a88fbde1.tar.bz2 |
move target/linux/package/switch to package/, fix a bug in the ipkg dependency handling
SVN-Revision: 3864
Diffstat (limited to 'openwrt/package/switch/src/gpio.h')
-rw-r--r-- | openwrt/package/switch/src/gpio.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/openwrt/package/switch/src/gpio.h b/openwrt/package/switch/src/gpio.h new file mode 100644 index 0000000..8257600 --- /dev/null +++ b/openwrt/package/switch/src/gpio.h @@ -0,0 +1,45 @@ +#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 */ |