Fix the missing cover-panel reaction with a 9-bit panel path and sign-off probe
Live diagnosis with the flip physically closed showed the wake chain is intact: bananarchy-coverctl BUTTON/WAKE, the lid gate and sxmo_state.sh set unlock all reached backend=spidev visible=1 mux=closed, with the daemon holding /dev/spidev0.1, the gpiochip and its line handles. The outer panel itself never reacted. Register reads over SPI return zeros (write-only panels), gpio21 stays static, and a reversible panel-mipi-dbi-spi/spidev rebind on spi0.0 showed the shared gpio110 D/C path is also unreadable, so the missing piece is the panel framing: the KaiOS downstream DTS labels gpio21 TE, not D/C, and Qualcomm MDSS SPI carries D/C as the ninth bit. bananarchy-cover-idle now defaults to 9-bit MIPI DBI: it releases gpio21, claims only the reset line, and frames every command and pixel as a little-endian 9-bit word with D/C in bit 8. spi_word_bits = 8 keeps the old D/C-GPIO path. A PROBE command walks twelve combinations of word width, gpio13 mux level, reset/D-C polarity and 25 MHz / 5 MHz clock, re-initialising the panel and drawing TEST bars; STATUS reports bits= and probe=case N/12. bananarchy-cover-probe.sh drives all twelve cases with a three-second hold so the working wiring can be written back to cover-display.conf. wanted_device() in common.h now also matches KEY_POWER, so the pm8941_pwrkey device (KEY_POWER only) is no longer invisible to bananarchy-volume-keys and all three outer buttons can produce a cover wake. Rebuilt the a1108/dejavu nokia-beatles image and pinned the verified hash 57d140e9cdf05631a6620b639d143350b9984b2170592fb927c93bfb18f67a2b in check-rebuild.sh. e2fsck -fn passed on both partitions, debugfs confirms seven updated rootfs files byte-for-byte, and the bootfs sync, boot image check, artifact sync, host tests and rebuild preflight all pass. Eyes-on confirmation of which case lights the cover, and the cover backlight source, are still required; this is an intermediate checkpoint.
This commit is contained in:
1 parent
2857ef4374
commit
5f8b7c88ac
15 files changed
+252
-28
No files matched your search
@@ -13,6 +13,15 @@ Release versions follow the `<year-letter><MM><DD>` format (where `2026` is `a`,
|
||||
|
||||
Work since `a1108` has focused on reliable 2720 Flip hardware support and a reproducible boot/flash path. Earlier incremental and superseded diagnostic entries are consolidated here.
|
||||
|
||||
### Cover panel hardware sign-off path after the button regression
|
||||
|
||||
- **Live diagnosis**: with the flip physically closed, `bananarchy-coverctl BUTTON`, `WAKE`, `bananarchy-lid-gate.sh wake` and `sxmo_state.sh set unlock` all reached `backend=spidev visible=1 mux=closed`, and the daemon held `/dev/spidev0.1`, the gpiochip and two line handles. So the wake chain is intact; the outer panel itself never reacts to the frames. Register-ID reads over SPI return zeros for both chip selects (the panels are write-only), and gpio21 stays static, so readback/TE cannot be used to confirm wiring. A reversible `panel-mipi-dbi-spi`/`spidev` rebind on `spi0.0` proved CS0 + the kernel-owned gpio110 D/C path is also unreadable; the phone was fully restored (`/dev/dri/card0`, `/dev/fb0`, Xorg and dwm back).
|
||||
- **Wiring gap**: the KaiOS downstream DTS labels gpio21 as **TE**, not D/C, and Qualcomm MDSS SPI carries D/C as the ninth bit. The cover daemon therefore gained a **9-bit MIPI DBI mode**: when `spi_word_bits = 9` it releases gpio21, frames every command and pixel as a little-endian 9-bit word with D/C in bit 8, and claims only the reset line. 9-bit is the default because the vendor DTS has no external D/C GPIO; `spi_word_bits = 8` restores the earlier D/C-GPIO path until physical sign-off.
|
||||
- **Sign-off tooling**: `bananarchy-coverctl PROBE` walks twelve combinations of word width (8/9), gpio13 mux level, reset polarity, D/C polarity and SPI clock (25 MHz / 5 MHz), re-initialising the panel and drawing `TEST bars` each time; `STATUS` reports `bits=` and `probe=case N/12`. `bananarchy-cover-probe.sh` drives the twelve cases with a three-second hold, and `bananarchy-cover-diagnose.sh` prints the active keys. `SET spi_word_bits 8|9` toggles the mode at runtime. Once the working case is known it goes into `/etc/bananarchy/cover-display.conf`.
|
||||
- **Button gap**: `wanted_device()` in `common.h` only watched devices with `KEY_VOLUMEUP`/`KEY_VOLUMEDOWN`, so the `pm8941_pwrkey` device (KEY_POWER only) was invisible to `bananarchy-volume-keys`. It now also matches `KEY_POWER`, so all three outer keys can produce a cover wake even when X/dwm does not forward one.
|
||||
- **Still unverified**: eyes-on confirmation of which case lights the cover, and the cover backlight source (no separate backlight/LED node exists in the DT).
|
||||
- **Image persistence**: rebuilt `images/bananarchy-nokia-beatles.img` at `a1108` / `dejavu` with the 9-bit default, PROBE tooling and KEY_POWER fix; verified raw hash `57d140e9cdf05631a6620b639d143350b9984b2170592fb927c93bfb18f67a2b`, pinned by `scripts/check-rebuild.sh`. `e2fsck -fn` passed on both partitions, `debugfs` confirms the rebuilt daemons and all sign-off scripts/config byte-for-byte, and the bootfs sync, boot image check, artifact sync, host tests and rebuild preflight pass. The standalone boot image hash is unchanged.
|
||||
|
||||
### Instant flip lid switching and closed-flip event routing
|
||||
|
||||
- **Root cause of the close lag**: `bananarchy-lid.c` recomputed `observed` from a stale `EV_SW` mask on every 100 ms iteration and only consulted the raw hall lines every 200 ms, so `candidate` oscillated open/closed and the 80 ms debounce rarely completed. With a controlled hall-file transition on the live phone a close took over 2.2 s to blank the main panel. The hall reading is now sticky, any `EV_SW` edge forces an immediate hall re-read, the loop/debounce are 20 ms, and the daemon writes the lid state, lock flag, Sxmo state and all backlights synchronously in C before spawning hooks. A direct `xset dpms force off/on` stops or resumes Xorg's SPI flushes immediately; the Sxmo hooks run through `bananarchy-lid-state.sh`, which refuses stale spawns by lid state and a transition generation counter so a late screenoff hook cannot re-lock a just-opened flip.
|
||||
|
||||
Reference in new issue
Block a user