Fix MBHC wired headphone autodetection across all targets for a1125 (ampere)

Retain PM8909 MBHC digital debounce clock (DIG_CLK_CTL_D_MBHC_CLK_EN) and master bias (CDC_A_MASTER_BIAS_CTL = 0x30) across s2 standby gating while keeping the 100 uA button ISRC and button IRQs disabled when unplugged, check CDC_A_MBHC_RESULT_2 on boot/set_jack/switch IRQs with 3/4-pole FSM classification, fix iface=CARD jack queries, event coalescing, and stale unplugged Headphones boot fallback in bananarchy-soundmonitor and sxmo audio scripts, harden host tests against CPU contention, and rebuild all a1125 (ampere) target images.
This commit is contained in:
Luxferre committed 2026-11-24 11:00:06 +02:00
1 parent aba38a58f2
commit 9619cc9541
19 files changed
+516 -93

No files matched your search

Binary file not shown.
+4
View File
@@ -303,6 +303,8 @@ deviceget() {
dev="$(normalize_out_dev "$dev")"
if [ "$dev" = "Bluetooth" ] && [ -z "$(find_bt_sink)" ] && [ -z "$(find_bt_card)" ]; then
dev="Speaker"
elif [ "$dev" = "Headphones" ] && [ "$(cat /tmp/sxmo_jack_plugged 2>/dev/null || true)" != "1" ]; then
dev="Speaker"
fi
printf "%s\n" "$dev" > /tmp/sxmo_audio_out_device 2>/dev/null || true
printf "%s\n" "$dev"
@@ -345,6 +347,8 @@ devicegetinput() {
in_dev="$(normalize_in_dev "$in_dev")"
if [ "$in_dev" = "Bluetooth" ] && [ -z "$(find_bt_source)" ]; then
in_dev="Mic1"
elif [ "$in_dev" = "Headset" ] && [ "$(cat /tmp/sxmo_jack_plugged 2>/dev/null || true)" != "1" ]; then
in_dev="Mic1"
fi
printf "%s\n" "$in_dev" > /tmp/sxmo_audio_in_device 2>/dev/null || true
printf "%s\n" "$in_dev"
+14 -1
View File
@@ -79,8 +79,15 @@ EOF
else
if [ "$jack_plugged" = "1" ] || [ "$cur_out" = "Headphones" ]; then
target_out="Headphones"
if command -v amixer >/dev/null 2>&1 && \
amixer -c 0 cget "iface=CARD,name='Mic Jack'" 2>/dev/null | grep -q ": values=on"; then
sxmo_audio.sh device setinput Headset >/dev/null 2>&1 || true
else
sxmo_audio.sh device setinput Mic1 >/dev/null 2>&1 || true
fi
else
target_out="Earpiece"
sxmo_audio.sh device setinput Mic1 >/dev/null 2>&1 || true
fi
sxmo_audio.sh device set "$target_out" >/dev/null 2>&1 || true
if command -v amixer >/dev/null 2>&1; then
@@ -143,10 +150,16 @@ EOF
else
if [ "$jack_plugged" = "1" ]; then
target_out="Headphones"
if command -v amixer >/dev/null 2>&1 && \
amixer -c 0 cget "iface=CARD,name='Mic Jack'" 2>/dev/null | grep -q ": values=on"; then
sxmo_audio.sh device setinput Headset >/dev/null 2>&1 || true
else
sxmo_audio.sh device setinput Mic1 >/dev/null 2>&1 || true
fi
else
target_out="Speaker"
sxmo_audio.sh device setinput Mic1 >/dev/null 2>&1 || true
fi
sxmo_audio.sh device setinput Mic1 >/dev/null 2>&1 || true
sxmo_audio.sh device set "$target_out" >/dev/null 2>&1 || true
fi