Enable the 2720 Flip external panel and rebuild its DTB

This commit is contained in:
Luxferre committed 2026-11-10 14:05:23 +02:00
1 parent ec55fb1457
commit 7c52d616e7
13 files changed
+348 -65

No files matched your search

+30 -23
View File
@@ -2,28 +2,33 @@
//
// Nokia 2720 Flip (nokia-beatles) external 240x240 GC9305 panel.
//
// Both the internal 240x320 panel and the external cover panel hang off the
// same BLSP1 QUP5 SPI lines; gpio13 selects which one the bus reaches. The
// spi-mux driver selects the mux state from the child chip-select number,
// so display@0 keeps the internal panel on state 0 and display@1 selects the
// Reference overlay for a DTB that still has the old single-panel layout.
// The shipping qcom-msm8905-nokia-beatles.dts now carries these exact nodes,
// so /dev/fb1 is available without applying an overlay at boot. This file is
// kept for older/stock DTBs and for describing the wiring in one place.
//
// 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
// display@0 keeps the internal panel on state 0 and display@1 selects the
// external panel on state 1. panel-mipi-dbi-spi creates a second DRM device
// and DRM fbdev emulation exposes it as /dev/fb1 for bananarchy-cover-idle.
// dtc keeps SPI children in lexical node-name order, so the internal panel
// (display@0) is registered first and stays /dev/fb0 for Xorg's card0.
//
// Fixes over the earlier experimental overlay that broke the main panel:
// - both children keep the verified 25 MHz internal-panel SPI clock;
// - the external panel uses its own gpio21 D/C line, so the QUP controller
// stays in 8-bit mode instead of unsupported 9-bit Type C Option 1, and
// gpio110 remains owned exclusively by the internal panel;
// - gpio13 has a dedicated pinctrl group with a pull-down (internal panel
// selected before gpio-mux drives it) and is no longer part of the
// external panel's pinctrl state, which used to re-bias the mux on probe.
// - Xorg pins /dev/dri/card0 in 10-bananarchy-msm8909.conf, so the second
// DRM device cannot steal the main display.
//
// The external child is named display@1, not cover@1: dtc keeps SPI children
// in lexical node-name order, so display@0 is registered before display@1.
// That keeps the 240x320 internal panel on /dev/fb0 for Xorg's fbdev config
// while the external panel gets /dev/fb1 for the idle cover renderer.
// The external panel has no dc-gpios property: mipi_dbi_spi_init() then uses
// MIPI DBI Type C Option 1 (9-bit SPI with the D/C bit as the ninth bit), so
// it does not fight panel-mipi-dbi-spi for the internal panel's gpio110/DC.
// Requires CONFIG_MULTIPLEXER, CONFIG_MUX_GPIO and CONFIG_SPI_MUX (all =m in
// patches/kernel/config-bananarchy-msm8909.armv7) plus
// /lib/firmware/nokia,beatles-gc9305-ext-panel.bin.
//
// This overlay is compile-checked but NOT applied to the shipping DTB.
// Live testing broke the main panel/keypad path, so the shipping DTS keeps
// the single internal panel and spidev@1 fallback until gpio13/reset/DC
// routing is validated on hardware.
// /lib/firmware/nokia,beatles-gc9305-ext-panel.bin in the initramfs.
/dts-v1/;
/plugin/;
@@ -32,11 +37,14 @@
fragment@0 {
target-path = "/";
__overlay__ {
spi_panel_mux: spi-panel-mux {
spi-panel-mux {
compatible = "gpio-mux";
#mux-control-cells = <0>;
mux-gpios = <0x27 13 0>;
idle-state = <0>;
pinctrl-0 = <0x93>;
pinctrl-names = "default";
phandle = <0x96>;
};
};
};
@@ -49,14 +57,12 @@
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
spi-max-frequency = <50000000>;
mux-controls = <&spi_panel_mux>;
spi-max-frequency = <25000000>;
mux-controls = <0x96>;
display@0 {
compatible = "nokia,beatles-gc9305-panel", "panel-mipi-dbi-spi";
reg = <0>;
/* Keep the Flip's verified 25 MHz internal-panel clock: applying
* this overlay with 50 MHz reintroduced high-brightness corruption. */
spi-max-frequency = <25000000>;
reset-gpios = <0x27 25 0>;
dc-gpios = <0x27 110 0>;
@@ -84,7 +90,8 @@
display@1 {
compatible = "nokia,beatles-gc9305-ext-panel", "panel-mipi-dbi-spi";
reg = <1>;
spi-max-frequency = <50000000>;
spi-max-frequency = <25000000>;
dc-gpios = <0x27 21 0>;
reset-gpios = <0x27 23 0>;
power-supply = <0x6c>;
io-supply = <0x6d>;