diff options
author | John Klug <john.klug@multitech.com> | 2021-11-22 15:17:40 -0600 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2021-11-22 15:50:11 -0600 |
commit | 500733f1521a9b84fbe3835ce9d9ad06763b781d (patch) | |
tree | c177b4643cb1a57dce533ab2fca1f83c24c20faa | |
parent | 1bdad6228353b2dd0b20d80e377a6a9345b770b3 (diff) | |
download | meta-multitech-atmel-500733f1521a9b84fbe3835ce9d9ad06763b781d.tar.gz meta-multitech-atmel-500733f1521a9b84fbe3835ce9d9ad06763b781d.tar.bz2 meta-multitech-atmel-500733f1521a9b84fbe3835ce9d9ad06763b781d.zip |
Add a reset loop in case rs9113 does not appear on USB Hub
-rwxr-xr-x | recipes-kernel/rs9113/files/rs9113/rs9113.init | 62 | ||||
-rw-r--r-- | recipes-kernel/rs9113/rs9113_1.6.5.bb | 2 |
2 files changed, 36 insertions, 28 deletions
diff --git a/recipes-kernel/rs9113/files/rs9113/rs9113.init b/recipes-kernel/rs9113/files/rs9113/rs9113.init index 4ef6f4b..d9fb21e 100755 --- a/recipes-kernel/rs9113/files/rs9113/rs9113.init +++ b/recipes-kernel/rs9113/files/rs9113/rs9113.init @@ -28,33 +28,41 @@ case "$1" in exit 0 fi # Reset the RS9113 chip is ready, and - # wait for it to settle. - if [ -f "$RS9113_RESET" ] ; then - echo 1 >$RS9113_RESET - usleep $SLEEPTIME - echo 0 >$RS9113_RESET - usleep $SLEEPTIME - echo 1 >$RS9113_RESET - N=1 - while [ $N -lt 20 ] ; do - INT=$(cat $RS9113_INT) - WKUP=$(cat $RS9113_WKUP) - if [ $INT -ne 1 -o $WKUP -ne 1 ] ; then - usleep $INTSLEEPTIME - else - break - fi - done - if [ $INT -ne 1 ] ; then - logger -t rs9113 -p error -s "$RS9113_INT is $INT" - fi - if [ $WKUP -ne 1 ] ; then - logger -t rs9113 -p error -s "$RS9113_WKUP is $WKUP" - fi - else - # No WiFi BT, so exit quietly - exit 0 - fi + # wait for it to settle. + count=0 + while : ; do + if [ -f "$RS9113_RESET" ] ; then + echo 1 >$RS9113_RESET + usleep $SLEEPTIME + echo 0 >$RS9113_RESET + usleep $SLEEPTIME + echo 1 >$RS9113_RESET + N=1 + while [ $N -lt 20 ] ; do + INT=$(cat $RS9113_INT) + if ((INT != 1)) ; then + usleep $INTSLEEPTIME + else + break + fi + done + if [ $INT -ne 1 ] ; then + logger -t rs9113 -p error -s "$RS9113_INT is $INT" + fi + else + # No WiFi BT, so exit quietly + exit 0 + fi + if /usr/bin/lsusb -d 1618:9113 >/dev/null ; then + break + fi + sleep 15 + ((count++)) + if ((count > 5)) ; then + logger -t rs9113 -p error -s "RS9113 not found after $count resets" + break + fi + done /usr/bin/logger -t "rs9113" -p info -s "Loading rs9113 modules with COEX=$COEX_MODE and Country=$SET_COUNTRY_CODE" /usr/sbin/rs9113_load_modules.sh $CONFIG RETVAL=$? diff --git a/recipes-kernel/rs9113/rs9113_1.6.5.bb b/recipes-kernel/rs9113/rs9113_1.6.5.bb index 54a1ca5..0627dcb 100644 --- a/recipes-kernel/rs9113/rs9113_1.6.5.bb +++ b/recipes-kernel/rs9113/rs9113_1.6.5.bb @@ -17,7 +17,7 @@ COMPATIBLE_MACHINE = "(mtcdt|mtrv1)" # To update this, manually copy ipk from Jenkin's job to # git://git@${MTS_INTERNAL_GIT}/mlinux/ipk.git;protocol=ssh;branch=${PV} # -PR = "r11${KERNEL_MODULE_PACKAGE_SUFFIX}" +PR = "r12${KERNEL_MODULE_PACKAGE_SUFFIX}" SRC_URI = " \ file://rs9113/rs9113.init \ file://rs9113/rs9113.default \ |