ar71xx: convert gpio switch config to board.d
[openwrt/openwrt.git] / target / linux / ar71xx / base-files / etc / board.d / 03_gpio_switches
diff --git a/target/linux/ar71xx/base-files/etc/board.d/03_gpio_switches b/target/linux/ar71xx/base-files/etc/board.d/03_gpio_switches
new file mode 100755 (executable)
index 0000000..9a1be1a
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+
+. /lib/functions/uci-defaults-new.sh
+. /lib/ar71xx.sh
+
+board_config_update
+
+board=$(ar71xx_board_name)
+
+case "$board" in
+nanostation-m)
+       ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "8"
+       ;;
+nanostation-m-xw)
+       ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "2"
+       ;;
+cpe510)
+       ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "20"
+       ;;
+esac
+
+board_config_flush
+
+exit 0