summaryrefslogtreecommitdiff
path: root/recipes-bsp/multitech/mts-io/mts-io.mtcap.init
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-bsp/multitech/mts-io/mts-io.mtcap.init')
-rw-r--r--recipes-bsp/multitech/mts-io/mts-io.mtcap.init21
1 files changed, 21 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
index d33e5f4..7b77ec2 100644
--- a/recipes-bsp/multitech/mts-io/mts-io.mtcap.init
+++ b/recipes-bsp/multitech/mts-io/mts-io.mtcap.init
@@ -8,6 +8,25 @@ i2c=/sys/bus/i2c/devices/
SYSFS="/usr/sbin/mts-io-sysfs"
+GPSCONFIGTYPE="/var/run/config/gpstype"
+
+set_hw_name() {
+ hw=$(${SYSFS} show hw-version)
+ hw_name=(${hw//-/ })
+}
+
+set_gpslink() {
+ [[ -d /var/run/config ]] || mkdir /var/run/config
+ gpscap=$(cat ${sysdir}/capability/gps)
+
+ # hw_name must be mtcap, and gpscap == 1
+ if ! [[ ${hw_name} =~ ^MTCAP$ ]] || ((gpscap == 0)) ; then
+ return
+ fi
+ ln -sf /dev/ttyS1 /dev/gps0
+ echo "u-blox" >"$GPSCONFIGTYPE"
+}
+
setwificap() {
WIFICAP=0
if [[ -f ${sysdir}/capability/wifi ]] && (($(cat ${sysdir}/capability/wifi) == 1)) ; then
@@ -98,6 +117,8 @@ case $1 in
modprobe atmel_mci
(($WIFICAP)) && modprobe wilc1000
(($WIFICAP)) && modprobe wilc1000-sdio
+ set_hw_name
+ set_gps_link
;;
stop)