3 # For AR9220 and AR9223, GPIO JTAG must explicit be disabled
4 # before LEDs start working. Do this when wifi device is
8 # $DEVPATH is not valid for some boards (including WZR-HP-AG300H).
9 # Manipulate the $DEVPATH to reach the corresponding phyN.
12 devdir
=$
(dirname $DEVPATH)
13 devdir
=$
(dirname $devdir)
14 phydir
=/sys
$devdir/ieee80211
16 [ -d $phydir ] ||
exit 0
18 phyname
=$
(cat $phydir/phy
*/name
)
20 [ -z $phyname -o $ACTION != "add" ] && exit 0
23 # ar922x_disable_gpio_jtag():
26 # REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL, AR_GPIO_JTAG_DISABLE);
27 # for AR9220 and AR9223.
30 ar922x_disable_gpio_jtag
() {
33 [ -f /sys
/kernel
/debug
/ieee80211
/$1/ath9k
/regidx
] ||
return
35 echo $regidx > /sys
/kernel
/debug
/ieee80211
/$1/ath9k
/regidx
36 regval
=$
(cat /sys
/kernel
/debug
/ieee80211
/$1/ath9k
/regval
)
37 regval
=$
((regval |
0x20000))
39 echo $regval > /sys
/kernel
/debug
/ieee80211
/$1/ath9k
/regval
42 [ $phyname -a $ACTION = "add" ] && {
47 ar922x_disable_gpio_jtag
$phyname