Files
2026-11-18 01:39:26 +09:00

56 lines
2.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Power buttons, status screen, offline charger and standby
The Mi 8 Lite (`platina`) supports lightweight server power management via
`platina-power-chord` and `platina-status-screen` using the physical PMIC power
button (`pm8941_pwrkey`), along with the legacy **Power + Volume Up** chord.
## Button controls (`power_key_mode=yes`)
1. **Short-press Power** (`< 3s`): Restores full CPU frequencies (`2.21 GHz` /
`1.84 GHz`), wakes the Tianma `1080×2280` panel (`FBIOBLANK=0`), and renders
a live OLED status dashboard (clock, uptime, battery `%`/voltage/temp and 80%
guard status, 4G LTE carrier/signal/IP, Wi-Fi/USB/EasyTier routes, CPU clock
limits, load, and RAM usage). Refreshes every `2s` and auto-blanks to
`FB_BLANK_POWERDOWN` after `12s`, or immediately on a second short press.
2. **Hold Power `>= 3s`** (fires right at `3s`, below the PMIC hard-reset timer):
- **On battery (`online == 0`)**: Shows the `Power off` screen for `3s` and
runs `/usr/local/sbin/platina-poweroff --force` -> `/usr/sbin/poweroff`.
- **With external charger/USB attached (`online == 1`)**: Enters **Offline
Charger Mode** (brings down cellular data, blanks display, clamps all CPU
clusters to `300 MHz`, and keeps the 50–80% battery guard active).
3. **Offline Charger Mode** (also entered automatically on boot when
`/proc/cmdline` contains `androidboot.mode=charger` or
`androidboot.bootreason=usb_chg`):
- **Short-press Power**: Shows the large battery charging percentage screen
for `5s`, then turns the panel off.
- **Unplug external power**: Automatically powers off cleanly via
`/usr/sbin/poweroff`.
- **Hold Power `>= 3s`**: Restores CPU clocks, exits charger mode into normal
server operation, and starts `platina-cellular --auto`.
## Crash-free runtime DVFS + panel-powerdown standby
On mainline kernel `7.2.12-sdm660`, system-wide kernel `s2idle` (`freeze`)
causes WCN3990 (`ath10k_snoc`) `wlan_process` fatal crashes, post-SSR MPSS
`ipa_bam.c` assertions (dropping 4G), and `mdss_ahb_clk` warnings on resume.
Therefore `/etc/local.d/disable-suspend.start` keeps `/sys/power/state` locked
(`chmod 000`) while `platina-power-chord` implements crash-free runtime standby
using hardware `cpuidle` (`pwr-power-collapse`), panel powerdown
(`FB_BLANK_POWERDOWN`, `fb0/blank=4`), modem `RRC_IDLE`, and cluster DVFS
clamping after `idle_suspend_seconds` (`60s` default):
- Big cluster (`policy0`): clamped to `300 MHz` (`scaling_min_freq`)
- Little cluster (`policy1`): clamped to `633.6 MHz`
- 4G LTE, Wi-Fi, EasyTier, and SSH remain online with zero baseband resets and
restore full `2.21 GHz / 1.84 GHz` immediately when the Power key is tapped.
## Diagnostics
```sh
rc-service platina-power-chord status
sudo platina-status-screen --json
sudo platina-status-screen --once --seconds 5
sudo platina-poweroff --preview
sudo python3 /usr/local/libexec/platina-image-runtime audit
```