feat: add WCN3990 Wi-Fi bringup service, battery protection, and bringup automation
Offline project checks / check (push) Canceled after 0s

- Add phone-dsp.openrc to initialize Hexagon DSP, rmtfs, pd-mapper, and ath10k_snoc
- Update phone-battery-guard threshold to 80% with power supply node fallbacks
- Enhance phone-cellular-setup with battery gate checks, RF locks, and unit tests
- Include bringup, flashing, and inspection automation scripts for platina
- Update candidate IPA v2.6 patches and package locks
This commit is contained in:
shenlei
2026-11-12 14:54:23 +09:00
parent 225ad54930
commit 530a3690da
34 changed files with 4103 additions and 47 deletions
+4 -3
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""Battery health and emergency protection daemon:
1. Maintains battery state of charge (SoC) between 50% and 65% when plugged in.
1. Maintains battery state of charge (SoC) between 50% and 80% when plugged in.
2. Cuts off charging if battery temperature exceeds max_temp (default 45°C).
3. Automatically triggers safe filesystem sync and shutdown if battery <= 5% while discharging.
"""
@@ -15,6 +15,7 @@ import sys
import time
BATTERY_PATHS = [
Path('/sys/class/power_supply/qcom-battery'),
Path('/sys/class/power_supply/battery'),
Path('/sys/class/power_supply/bms'),
]
@@ -32,7 +33,7 @@ def find_supply(paths):
class BatteryPolicy:
def __init__(self, low=50, high=65, max_temp=45, shutdown_at=5):
def __init__(self, low=50, high=80, max_temp=45, shutdown_at=5):
if not 10 <= low < high <= 95:
raise ValueError('Invalid battery thresholds (expected 10 <= low < high <= 95)')
if not 1 <= shutdown_at < low:
@@ -174,7 +175,7 @@ def set_charging(battery_dir, charger_dir, enable):
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--low', type=int, default=50, help='Lower SoC percentage to resume charging (default: 50)')
parser.add_argument('--high', type=int, default=65, help='Upper SoC percentage to stop charging (default: 65)')
parser.add_argument('--high', type=int, default=80, help='Upper SoC percentage to stop charging (default: 80)')
parser.add_argument('--shutdown-at', type=int, default=5, help='Emergency shutdown SoC percentage when discharging (default: 5)')
parser.add_argument('--max-temp', type=int, default=45, help='Thermal cutoff threshold in Celsius (default: 45)')
parser.add_argument('--interval', type=float, default=60, help='Poll interval in seconds (default: 60)')