diff options
Diffstat (limited to 'recipes-bsp/multitech/mt-dt-overlay/init')
-rwxr-xr-x | recipes-bsp/multitech/mt-dt-overlay/init | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/recipes-bsp/multitech/mt-dt-overlay/init b/recipes-bsp/multitech/mt-dt-overlay/init index 5bd8523..c2d9716 100755 --- a/recipes-bsp/multitech/mt-dt-overlay/init +++ b/recipes-bsp/multitech/mt-dt-overlay/init @@ -5,6 +5,8 @@ # device tree. sysdir=/sys/devices/platform/mts-io +i2c=/sys/bus/i2c/devices/ +eepromPath="/sys/devices/platform/i2c-gpio-0/i2c-0/0-0056/eeprom" DEVTREE="/sys/kernel/config/device-tree/overlays/" SYSFS="/usr/sbin/mts-io-sysfs" @@ -28,7 +30,7 @@ install_dtbo_dir() { done modprobe mt_ac_gpiob else - for f in *lora.dtbo ; do + for f in *.dtbo ; do if ! [[ -f $f ]] ; then continue fi @@ -47,7 +49,9 @@ install_dtbo_dir() { # [flag] # [file1] [file2] [file3] setdevtree() { - hw=$(${SYSFS} show hw-version) + hwlin=$(mts-id-eeprom --in-file "$eepromPath" 2>/dev/null | grep '^hw-version:') + [[ $hwlin =~ hw-version:[[:space:]]*\"([^\"]+) ]] + hw=${BASH_REMATCH[1]} mach=${hw/%-*} rev=${hw/#*-/} echo mach is $mach |