From 3b50a48f55c1221968caceaff6299bdbe95ab83c Mon Sep 17 00:00:00 2001 From: Jason Reiss Date: Mon, 13 Feb 2017 14:27:45 -0600 Subject: mts-io: add link creation for MTAC-LORA SPI cards spidev0.0 -> ap1 or ap2 --- recipes-bsp/multitech/mts-io/mts-io.init | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'recipes-bsp') 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() { -- cgit v1.2.3