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

+6 -4
View File
@@ -8,10 +8,12 @@
// scripts/build-beatles-cover-panel.py). A live 2720 Flip test produced
// /dev/fb1 (240x240, 32bpp) and the full cover state machine, but the main
// 240x320 panel went dark with both panels registered; the gpio13 mux select
// and gpio21/gpio23 external DC/reset routing therefore still need physical
// probing before the opt-in DT can become the default. This file documents
// the wiring for older/stock DTBs; do not apply it to the current shipping
// DTB (it would duplicate the mux).
// and gpio21/gpio23 routing therefore still need physical probing before the
// opt-in DT can become the default. The KaiOS 3.10 DTS labels gpio21 TE and
// gives the external panel the same gpio110 D/C line as the internal panel,
// so this reference overlay's separate gpio21 D/C is an unverified guess.
// This file documents the wiring for older/stock DTBs; do not apply it to the
// current shipping DTB (it would duplicate the mux).
//
// Both panels share BLSP1 QUP5 SPI; gpio13 selects which one the bus reaches.
// spi-mux selects the mux state from the child chip-select number, so
@@ -1,41 +1,30 @@
# Nokia 2720 Flip (nokia-beatles) 1.3-inch 240x240 external GC9305 panel.
#
# Derived from the KaiOS 3.10 downstream DTS in the archived postmarketOS
# linux-nokia-beatles package (0004-dts-adaptations.patch):
# spi_gc9305_v2_qvga_ext_cmd, qcom,mdss-spi-on-command:
# fe, ef, 3a 05, 35 00, 2a 00 00 00 ef, 2b 00 00 00 ef, 2c,
# delay 120, 11, 29, 2c
# Exact qcom,mdss-spi-on-command stream from the KaiOS 3.10 downstream DTS
# (spi_gc9305_v2_qvga_ext_cmd) in pmaports' 0004-dts-adaptations.patch:
# fe, ef, 3a 05, 35 00, 2a 00 00 00 ef, 2b 00 00 00 ef, 2c,
# delay 120, 11, 29, 2c
# qcom,mdss-spi-panel-width = 240, height = 240, bpp = 16.
#
# The register/gamma block below is the one already proven on this device's
# internal GC9305 panel (nokia,beatles-gc9305-panel.txt); the two column/page
# windows are set to 0..239 for the square cover panel. The blob is consumed
# by panel-mipi-dbi-spi (kernel) or by bananarchy-coverd's spidev backend.
# The stock panel node uses qcom,platform-spi-dc-gpio = gpio110 (the same
# D/C line as the internal panel), qcom,platform-te-gpio = gpio21,
# qcom,platform-reset-gpio = gpio23 and qcom,platform-spi-switch-gpio =
# gpio13. gpio21 is TE, not D/C. Both panels share PMIC MPP2 PWM backlight.
#
# This init sequence is derived from vendor sources but has NOT yet been
# verified on 2720 Flip hardware; see NOKIA-2720-FLIP.md.
# This MIPI DBI firmware is replayed by the shipping kernel backend through
# /sys/kernel/debug/dri/0/command after gpio23 is pulsed and the gpio13 bus
# switch is set to the cover. The obsolete userspace spidev rollback also
# parses this file.
#
# MIPI DBI firmware records below (command, parameter count, parameters):
command 0xfe
command 0xef
command 0x36 0x00 # MADCTL
command 0x3a 0x55 # 65K 16-bit RGB565
command 0x3a 0x05 # 16-bit RGB565
command 0x35 0x00 # TE v-blanking
command 0xb2 0x0c 0x0c 0x00 0x33 0x33 # porch setting
command 0xb7 0x75 # gate control VGH/VGL
command 0xbb 0x34 # Vcoms
command 0xc0 0x2c # LCM control
command 0xc2 0x01 # VDV/VRH enable
command 0xc3 0x0d # VRH set
command 0xc4 0x20 # VDV set
command 0xc6 0xef # frame rate
command 0x44 0x00 0x00 # tearing scan line
command 0xd0 0xa4 0xa1 # power control 1
command 0xe0 0xd0 0x02 0x09 0x0d 0x0e 0x19 0x30 0x51 0x43 0x09 0x14 0x13 0x18 0x21
command 0xe1 0xd0 0x02 0x09 0x0d 0x0d 0x18 0x32 0x46 0x42 0x09 0x13 0x13 0x17 0x21
command 0x2a 0x00 0x00 0x00 0xef # column address 0..239
command 0x2b 0x00 0x00 0x00 0xef # page address 0..239
command 0x2c # memory write
command 0x11 # sleep out
delay 120
command 0x11 # sleep out
command 0x29 # display on
command 0x2c
command 0x2c # memory write
@@ -1901,8 +1901,9 @@
display@1 {
compatible = "nokia,beatles-gc9305-ext-panel", "panel-mipi-dbi-spi";
reg = <0x01>;
/* gpio21 is the external D/C line: 8-bit SPI works on QUP
* and gpio110 stays owned by the internal panel. */
/* Experimental: the KaiOS 3.10 DTS labels gpio21 TE
* and shares gpio110 D/C. This separate D/C wiring is
* unverified and is why the layout remains opt-in. */
dc-gpios = <0x27 0x15 0x00>;
reset-gpios = <0x27 0x17 0x00>;
/* Same verified 25 MHz clock as the internal panel. */