pine64-pinephone: clean setup-modem.sh script (MR 1701)
Since we now use the in-kernel modem driver of Megi's 5.9 kernel, the majority of the setup script has become unnecessary. Remove all the now unnecessary commands and keep it just for enabling VoLTE auto profile selecting https://megous.com/git/linux/tree/drivers/misc/modem-power.c?h=orange-pi-5.10#n531 https://megous.com/git/linux/tree/drivers/misc/modem-power.c?h=orange-pi-5.10#n580 https://megous.com/git/linux/tree/drivers/misc/modem-power.c?h=orange-pi-5.10#n610
This commit is contained in:
parent
a4f2794165
commit
bb41f53879
2 changed files with 3 additions and 101 deletions
|
@ -3,7 +3,7 @@
|
||||||
# Co-Maintainer: Luca Weiss <luca@z3ntu.xyz>
|
# Co-Maintainer: Luca Weiss <luca@z3ntu.xyz>
|
||||||
# Co-Maintainer: Bart Ribbers <bribbers@disroot.org>
|
# Co-Maintainer: Bart Ribbers <bribbers@disroot.org>
|
||||||
pkgname=device-pine64-pinephone
|
pkgname=device-pine64-pinephone
|
||||||
pkgver=0.11
|
pkgver=0.12
|
||||||
pkgrel=0
|
pkgrel=0
|
||||||
pkgdesc="PINE64 PinePhone"
|
pkgdesc="PINE64 PinePhone"
|
||||||
url="https://postmarketos.org"
|
url="https://postmarketos.org"
|
||||||
|
@ -112,4 +112,4 @@ e852b48a687f9b2a0eca444aa3d00a1818aead9f5e5d28e070b51c9d6f8ec648e66f1d88e2bfa94d
|
||||||
c3abc45269fb135075f5e227161c68ac234775b87fcf224385c5f40123108bf87e1351a1f1ec6786e964f493129511b8363070116a9a451e53cd7b17b3a76cc8 HiFi.conf
|
c3abc45269fb135075f5e227161c68ac234775b87fcf224385c5f40123108bf87e1351a1f1ec6786e964f493129511b8363070116a9a451e53cd7b17b3a76cc8 HiFi.conf
|
||||||
5c12e9bf4677bbcf49c16a731f7580bb18df95489b10671323dc2f600bc8e1be0031fd911db47ad641500a7bb58d9386fa124c63456a076fddda796d0d165b1d VoiceCall.conf
|
5c12e9bf4677bbcf49c16a731f7580bb18df95489b10671323dc2f600bc8e1be0031fd911db47ad641500a7bb58d9386fa124c63456a076fddda796d0d165b1d VoiceCall.conf
|
||||||
db57bd1613ae988a05df86fa962352145f480e1a4e5a0ff921e734cf35ecd755b7f14775a70bb31a7e875813cbc7a4722202cf76023f1b15862bbd5390d0b757 eg25.initd
|
db57bd1613ae988a05df86fa962352145f480e1a4e5a0ff921e734cf35ecd755b7f14775a70bb31a7e875813cbc7a4722202cf76023f1b15862bbd5390d0b757 eg25.initd
|
||||||
0c81d758e1bcb56ed2cdaf91124121ebbd4dd7a5e25f02a7685b837faf660949d05f6b07b39a1c6a9ca22a7029cdcf3c6dac8f1038e37c8a34cb7c5702e9df51 setup-modem.sh"
|
fa063e2863afc48e627acc1a5b213a81499ba1dd30325f74f118a44e3964aec7e597b1f4bd318b7cf5bf14f27daf88e6ad9fc277ab106cbbe1189fdcc650d5c1 setup-modem.sh"
|
||||||
|
|
|
@ -4,120 +4,22 @@ log() {
|
||||||
echo "$@" | logger -t "postmarketOS:modem-setup"
|
echo "$@" | logger -t "postmarketOS:modem-setup"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Current modem routing
|
|
||||||
#
|
|
||||||
# 1 - Digital PCM
|
|
||||||
# 1 - I2S slave
|
|
||||||
# 0 - Primary mode (short sync)
|
|
||||||
# 1 - 256kHz clock (256kHz / 16bit = 16k samples/s)
|
|
||||||
# 0 - 16bit linear format
|
|
||||||
# 0 - 8k sample/s
|
|
||||||
# 1 - 1 slot
|
|
||||||
# 1 - map to first slot (the only slot)
|
|
||||||
#
|
|
||||||
QDAI_CONFIG="1,1,0,1,0,0,1,1"
|
|
||||||
QCFG_RISIGNALTYPE_CONFIG="physical"
|
|
||||||
QMBNCFG_CONFIG="1"
|
QMBNCFG_CONFIG="1"
|
||||||
QCFG_IMS_CONFIG="1"
|
|
||||||
|
|
||||||
if [ -z "$1" ]
|
|
||||||
then
|
|
||||||
DEV="/dev/EG25.AT"
|
|
||||||
else
|
|
||||||
DEV="$1"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# When running this script from udev the modem might not be fully initialized
|
|
||||||
# yet, so give it some time to initialize
|
|
||||||
#
|
|
||||||
# We'll try to query for the firmware version for 15 seconds after which we'll
|
|
||||||
# consider the initialization failed
|
|
||||||
|
|
||||||
log "Waiting for the modem to initialize"
|
|
||||||
INITIALIZED=false
|
|
||||||
for second in $(seq 1 15)
|
|
||||||
do
|
|
||||||
if echo "AT+QDAI?" | atinout - $DEV - | grep -q OK
|
|
||||||
then
|
|
||||||
INITIALIZED=true
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
|
|
||||||
log "Waited for $second seconds..."
|
|
||||||
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
|
|
||||||
if $INITIALIZED
|
|
||||||
then
|
|
||||||
log "Modem initialized"
|
|
||||||
else
|
|
||||||
log "Modem failed to initialize"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Read current config
|
# Read current config
|
||||||
QDAI_ACTUAL_CONFIG=$(echo "AT+QDAI?" | atinout - $DEV -)
|
|
||||||
QCFG_RISIGNALTYPE_ACTUAL_CONFIG=$(echo 'AT+QCFG="risignaltype"' | atinout - $DEV -)
|
|
||||||
QMBNCFG_ACTUAL_CONFIG=$(echo 'AT+QMBNCFG="AutoSel"' | atinout - $DEV -)
|
QMBNCFG_ACTUAL_CONFIG=$(echo 'AT+QMBNCFG="AutoSel"' | atinout - $DEV -)
|
||||||
QCFG_IMS_ACTUAL_CONFIG=$(echo 'AT+QCFG="ims"' | atinout - $DEV -)
|
|
||||||
|
|
||||||
if echo $QDAI_ACTUAL_CONFIG | grep -q $QDAI_CONFIG && \
|
if echo $QMBNCFG_ACTUAL_CONFIG | grep -q $QMBNCFG_CONFIG
|
||||||
echo $QCFG_RISIGNALTYPE_ACTUAL_CONFIG | grep -q $QCFG_RISIGNALTYPE_CONFIG && \
|
|
||||||
echo $QMBNCFG_ACTUAL_CONFIG | grep -q $QMBNCFG_CONFIG && \
|
|
||||||
echo $QCFG_IMS_ACTUAL_CONFIG | grep -q $QCFG_IMS_CONFIG
|
|
||||||
then
|
then
|
||||||
log "Modem already configured"
|
log "Modem already configured"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Modem not configured, we need to send it the digital interface configuration,
|
|
||||||
# then reboot it
|
|
||||||
|
|
||||||
# Configure audio
|
|
||||||
RET=$(echo "AT+QDAI=$QDAI_CONFIG" | atinout - $DEV -)
|
|
||||||
|
|
||||||
if ! echo $RET | grep -q OK
|
|
||||||
then
|
|
||||||
log "Failed to configure audio: $RET"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Configure ring device
|
|
||||||
RET=$(echo "AT+QCFG=\"risignaltype\",\"$QCFG_RISIGNALTYPE_CONFIG\"" | atinout - $DEV -)
|
|
||||||
|
|
||||||
if ! echo $RET | grep -q OK
|
|
||||||
then
|
|
||||||
log "Failed to configure modem ring wakeup: $RET"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Configure VoLTE auto selecting profile
|
# Configure VoLTE auto selecting profile
|
||||||
RET=$(echo "AT+QMBNCFG=\"AutoSel\",$QMBNCFG_CONFIG" | atinout - $DEV -)
|
RET=$(echo "AT+QMBNCFG=\"AutoSel\",$QMBNCFG_CONFIG" | atinout - $DEV -)
|
||||||
|
|
||||||
if ! echo $RET | grep -q OK
|
if ! echo $RET | grep -q OK
|
||||||
then
|
then
|
||||||
log "Failed to enable VoLTE profile auto selecting: $RET"
|
log "Failed to enable VoLTE profile auto selecting: $RET"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Enable VoLTE
|
|
||||||
RET=$(echo "AT+QCFG=\"ims\",$QCFG_IMS_CONFIG" | atinout - $DEV -)
|
|
||||||
|
|
||||||
if ! echo $RET | grep -q OK
|
|
||||||
then
|
|
||||||
log "Failed to enable VoLTE: $RET"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Reset module
|
|
||||||
# 1 Set the mode to full functionality (vs 4: no RF, and 1: min functionality)
|
|
||||||
# 1 Reset the modem before changing mode (only available with 1 above)
|
|
||||||
#
|
|
||||||
RET=$(echo "AT+CFUN=1,1" | atinout - $DEV -)
|
|
||||||
|
|
||||||
if ! echo $RET | grep -q OK
|
|
||||||
then
|
|
||||||
log "Failed to reset the module: $RET"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
Loading…
Reference in a new issue