Skip to content
Snippets Groups Projects
Commit 1a7729cc authored by Mayeul Cantan's avatar Mayeul Cantan
Browse files

pine64-pinephone: reset modem after applying configuration

The datasheet says that the AT+QDAI audio routing configuration is saved
to non-volatile memory directly, and therefore needs a modem reset to be
applied.

This commits changes the audio routing configuration script to first
check for the current configuration, and only change it if it is
different from the one wanted.

The new configuration is then sent, and modem is reset to apply
configuration.
parent fe5a3321
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
RET=$(echo "AT+QDAI=1,0,0,2,0,1,1,1" | atinout - /dev/EG25.AT -)
# Current modem routing
#
# 1 - Digital PCM
# 0 - I2S master
# 0 - Primary mode (short sync)
# 2 - 512kHz clock (512kHz / 16bit = 32k samples/s)
# 0 - 16bit linear format
# 1 - 16k sample/s
# 1 - 1 slot
# 1 - map to first slot (the only slot)
#
QDAI_CONFIG="1,0,0,2,0,1,1,1"
if echo $RET | grep -q OK; then
DEV=/dev/EG25.AT
# Read current config
RET=$(echo "AT+QDAI?" | atinout - $DEV -)
if echo $RET | grep -q $QDAI_CONFIG
then
echo "Modem audio already configured"
exit 0
fi
# Modem not configured, we need to send it the digital interface configuration,
# then reboot it
RET=$(echo "AT+QDAI=$QDAI_CONFIG" | atinout - $DEV -)
if echo $RET | grep -q OK
then
echo "Successfully configured modem audio"
else
echo "Failed to set modem audio up: $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
echo "Successfully reset the modem to apply audio configuration"
else
echo "Failed to reset the modem to apply audio configuration: $RET"
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment