051c468f87bbdc645d6baf9e60ceed37086617b4
[openwrt/openwrt.git] / target / linux / ath79 / generic / base-files / etc / board.d / 03_gpio_switches
1 #!/bin/sh
2 #
3 # Copyright (C) 2018 OpenWrt.org
4 #
5
6 . /lib/functions/uci-defaults.sh
7
8 board_config_update
9
10 board=$(board_name)
11
12 case "$board" in
13 adtran,bsap1800-v2|\
14 adtran,bsap1840)
15 ucidef_add_gpio_switch "wifi1_ext_a" "5GHz External Antenna A" "489" "1"
16 ucidef_add_gpio_switch "wifi1_int_a" "5GHz Internal Antenna A" "493"
17 ucidef_add_gpio_switch "wifi1_ext_b" "5GHz External Antenna B" "494" "1"
18 ucidef_add_gpio_switch "wifi1_int_b" "5GHz Internal Antenna B" "495"
19 ucidef_add_gpio_switch "wifi1_ext_c" "5GHz External Antenna C" "496" "1"
20 ucidef_add_gpio_switch "wifi1_int_c" "5GHz Internal Antenna C" "497"
21 ucidef_add_gpio_switch "wifi0_ext_a" "2.4GHz External Antenna A" "505" "1"
22 ucidef_add_gpio_switch "wifi0_int_a" "2.4GHz Internal Antenna A" "506"
23 ucidef_add_gpio_switch "wifi0_ext_b" "2.4GHz External Antenna B" "507" "1"
24 ucidef_add_gpio_switch "wifi0_int_b" "2.4GHz Internal Antenna B" "508"
25 ucidef_add_gpio_switch "wifi0_ext_c" "2.4GHz External Antenna C" "509" "1"
26 ucidef_add_gpio_switch "wifi0_int_c" "2.4GHz Internal Antenna C" "510"
27 ;;
28 comfast,cf-e5)
29 ucidef_add_gpio_switch "lte_power" "LTE Power" "14" "1"
30 ucidef_add_gpio_switch "lte_wakeup" "LTE Wakeup" "11" "1"
31 ucidef_add_gpio_switch "lte_poweroff" "LTE Poweroff" "1" "1"
32 ucidef_add_gpio_switch "lte_reset" "LTE Reset" "12" "1"
33 ;;
34 devolo,magic-2-wifi)
35 ucidef_add_gpio_switch "plc_pairing" "PLC pairing" "11" "1"
36 ucidef_add_gpio_switch "plc_enable" "PLC enable" "13" "1"
37 ;;
38 dlink,dir-825-c1|\
39 dlink,dir-835-a1)
40 ucidef_add_gpio_switch "wan_led_auto" "WAN LED Auto" "20" "0"
41 ;;
42 librerouter,librerouter-v1)
43 ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "1" "0"
44 ;;
45 teltonika,rut955)
46 ucidef_add_gpio_switch "sim_sel" "SIM select" "503" "1"
47 ucidef_add_gpio_switch "DOUT1" "DOUT1 (OC)" "504" "0"
48 ucidef_add_gpio_switch "DOUT2" "DOUT2 (Relay)" "505" "0"
49 ucidef_add_gpio_switch "modem_vbus" "Modem enable" "506" "1"
50 ucidef_add_gpio_switch "modem_rst" "Modem reset" "507" "0"
51 ucidef_add_gpio_switch "DOUT3" "DOUT3" "508" "0"
52 ;;
53 tplink,archer-c25-v1)
54 ucidef_add_gpio_switch "led_control" "LED control" "21" "0"
55 ucidef_add_gpio_switch "led_reset" "LED reset" "19" "1"
56 ;;
57 tplink,cpe210-v1|\
58 tplink,cpe220-v2|\
59 tplink,cpe220-v3|\
60 tplink,cpe510-v1|\
61 tplink,wbs210-v2|\
62 tplink,wbs510-v1|\
63 tplink,wbs510-v2)
64 ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "20"
65 ;;
66 ubnt,nanostation-ac)
67 ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "3"
68 ;;
69 ubnt,nanostation-m)
70 ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "8"
71 ;;
72 ubnt,nanostation-m-xw)
73 ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "2"
74 ;;
75 ubnt,acb-isp)
76 ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "11"
77 ;;
78 zbtlink,zbt-wd323)
79 ucidef_add_gpio_switch "io0" "IO#0" "0"
80 ucidef_add_gpio_switch "io1" "IO#1" "1"
81 ucidef_add_gpio_switch "io2" "IO#2" "2"
82 ucidef_add_gpio_switch "io14" "IO#14" "14"
83 ;;
84 esac
85
86 board_config_flush
87
88 exit 0