summaryrefslogtreecommitdiff
path: root/recipes-bsp/multitech/mts-io/mts-io.mtcap.init
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2017-02-28 17:48:45 -0600
committerJohn Klug <john.klug@multitech.com>2017-02-28 17:48:45 -0600
commitb97bc8996ad22ac770fcc98fec966d1fc5fea2a6 (patch)
treefcda4bfe022e60db13c96aa778f773eda5838649 /recipes-bsp/multitech/mts-io/mts-io.mtcap.init
parent9d58a28208d250af88d966c4131d055c21b3510b (diff)
downloadmeta-multitech-b97bc8996ad22ac770fcc98fec966d1fc5fea2a6.tar.gz
meta-multitech-b97bc8996ad22ac770fcc98fec966d1fc5fea2a6.tar.bz2
meta-multitech-b97bc8996ad22ac770fcc98fec966d1fc5fea2a6.zip
Add wilc1000 driver to mts-io init script
Diffstat (limited to 'recipes-bsp/multitech/mts-io/mts-io.mtcap.init')
-rw-r--r--recipes-bsp/multitech/mts-io/mts-io.mtcap.init27
1 files changed, 26 insertions, 1 deletions
diff --git a/recipes-bsp/multitech/mts-io/mts-io.mtcap.init b/recipes-bsp/multitech/mts-io/mts-io.mtcap.init
index 1366f28..8a597d7 100644
--- a/recipes-bsp/multitech/mts-io/mts-io.mtcap.init
+++ b/recipes-bsp/multitech/mts-io/mts-io.mtcap.init
@@ -1,5 +1,6 @@
#!/bin/bash
+sysdir=/sys/devices/platform/mts-io
lora_init() {
# reset lora chip
mts-io-sysfs store lora/reset 1
@@ -16,6 +17,23 @@ eth_init() {
mts-io-sysfs store eth-reset 1
}
+# Normal state when powered up
+wifi_init1() {
+ [[ -f ${sysdir}/capability/wifi ]] || return 0
+ # reset wlan
+ mts-io-sysfs store wlan-rst 0
+ # disable wlan
+ mts-io-sysfs store wlan-en 0
+}
+
+wifi_init2() {
+ [[ -f ${sysdir}/capability/wifi ]] || return 0
+ mts-io-sysfs store wlan-en 1
+ usleep 30000 # 30mS according to WILC1000 spec.
+ mts-io-sysfs store wlan-rst 1
+}
+
+
cell_init() {
# remove /dev/modem_at[0,1] symlinks
rm -f /dev/modem_at[0,1]
@@ -34,16 +52,23 @@ start_lora_led_updater() {
case $1 in
start)
echo "Loading mts-io module"
+ modprobe -r atmel_mci
modprobe mts_io
+ wifi_init1
lora_init
eth_init
cell_init &
start_lora_led_updater
+ wifi_init2
+ modprobe atmel_mci
+ [[ -f ${sysdir}/capability/wifi ]] && modprobe wilc1000
;;
stop)
echo "Unloading mts-io module"
- modprobe -r mts_io
+ wifi_init1 # Power down wifi
+ [[ -f ${sysdir}/capability/wifi ]] && modprobe -r wilc1000 >/dev/null 2>&1
+ modprobe -r mts_io >/dev/null 2>&1
;;
*)