// SPDX-License-Identifier: GPL-2.0 // // Nokia 2720 Flip (nokia-beatles) external 240x240 GC9305 panel. // // Reference overlay for a DTB that still has the old single-panel layout. // The two-panel wiring is NOT applied to the shipping DTB: it lives in // qcom-msm8905-nokia-beatles-cover.dts (opt-in, built by // 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 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 // 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. // // 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 in the initramfs. /dts-v1/; /plugin/; / { fragment@0 { target-path = "/"; __overlay__ { 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>; }; }; }; fragment@1 { target-path = "/soc@0/spi@78b9000"; __overlay__ { spi-mux@0 { compatible = "spi-mux"; reg = <0>; #address-cells = <1>; #size-cells = <0>; spi-max-frequency = <25000000>; mux-controls = <0x96>; display@0 { compatible = "nokia,beatles-gc9305-panel", "panel-mipi-dbi-spi"; reg = <0>; spi-max-frequency = <25000000>; reset-gpios = <0x27 25 0>; dc-gpios = <0x27 110 0>; backlight = <0x6b>; power-supply = <0x6c>; io-supply = <0x6d>; width-mm = <36>; height-mm = <48>; pinctrl-0 = <0x6e>; pinctrl-names = "default"; panel-timing { hactive = <240>; vactive = <320>; hback-porch = <0>; vback-porch = <0>; hfront-porch = <0>; vfront-porch = <0>; hsync-len = <0>; vsync-len = <0>; clock-frequency = <0>; }; }; display@1 { compatible = "nokia,beatles-gc9305-ext-panel", "panel-mipi-dbi-spi"; reg = <1>; spi-max-frequency = <25000000>; dc-gpios = <0x27 21 0>; reset-gpios = <0x27 23 0>; power-supply = <0x6c>; io-supply = <0x6d>; width-mm = <30>; height-mm = <30>; pinctrl-0 = <0x92>; pinctrl-names = "default"; write-only; panel-timing { hactive = <240>; vactive = <240>; hback-porch = <0>; vback-porch = <0>; hfront-porch = <0>; vfront-porch = <0>; hsync-len = <0>; vsync-len = <0>; clock-frequency = <0>; }; }; }; }; }; fragment@2 { target-path = "/soc@0/spi@78b9000/display@0"; __overlay__ { status = "disabled"; }; }; fragment@3 { target-path = "/soc@0/spi@78b9000/spidev@1"; __overlay__ { status = "disabled"; }; }; };