summaryrefslogtreecommitdiff
path: root/recipes-bsp/multitech/mts-io
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-bsp/multitech/mts-io')
-rw-r--r--recipes-bsp/multitech/mts-io/mts-io.mtp.init30
1 files changed, 30 insertions, 0 deletions
diff --git a/recipes-bsp/multitech/mts-io/mts-io.mtp.init b/recipes-bsp/multitech/mts-io/mts-io.mtp.init
new file mode 100644
index 0000000..f8df7ff
--- /dev/null
+++ b/recipes-bsp/multitech/mts-io/mts-io.mtp.init
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+hardware_init() {
+ # reset lora chip
+ mts-io-sysfs store lora-reset 0
+
+ # 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
+}
+
+case $1 in
+ start)
+ echo "Loading mts-io module"
+ modprobe mts_io
+ hardware_init &
+ ;;
+
+ stop)
+ echo "Unloading mts-io module"
+ modprobe -r mts_io
+ ;;
+
+ *)
+ echo "Usage: $0 {start|stop}"
+ exit 2
+ ;;
+esac