From 31c75000420cfd05c7f32ad0bd35b65b81d474df Mon Sep 17 00:00:00 2001 From: George Yang Date: Wed, 30 Apr 2025 16:12:04 +0200 Subject: [PATCH] libvoice-airoha/uci-defaults: add DECT default settings for E755 Following default settings added to dect config: - dect.global.pcm_fsync='SHORT_LF' - dect.global.pcm_slot_start='8' - dect.global.dect_channel_start='3' --- .../etc/uci-defaults/991-libvoice-airoha | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) 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' +}