summaryrefslogtreecommitdiff
path: root/recipes-bsp/multitech/mts-io/mts-io.mtcap.init
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2020-09-18 16:05:38 -0500
committerJohn Klug <john.klug@multitech.com>2021-06-22 11:39:36 -0500
commit85c273e4f16b398a1a9f12a6c1244da140f3f857 (patch)
tree45330af341afbe59e790494d4574622289a5648e /recipes-bsp/multitech/mts-io/mts-io.mtcap.init
parent067a4b3a3dd4a0bccd71649303487c6dcc2ca9e3 (diff)
downloadmeta-multitech-85c273e4f16b398a1a9f12a6c1244da140f3f857.tar.gz
meta-multitech-85c273e4f16b398a1a9f12a6c1244da140f3f857.tar.bz2
meta-multitech-85c273e4f16b398a1a9f12a6c1244da140f3f857.zip
Update mts-io driver for GPS on MTCAP
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)