Files
bananarchy/devices/nokia-beatles/cover-panel.dtsi
T

125 lines
3.8 KiB
Devicetree

// SPDX-License-Identifier: GPL-2.0
//
// 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
// 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.
//
// 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.
/dts-v1/;
/plugin/;
/ {
fragment@0 {
target-path = "/";
__overlay__ {
spi_panel_mux: spi-panel-mux {
compatible = "gpio-mux";
#mux-control-cells = <0>;
mux-gpios = <0x27 13 0>;
idle-state = <0>;
};
};
};
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 = <50000000>;
mux-controls = <&spi_panel_mux>;
display@0 {
compatible = "nokia,beatles-gc9305-panel", "panel-mipi-dbi-spi";
reg = <0>;
spi-max-frequency = <50000000>;
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 = <50000000>;
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";
};
};
};