summaryrefslogtreecommitdiffstats
path: root/openwrt/target/linux/package/switch/src/gpio.h
diff options
context:
space:
mode:
authorwbx <wbx@3c298f89-4303-0410-b956-a3cf2f4a3e73>2005-12-25 14:18:55 +0000
committerwbx <wbx@3c298f89-4303-0410-b956-a3cf2f4a3e73>2005-12-25 14:18:55 +0000
commitfa8fb4e7c3be746703fee0dd34285f462ba104ec (patch)
tree38d2e6fe4d6e5dda5d3d514bedd9c2f38ef610ed /openwrt/target/linux/package/switch/src/gpio.h
parent4d747a7b6c5cf6f8415131a7e8b33a11c6788d5b (diff)
first try to integrate nbds great new switch drivers for 2.4/2.6 with full vlan support for Netgear and Linksys routers, robo and adm switch, tada
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@2776 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'openwrt/target/linux/package/switch/src/gpio.h')
-rw-r--r--openwrt/target/linux/package/switch/src/gpio.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/openwrt/target/linux/package/switch/src/gpio.h b/openwrt/target/linux/package/switch/src/gpio.h
new file mode 100644
index 000000000..95cf670f9
--- /dev/null
+++ b/openwrt/target/linux/package/switch/src/gpio.h
@@ -0,0 +1,39 @@
+#ifndef __GPIO_H
+#define __GPIO_H
+
+#if defined(BCMGPIO2)
+
+extern void *sbh;
+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 */