summaryrefslogtreecommitdiff
path: root/recipes-bsp/multitech/mts-io/mts-io.mtcap.init
diff options
context:
space:
mode:
authorBrandon Bayer <bbayer@multitech.com>2016-11-01 15:53:15 -0500
committerBrandon Bayer <bbayer@multitech.com>2016-11-01 15:53:15 -0500
commitde22fe2e10f6c1acdf8e5bddd7834f5d7fc168d7 (patch)
tree56c6fc3c9a8740eee83ea8d2fc6843b351e2fe4a /recipes-bsp/multitech/mts-io/mts-io.mtcap.init
parent17546fcb10af43ef4e9aef70ecff341848501278 (diff)
downloadmeta-multitech-de22fe2e10f6c1acdf8e5bddd7834f5d7fc168d7.tar.gz
meta-multitech-de22fe2e10f6c1acdf8e5bddd7834f5d7fc168d7.tar.bz2
meta-multitech-de22fe2e10f6c1acdf8e5bddd7834f5d7fc168d7.zip
mtcap: rename machine type mtp to mtcap
Diffstat (limited to 'recipes-bsp/multitech/mts-io/mts-io.mtcap.init')
-rw-r--r--recipes-bsp/multitech/mts-io/mts-io.mtcap.init47
1 files changed, 47 insertions, 0 deletions
diff --git a/recipes-bsp/multitech/mts-io/mts-io.mtcap.init b/recipes-bsp/multitech/mts-io/mts-io.mtcap.init
new file mode 100644
index 0000000..b4aa489
--- /dev/null
+++ b/recipes-bsp/multitech/mts-io/mts-io.mtcap.init
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+lora_init() {
+ # reset lora chip
+ mts-io-sysfs store lora-reset 0
+}
+
+eth_init() {
+ # reset eth phy
+ mts-io-sysfs store eth-reset 0
+}
+
+cell_init() {
+ # remove /dev/modem_at[0,1] symlinks
+ rm -f /dev/modem_at[0,1]
+
+ # power down the cellular chip gracefully
+ mts-io-sysfs store radio-power 0
+
+ # power up the cellular chip
+ mts-io-sysfs store radio-power 1
+}
+
+start_lora_led_updater() {
+ lora-led-updater &
+}
+
+case $1 in
+ start)
+ echo "Loading mts-io module"
+ modprobe mts_io
+ lora_init
+ eth_init
+ cell_init &
+ start_lora_led_updater
+ ;;
+
+ stop)
+ echo "Unloading mts-io module"
+ modprobe -r mts_io
+ ;;
+
+ *)
+ echo "Usage: $0 {start|stop}"
+ exit 2
+ ;;
+esac