Fix 2720 Flip cover init, shared backlight and flip lock

This commit is contained in:
Luxferre committed 2026-11-10 23:20:13 +02:00
1 parent c939687138
commit b389120328
24 files changed
+494 -217

No files matched your search

+17 -9
View File
@@ -71,19 +71,27 @@ Keep this file short. Full details live in `README.md`, `MANUAL.md`, `SDK.md`, `
- The shipping 2720 Flip DTS/DTB is single-panel. The two-panel `/dev/fb1` layout is opt-in via
`scripts/build-beatles-cover-panel.py`; rollback is `scripts/build-beatles-no-cover-dtb.py`. Do not make it default
until gpio13 mux polarity and gpio21/gpio23 D/C/reset polarity are physically probed: a live test darkened both
screens. The shipping image drives the external GC9305 from userspace over `/dev/spidev0.1` while the flip is
**closed only** (`bananarchy-cover-idle`); never claim gpio13/21/23 or send SPI traffic while the flip is open, and
gate activation on the main panel being DPMS-off; always restore the mux to the internal panel on `LID OPEN`.
- The cover panel's D/C wiring is unsigned-off: gpio21 is TE in the KaiOS DTS, not necessarily D/C. Keep both 8-bit (`spi_word_bits = 8`) and 9-bit MIPI DBI (`9`) paths, `bananarchy-coverctl PROBE` and `bananarchy-cover-probe.sh`. Do not claim a winner without eyes-on confirmation.
until gpio13 mux polarity and gpio21/gpio23 routing are physically probed: a live test darkened both screens.
gpio13 polarity is now TE-probed (high = cover, low = internal), but the two-panel DT remains opt-in.
The shipping image drives the external GC9305 through the kernel `panel-mipi-dbi-spi` driver while the flip is
**closed only** (`bananarchy-cover-idle`); never claim gpio13/23 or send cover SPI traffic while the flip is open,
gate initial activation on the main panel being DPMS-off, and always restore the mux on `LID OPEN`.
- The KaiOS 3.10 DTS gives both panels shared CS0, gpio110 D/C and one PWM backlight; gpio21 is TE and gpio23 is the
external reset. Keep the exact vendor external init firmware, the debugfs command replay, the gpio23 reset pulse,
`/run/bananarchy/cover-backlight` and the `bananarchy-display-power-sync` marker exemption. The legacy 8-bit/9-bit
userspace paths, `PROBE` and `bananarchy-cover-probe.sh` remain rollback/sign-off tooling. If the cover stays dark,
`SET mux_closed_level 0` switches gpio13 polarity at runtime.
- Keep the internal beatles panel at 25 MHz, `dc_gpio = -1` for the spidev fallback, external-panel firmware and
initramfs module lists, the Xorg `card0` pin, `bananarchy-cover-diagnose.sh`, and the
`scripts/test-cover-dt.py` / `scripts/test-cover-spidev.py` guards.
- The shipping cover backend is `backend = kernel`: the kernel `panel-mipi-dbi-spi` driver owns CS0 and the shared gpio110 D/C. Keep `bananarchy-cover-dpms.sh reinit`, the gpio13 mux claim, the 240x240 `/dev/fb0` damage rect, the main-backlight-off gate and `scripts/test-cover-kernel.py`. Keep `spidev`/`fb`/`none` and PROBE as rollback paths.
- The shipping cover backend is `backend = kernel`: keep `bananarchy-cover-dpms.sh reinit`, the gpio13 mux claim,
the 240x240 `/dev/fb0` damage rect, the 1 s repaint against Xorg, `scripts/test-cover-kernel.py`, and the
`spidev`/`fb`/`none` rollback backends.
- Keep the 2720 Flip lid handling event-driven and instant: sticky hall state, immediate hall re-read on `EV_SW`
edges, 20 ms debounce, and synchronous lid-state/lock/backlight/DPMS writes in `bananarchy-lid.c`. Every main-panel
wake path must call `bananarchy-lid-gate.sh`; a closed flip may only light the cover. `sxmo_state.sh set unlock` is
gated too because `dwm` calls it directly. Guard `scripts/test-lid-gate.py`.
edges, 20 ms debounce, and synchronous lid-state/lock/backlight/DPMS writes in `bananarchy-lid.c`. Closing locks
the desktop; opening must keep the lock flag and wake to the passcode lockscreen, never auto-unlock. Every
main-panel wake path must call `bananarchy-lid-gate.sh`; a closed flip may only light the cover.
`sxmo_state.sh set unlock` is gated too because `dwm` calls it directly. Guard `scripts/test-lid-gate.py`.
- Build the lk2nd display image from pinned `bootloader/lk2nd/nokia-beatles.patch`. Exact stock IDs, 512 MiB memory
fallback, appended DTB, `quiet splash`, and the low-bit reboot cookie matter. `check-lk2nd-beatles.py`,
`test-lk2nd-beatles-port.py`, `check-beatles-bootimg.py`, `sync-beatles-bootfs.py --check`, and `check-rebuild.sh`