diff options
author | John Klug <john.klug@multitech.com> | 2020-10-26 13:55:05 -0500 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2020-10-26 13:55:05 -0500 |
commit | ad510ba0fa0fb01e90c588ab228fd62525b2f43b (patch) | |
tree | 5c5e2c341d38f601e3d8e740d92df36853cd1924 /recipes-bsp/multitech/mts-io | |
parent | 679990b4efdbe022d65f889645c04652056bb578 (diff) | |
download | meta-multitech-ad510ba0fa0fb01e90c588ab228fd62525b2f43b.tar.gz meta-multitech-ad510ba0fa0fb01e90c588ab228fd62525b2f43b.tar.bz2 meta-multitech-ad510ba0fa0fb01e90c588ab228fd62525b2f43b.zip |
overlay has its own init script, remove mtcdt3b during stop, fix gps on MTCPM-BB
Diffstat (limited to 'recipes-bsp/multitech/mts-io')
-rwxr-xr-x | recipes-bsp/multitech/mts-io/mts-io.init | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/recipes-bsp/multitech/mts-io/mts-io.init b/recipes-bsp/multitech/mts-io/mts-io.init index fee8f61..443b5ec 100755 --- a/recipes-bsp/multitech/mts-io/mts-io.init +++ b/recipes-bsp/multitech/mts-io/mts-io.init @@ -13,7 +13,6 @@ i2c=/sys/bus/i2c/devices/ GPSCONFIGTYPE="/var/run/config/gpstype" -DEVTREE="/sys/kernel/config/device-tree/overlays/" HWPATH="/sys/devices/platform/mts-io/hw-version" MTSIOMODPATH="/lib/modules/$(uname -r)/extra/" MTCDTBB="${MTSIOMODPATH}/mtcdt3b.ko" @@ -59,25 +58,6 @@ sethwtype() { } -setdevtree() { - # add device tree overlays, if they exist. - [[ -d /lib/dtoverlays ]] || return 1 - ( - cd /lib/dtoverlays - for f in $(ls ${hw}*) ; do - if ! [[ -d ${DEVTREE} ]] ; then - mount configfs - fi - f1=${f/#${hw}-/} - f2=${f1/%.dtbo} - # f2 is the extracted device name - /bin/mkdir ${DEVTREE}/$f2 - /bin/cat $f >${DEVTREE}/$f2/dtbo - done - ) -} - - SYSFS="/usr/sbin/mts-io-sysfs" LRST="/usr/sbin/mts-util-lora2-reset" @@ -278,7 +258,17 @@ set_gpslink() { return ;; MTCDT3) - ln -sf /dev/ttyS1 /dev/gps0 + [[ $hw =~ ^[^-]*-([^-]*) ]] + bbtype=${BASH_REMATCH[1]} + echo "hw_name: ${hw_name} bbtype: ${bbtype}" + case ${bbtype} in + LORA16) + ln -sf /dev/ttyS1 /dev/gps0 + ;; + BB) + ln -sf /dev/ttyACM0 /dev/gps0 + ;; + esac echo "u-blox" >"$GPSCONFIGTYPE" return ;; @@ -315,7 +305,6 @@ case $1 in fi sethwtype - setdevtree if ((HASAP == 1)) ; then # install mtac explicitly or any unused modules will cause @@ -383,6 +372,9 @@ case $1 in rmmod mtac fi + if ! modprobe -r mtcdt3b ; then + rmmod mtcdt3b + fi if ! modprobe -r mts-io ; then rmmod mtsio fi |