summaryrefslogtreecommitdiff
path: root/recipes-kernel
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2021-11-23 08:14:33 -0600
committerJohn Klug <john.klug@multitech.com>2021-12-29 08:35:07 -0600
commit36f6359fda407bba462b5c0d0f9beff807f91c4e (patch)
treef5313348d873acb521701d9fa73a0d30da2b798f /recipes-kernel
parent18704b918d8c262aff2f669e906fae1e112f3a38 (diff)
downloadmeta-multitech-atmel-36f6359fda407bba462b5c0d0f9beff807f91c4e.tar.gz
meta-multitech-atmel-36f6359fda407bba462b5c0d0f9beff807f91c4e.tar.bz2
meta-multitech-atmel-36f6359fda407bba462b5c0d0f9beff807f91c4e.zip
Make sure mts-io is done loading, make sure loops break out
Diffstat (limited to 'recipes-kernel')
-rwxr-xr-xrecipes-kernel/rs9113/files/rs9113/rs9113.init39
1 files changed, 14 insertions, 25 deletions
diff --git a/recipes-kernel/rs9113/files/rs9113/rs9113.init b/recipes-kernel/rs9113/files/rs9113/rs9113.init
index 0d3d548..e27a35d 100755
--- a/recipes-kernel/rs9113/files/rs9113/rs9113.init
+++ b/recipes-kernel/rs9113/files/rs9113/rs9113.init
@@ -27,47 +27,36 @@ case "$1" in
# We don't want the driver loaded.
exit 0
fi
+
+ for i in {1..5} ; do
+ if [[ -f $RS9113_RESET ]] ; then
+ break
+ fi
+ done
+
# Reset the RS9113 chip is ready, and
# wait for it to settle.
- count=0
- while : ; do
- if [ -f "$RS9113_RESET" ] ; then
+ for i in {1..5} ; 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
- n=0
- while ((n < 10)) ; do
- usleep 50000
+ for j in {0..250} ; do
if /usr/bin/lsusb -d 1618:9113 ; then
break 2
fi
+ usleep 100000
done
- /usr/bin/logger -t "rs9113" -p error -s "Redpine not found on USB Hub."
- sleep 15
- ((count++))
- if ((count > 5)) ; then
- /usr/bin/logger -t "rs9113" -p error -s "RS9113 not found after $count resets"
- break
+ if ((i > 1)) ; then
+ logger -t rs9113 -p error -s "RS9113 not found after $i resets"
+ /usr/bin/lsusb | logger -t rs9113 -p error -s
fi
- echo 'RS9113 not found, try resetting again'
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