diff --git a/libvoice-airoha/files/etc/uci-defaults/991-libvoice-airoha b/libvoice-airoha/files/etc/uci-defaults/991-libvoice-airoha index 68c931340..d09f7824c 100644 --- a/libvoice-airoha/files/etc/uci-defaults/991-libvoice-airoha +++ b/libvoice-airoha/files/etc/uci-defaults/991-libvoice-airoha @@ -1,16 +1,25 @@ #!/bin/sh hasVoice=$(db -q get hw.board.hasVoice) - [ "$hasVoice" = "1" ] || exit 0 -SLIC=`cat /proc/device-tree/airoha-voice/slic-type` -[ "${SLIC#pef}" != "${SLIC}" ] || exit 0 +SLIC=$(cat /proc/device-tree/airoha-voice/slic-type) +[ "${SLIC#pef}" != "${SLIC}" ] && { + echo Configure TxGain and RxGain for MXL SLIC $SLIC -echo Configure TxGain and RxGain for MXL SLIC $SLIC + ports=$(db -q get hw.board.VoicePorts) + for p in $(seq 0 $((ports-1))); do + uci set asterisk.extension${p}.txgain='10' + uci set asterisk.extension${p}.rxgain='-15' + done +} -ports=$(db -q get hw.board.VoicePorts) -for p in $(seq 0 $((ports-1))); do - uci set asterisk.extension${p}.txgain='10' - uci set asterisk.extension${p}.rxgain='-15' -done +hasDect=$(db -q get hw.board.hasDect) +[ "$hasDect" = "1" ] || exit 0 + +# configure the PCM for DECT/DCX81 +[ -f "/proc/device-tree/aliases/dcx81-uart" ] && { + uci set dect.global.pcm_fsync='SHORT_LF' + uci set dect.global.pcm_slot_start='8' + uci set dect.global.dect_channel_start='3' +}