diff options
author | Jason Reiss <jreiss@multitech.com> | 2017-02-13 14:27:45 -0600 |
---|---|---|
committer | Jason Reiss <jreiss@multitech.com> | 2017-02-13 14:27:45 -0600 |
commit | 3b50a48f55c1221968caceaff6299bdbe95ab83c (patch) | |
tree | 3d97d9c2aed76ac03e703c4bf54385565628f196 /recipes-bsp/multitech/mts-io/mts-io.init | |
parent | b14d76b5bdbbf062730427db5a99b2a81bc6ee15 (diff) | |
download | meta-multitech-3b50a48f55c1221968caceaff6299bdbe95ab83c.tar.gz meta-multitech-3b50a48f55c1221968caceaff6299bdbe95ab83c.tar.bz2 meta-multitech-3b50a48f55c1221968caceaff6299bdbe95ab83c.zip |
mts-io: add link creation for MTAC-LORA SPI cards spidev0.0 -> ap1 or ap23.3.2
Diffstat (limited to 'recipes-bsp/multitech/mts-io/mts-io.init')
-rw-r--r-- | recipes-bsp/multitech/mts-io/mts-io.init | 10 |
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() { |