summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--recipes-bsp/multitech/mts-io.inc8
-rw-r--r--recipes-bsp/multitech/mts-io/mts-io.mtp.init30
2 files changed, 36 insertions, 2 deletions
diff --git a/recipes-bsp/multitech/mts-io.inc b/recipes-bsp/multitech/mts-io.inc
index 5f17458..6d77e34 100644
--- a/recipes-bsp/multitech/mts-io.inc
+++ b/recipes-bsp/multitech/mts-io.inc
@@ -15,6 +15,7 @@ SRC_URI = " \
git://git.multitech.net/mts-io.git;protocol=git \
file://led-status_heartbeat_trigger \
file://mts-io.init \
+ file://mts-io.mtp.init \
file://radio-reset.init \
file://radio-reset.default \
"
@@ -84,7 +85,10 @@ fakeroot do_install () {
install -m 0644 ${WORKDIR}/radio-reset.default ${D}${sysconfdir}/default/radio-reset
}
-# disable radio-reset for the mtp hardware
-do_install_append_mtp() {
+fakeroot do_install_append_mtp() {
+ # install MTP mts-io init script
+ install -m 0755 ${WORKDIR}/mts-io.mtp.init ${D}${sysconfdir}/init.d/mts-io
+
+ # disable radio-reset for the mtp hardware
sed -i 's/ENABLED="yes"/ENABLED="no"/g' ${D}${sysconfdir}/default/radio-reset
}
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