summaryrefslogtreecommitdiff
path: root/recipes-bsp/multitech/mt-dt-overlay/init
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2021-11-08 03:41:21 -0600
committerAndrii Pientsov <andrii.pientsov@globallogic.com>2021-11-18 14:49:55 +0200
commitcbcd9e1dcc299fcbb2ccbf09bc8aa1aa1750618c (patch)
tree1380c93bc12f5d53995aca5242d91c19f6283afa /recipes-bsp/multitech/mt-dt-overlay/init
parent0b7036679cf0c057f0ae492e84438270797faf4f (diff)
downloadmeta-multitech-cbcd9e1dcc299fcbb2ccbf09bc8aa1aa1750618c.tar.gz
meta-multitech-cbcd9e1dcc299fcbb2ccbf09bc8aa1aa1750618c.tar.bz2
meta-multitech-cbcd9e1dcc299fcbb2ccbf09bc8aa1aa1750618c.zip
mt-dt-overlay must come before mts-io for gpio-leds driver
Diffstat (limited to 'recipes-bsp/multitech/mt-dt-overlay/init')
-rwxr-xr-xrecipes-bsp/multitech/mt-dt-overlay/init6
1 files changed, 5 insertions, 1 deletions
diff --git a/recipes-bsp/multitech/mt-dt-overlay/init b/recipes-bsp/multitech/mt-dt-overlay/init
index 5bd8523..bb6790b 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"
@@ -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