From 34c3f831e5f1d001dcf8ff6409a6d942a2720a8a Mon Sep 17 00:00:00 2001 From: John Klug Date: Mon, 26 Oct 2020 13:55:05 -0500 Subject: overlay has its own init script, remove mtcdt3b during stop, fix gps on MTCPM-BB --- recipes-bsp/multitech/mts-io.inc | 2 +- recipes-bsp/multitech/mts-io/mts-io.init | 36 +++++++++++++------------------- 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/recipes-bsp/multitech/mts-io.inc b/recipes-bsp/multitech/mts-io.inc index 42e4336..e894427 100644 --- a/recipes-bsp/multitech/mts-io.inc +++ b/recipes-bsp/multitech/mts-io.inc @@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://io-module/COPYING;md5=94d55d512a9ba36caa9b7df079bae19 file://io-tool/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ " do_fetch[depends] += "virtual/kernel:do_shared_workdir" -INC_PR = "r2" +INC_PR = "r3" SRCREV = "${PV}" PR = "${INC_PR}-${KERNEL_MODULE_PACKAGE_SUFFIX}" 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 -- cgit v1.2.3