summaryrefslogtreecommitdiff
path: root/recipes-bsp/multitech/radio-reset
diff options
context:
space:
mode:
authorMykyta Dorokhin <mykyta.dorokhin@globallogic.com>2018-05-15 15:50:24 +0300
committerJohn Klug <john.klug@multitech.com>2018-05-15 12:03:49 -0500
commit0ae578fd7955cae5c63cc6e80ee46aaad12a5279 (patch)
tree7e88d7635af39d190544570c23a45953c162ff01 /recipes-bsp/multitech/radio-reset
parentd89ab03409d531d21a791108367ae68d0a1f22a0 (diff)
downloadmeta-multitech-0ae578fd7955cae5c63cc6e80ee46aaad12a5279.tar.gz
meta-multitech-0ae578fd7955cae5c63cc6e80ee46aaad12a5279.tar.bz2
meta-multitech-0ae578fd7955cae5c63cc6e80ee46aaad12a5279.zip
Move radio-reset init scripts to a separate recipe.
Diffstat (limited to 'recipes-bsp/multitech/radio-reset')
-rw-r--r--recipes-bsp/multitech/radio-reset/radio-reset.default11
-rw-r--r--recipes-bsp/multitech/radio-reset/radio-reset.init35
2 files changed, 46 insertions, 0 deletions
diff --git a/recipes-bsp/multitech/radio-reset/radio-reset.default b/recipes-bsp/multitech/radio-reset/radio-reset.default
new file mode 100644
index 0000000..56b0ebc
--- /dev/null
+++ b/recipes-bsp/multitech/radio-reset/radio-reset.default
@@ -0,0 +1,11 @@
+# If Enabled, it is possible to reset the radio on boot or shutdown.
+# It is always possible to reset the radio using
+# /etc/init.d/radio-reset reload manually.
+ENABLED="yes"
+
+# set to "yes" to enable radio-reset on boot
+ONSTART="no"
+
+# set to "no" to disable radio-reset on reboot
+ONSTOP="yes"
+
diff --git a/recipes-bsp/multitech/radio-reset/radio-reset.init b/recipes-bsp/multitech/radio-reset/radio-reset.init
new file mode 100644
index 0000000..1326fee
--- /dev/null
+++ b/recipes-bsp/multitech/radio-reset/radio-reset.init
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+# set default values
+ENABLED="yes"
+ONSTART="no"
+ONSTOP="yes"
+
+if ! [[ -w /sys/devices/platform/mts-io/radio-reset ]] ; then
+ exit 0
+fi
+
+# load the values from /etc/default/radio-reset
+[ -r /etc/default/radio-reset ] && source /etc/default/radio-reset
+
+case $1 in
+ start)
+ if [[ $ENABLED == "yes" ]] && [[ $ONSTART == "yes" ]] ; then
+ mts-io-sysfs store radio-reset 0
+ echo "Resetting cellular radio"
+ fi
+ ;;
+ stop)
+ if [[ $ENABLED == "yes" ]] && [[ $ONSTOP == "yes" ]] ; then
+ mts-io-sysfs store radio-reset 0
+ echo "Resetting cellular radio"
+ fi
+ ;;
+ reload)
+ mts-io-sysfs store radio-reset 0
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|reload}"
+ exit 2
+ ;;
+esac