Implement deep-standby RPM interconnect, Wi-Fi, USB, DSDS, and panel power savings for a1114
- Enable MSM8909 SMD RPM interconnect scaling (BIMC, PCNOC, SNOC) with 19.2 MHz active floor, zero sleep-set vote clearing clk_smd_rpm_handoff, and CPU OPP bandwidth tables across all six MSM8905/MSM8909 device trees while preserving module vermagic - Sync wcn36xx conf.listen_interval and expose live screen_off_offload (ARP, IPv6 NS, GTK, ignore_dtim, 40 ms dynamic PS) toggled by bananarchy-display-power-sync without wlan_host_suspend_ind - Add runtime PM clock gating to ci_hdrc_msm when USB is unplugged while skipping viewport ULPI_SYNC_STATE polling under CI_HDRC_OVERRIDE_PHY_CONTROL - Default MODEM_DRX_MODE=6 across all /dev/wwan0at* channels with flock serialization, post-probe boot retry, and modem-ready registration hooks, and quiesce dsds-daemon polling whenever the screen is dark - Issue MIPI DCS DISPLAY_OFF and SLEEP_IN in panel-mipi-dbi on DPMS off while preserving the 2720 Flip closed-only kernel cover backend, and update pinned a1114 (carbonara) hashes and docs
This commit is contained in:
1 parent
e42024e90d
commit
c95a84c69c
44 files changed
+106915
-105453
No files matched your search
@@ -745,6 +745,9 @@ enable_and_register_modem() {
|
||||
done
|
||||
|
||||
timeout 4 mmcli -m any --3gpp-register-home >/dev/null 2>&1 || true
|
||||
if [ -x /usr/bin/bananarchy-power-policy.sh ]; then
|
||||
/usr/bin/bananarchy-power-policy.sh modem-ready >/dev/null 2>&1 || true
|
||||
fi
|
||||
if command -v sxmo_hook_statusbar.sh >/dev/null 2>&1; then
|
||||
DISPLAY="${DISPLAY:-:0}" timeout 3 sxmo_hook_statusbar.sh modem >/dev/null 2>&1 || true
|
||||
fi
|
||||
@@ -1320,6 +1323,46 @@ PY
|
||||
echo "ERROR: Empty AT command"
|
||||
exit 1
|
||||
fi
|
||||
run_at_dev() {
|
||||
timeout 3 sh -c '
|
||||
dev="$1"
|
||||
cmd="$2"
|
||||
tmpf="/tmp/at_resp_$$.txt"
|
||||
rm -f "$tmpf"
|
||||
cat "$dev" > "$tmpf" 2>/dev/null &
|
||||
rpid=$!
|
||||
sleep 0.04
|
||||
printf "%s\r\n" "$cmd" > "$dev" 2>/dev/null || true
|
||||
i=0
|
||||
while [ "$i" -lt 16 ]; do
|
||||
if grep -qE "(^|[[:space:]])(OK|ERROR|\+CME ERROR|\+CMS ERROR)([[:space:]]|$)" "$tmpf" 2>/dev/null; then
|
||||
break
|
||||
fi
|
||||
sleep 0.08
|
||||
i=$((i + 1))
|
||||
done
|
||||
kill "$rpid" 2>/dev/null || true
|
||||
wait "$rpid" 2>/dev/null || true
|
||||
tr -d "\r" < "$tmpf" 2>/dev/null || true
|
||||
rm -f "$tmpf"
|
||||
' _ "$1" "$2" 2>/dev/null | sed '/^[[:space:]]*$/d' || true
|
||||
}
|
||||
if [ "$port" = "all" ]; then
|
||||
got_any=0
|
||||
for dev in /dev/wwan0at*; do
|
||||
[ -c "$dev" ] || continue
|
||||
resp="$(run_at_dev "$dev" "$at_cmd")"
|
||||
if [ -n "$resp" ]; then
|
||||
got_any=1
|
||||
printf '[%s]\n%s\n' "${dev#/dev/}" "$resp"
|
||||
fi
|
||||
done
|
||||
if [ "$got_any" -eq 1 ]; then
|
||||
exit 0
|
||||
fi
|
||||
echo "ERROR: No response from modem AT channel"
|
||||
exit 1
|
||||
fi
|
||||
resp=""
|
||||
if [ "$PREFERRED_SIM_SLOT" = "2" ]; then
|
||||
at_candidates="$port /dev/wwan0at1 /dev/wwan0at0"
|
||||
@@ -1328,10 +1371,10 @@ PY
|
||||
fi
|
||||
for candidate in $at_candidates; do
|
||||
case "$candidate" in
|
||||
wwan0at0|wwan0at1)
|
||||
wwan0at[0-9]*)
|
||||
dev="/dev/$candidate"
|
||||
;;
|
||||
/dev/wwan0at0|/dev/wwan0at1)
|
||||
/dev/wwan0at[0-9]*)
|
||||
dev="$candidate"
|
||||
;;
|
||||
*)
|
||||
@@ -1339,28 +1382,7 @@ PY
|
||||
;;
|
||||
esac
|
||||
if [ -n "$dev" ] && [ -c "$dev" ]; then
|
||||
resp="$(timeout 3 sh -c '
|
||||
dev="$1"
|
||||
cmd="$2"
|
||||
tmpf="/tmp/at_resp_$$.txt"
|
||||
rm -f "$tmpf"
|
||||
cat "$dev" > "$tmpf" 2>/dev/null &
|
||||
rpid=$!
|
||||
sleep 0.04
|
||||
printf "%s\r\n" "$cmd" > "$dev" 2>/dev/null || true
|
||||
i=0
|
||||
while [ "$i" -lt 16 ]; do
|
||||
if grep -qE "(^|[[:space:]])(OK|ERROR|\+CME ERROR|\+CMS ERROR)([[:space:]]|$)" "$tmpf" 2>/dev/null; then
|
||||
break
|
||||
fi
|
||||
sleep 0.08
|
||||
i=$((i + 1))
|
||||
done
|
||||
kill "$rpid" 2>/dev/null || true
|
||||
wait "$rpid" 2>/dev/null || true
|
||||
tr -d "\r" < "$tmpf" 2>/dev/null || true
|
||||
rm -f "$tmpf"
|
||||
' _ "$dev" "$at_cmd" 2>/dev/null | sed '/^[[:space:]]*$/d' || true)"
|
||||
resp="$(run_at_dev "$dev" "$at_cmd")"
|
||||
if [ -n "$resp" ]; then
|
||||
printf "%s\n" "$resp"
|
||||
exit 0
|
||||
@@ -1370,10 +1392,12 @@ PY
|
||||
break
|
||||
fi
|
||||
done
|
||||
mm_out="$(mmcli -m any --command="$at_cmd" 2>&1 || true)"
|
||||
if [ -n "$mm_out" ]; then
|
||||
printf "%s\n" "$mm_out" | sed "s/^response: '\(.*\)'$/\1/"
|
||||
exit 0
|
||||
if [ "$port" = "auto" ]; then
|
||||
mm_out="$(mmcli -m any --command="$at_cmd" 2>/dev/null || true)"
|
||||
if [ -n "$mm_out" ]; then
|
||||
printf "%s\n" "$mm_out" | sed "s/^response: '\(.*\)'$/\1/"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
echo "ERROR: No response from modem AT channel"
|
||||
exit 1
|
||||
@@ -3135,6 +3159,24 @@ while True:
|
||||
w_txn = poll_stored_sms(ws, wms_addr, w_txn, sec_slot)
|
||||
last_poll = time.time()
|
||||
|
||||
def screen_is_idle():
|
||||
if os.path.exists("/tmp/bananarchy_screen_locked") or \
|
||||
os.path.exists("/run/bananarchy/cover-backlight"):
|
||||
return True
|
||||
try:
|
||||
with open("/sys/class/backlight/backlight/bl_power", "r") as f:
|
||||
if f.read().strip() != "0":
|
||||
return True
|
||||
except Exception:
|
||||
pass
|
||||
try:
|
||||
with open("/sys/class/backlight/backlight/brightness", "r") as f:
|
||||
if int(f.read().strip()) <= 0:
|
||||
return True
|
||||
except Exception:
|
||||
pass
|
||||
return False
|
||||
|
||||
try:
|
||||
while True:
|
||||
if pending_inds:
|
||||
@@ -3143,7 +3185,7 @@ while True:
|
||||
poll_timeout = 1.0
|
||||
elif multipart_buf:
|
||||
poll_timeout = 2.0
|
||||
elif os.path.exists("/tmp/bananarchy_screen_locked"):
|
||||
elif screen_is_idle():
|
||||
poll_timeout = None
|
||||
else:
|
||||
poll_timeout = 1800.0
|
||||
@@ -3211,7 +3253,7 @@ while True:
|
||||
if full_tlvs:
|
||||
sync_sub1_calls(parse_call_info(full_tlvs), sec_slot, vs, voice_addr)
|
||||
|
||||
if not os.path.exists("/tmp/bananarchy_screen_locked") and time.time() - last_poll >= 1800.0:
|
||||
if not screen_is_idle() and time.time() - last_poll >= 1800.0:
|
||||
w_txn = poll_stored_sms(ws, wms_addr, w_txn, sec_slot)
|
||||
last_poll = time.time()
|
||||
except Exception:
|
||||
|
||||
Reference in new issue
Block a user