sdm660-common: init.qcom.usb.sh: Simplify ESOC check

Currently if targets support ESOC there would almost certainly
only be a single instance of an external modem. Hence we can
simplify the esoc_link check accordingly without needing to do
a loop and grep. Choosing the external modem composition simply
depends on whether esoc_name is present.

Change-Id: Ib47e34fd31c3745a0c7b3568968f6f36681c98e7
This commit is contained in:
Jack Pham 2018-12-18 18:11:51 -08:00 committed by Max Weffers
parent 14272dab4b
commit 6d21c523c7
No known key found for this signature in database
GPG key ID: 795F73D22FB93FAE

View file

@ -42,20 +42,11 @@ else
fi
#
# Check ESOC for external MDM
# Check ESOC for external modem
#
# Note: currently only a single MDM is supported
# Note: currently only a single MDM/SDX is supported
#
if [ -d /sys/bus/esoc/devices ]; then
for f in /sys/bus/esoc/devices/*; do
if [ -d $f ]; then
if [ `grep -e "^MDM" -e "^SDX" $f/esoc_name` ]; then
esoc_link=`cat $f/esoc_link`
break
fi
fi
done
fi
esoc_name=`cat /sys/bus/esoc/devices/esoc0/esoc_name 2> /dev/null`
target=`getprop ro.board.platform`
@ -78,9 +69,9 @@ miui_release=`getprop ro.fota.oem`
miui_debuggable=`getprop ro.debuggable`
if [ "$(getprop persist.vendor.usb.config)" == "" -a \
"$(getprop init.svc.vendor.usb-gadget-hal-1-0)" != "running" ]; then
if [ "$esoc_link" != "" ]; then
if [ "$esoc_name" != "" ]; then
setprop persist.vendor.usb.config diag,diag_mdm,qdss,qdss_mdm,serial_cdev,dpl,rmnet,adb
else
else
case "$(getprop ro.baseband)" in
"apq")
setprop persist.vendor.usb.config diag,adb