summaryrefslogtreecommitdiff
path: root/recipes-bsp
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-bsp')
-rw-r--r--recipes-bsp/multitech/mts-io/mts-io.init10
1 files changed, 10 insertions, 0 deletions
diff --git a/recipes-bsp/multitech/mts-io/mts-io.init b/recipes-bsp/multitech/mts-io/mts-io.init
index 550cc85..a2bd136 100644
--- a/recipes-bsp/multitech/mts-io/mts-io.init
+++ b/recipes-bsp/multitech/mts-io/mts-io.init
@@ -22,6 +22,8 @@ fi
${LOGDBG} -p daemon.info 'mts-io script'
sysdir=/sys/devices/platform/mts-io
gpiodir=/sys/class/gpio
+port1=${sysdir}/ap1
+port2=${sysdir}/ap2
USBRST=${sysdir}/usbhub-reset
@@ -141,6 +143,14 @@ read_card_info() {
if [[ -d $sysdir/ap2 ]]; then
ap2_product_id=$(cat $sysdir/ap2/product-id)
fi
+
+ lora_hw=$(mts-io-sysfs show lora/hw-version 2> /dev/null)
+
+ if [ -d $port1 ] && [[ $(cat $port1/hw-version) = $lora_hw ]]; then
+ ln -sf /dev/spidev32766.2 /dev/spidev0.0
+ elif [ -d $port2 ] && [[ $(cat $port2/hw-version) = $lora_hw ]]; then
+ ln -sf /dev/spidev32765.2 /dev/spidev0.0
+ fi
}
mfser_init() {