From 3d414e3162f42162477389033bdc9a508e72ee0b Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Tue, 27 Oct 2026 12:05:24 -0647 Subject: [PATCH 1/2] dt-bindings: display: panel: Add Google TG4C The TG4C is the 1080x2424 command-mode AMOLED panel of the Google Pixel 9a, on four DSI lanes with a TE line, at 60 or 120 Hz. Google drives it with DSC 1.2, two 540x24 slices at 8 bits per pixel. Its supplies and reset follow Google's tegu device tree (vci, vddi, vddd, reset), as the S6E3HC4's do. Link: https://android.googlesource.com/kernel/devices/google/tegu/+/6276884d9940694b25a6934671918ec8ac412ee8/dts/zuma-tegu-connector.dtsi Link: https://android.googlesource.com/kernel/google-modules/display/panels/tegu/+/e3a801fb038fdd1bbaec36d387f27bd99f10757a/panel-gs-tg4c.c Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com> --- .../bindings/display/panel/google,tg4c.yaml | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/google,tg4c.yaml diff --git a/Documentation/devicetree/bindings/display/panel/google,tg4c.yaml b/Documentation/devicetree/bindings/display/panel/google,tg4c.yaml new file mode 100644 index 0000000000..081caf0e7b --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/google,tg4c.yaml @@ -0,0 +1,63 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/panel/google,tg4c.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Google TG4C AMOLED DSI panel + +description: + The TG4C is the 1080x2424 command-mode AMOLED panel of the Google Pixel + 9a. It takes DSC 1.2 compressed pixel data (two 540x24 slices at 8 bits + per pixel) over four MIPI DSI lanes, reports its refresh timing on a + tearing effect (TE) line and runs at 60 or 120 Hz. + +maintainers: + - W4HO <87742609+W4HO-ham@users.noreply.github.com> + +allOf: + - $ref: panel-common.yaml# + +properties: + compatible: + const: google,tg4c + + reg: + maxItems: 1 + + reset-gpios: true + + vddi-supply: + description: I/O supply + + vddd-supply: + description: Digital core supply + + vci-supply: + description: Analog supply + +required: + - compatible + - reg + +unevaluatedProperties: false + +examples: + - | + #include + + dsi { + #address-cells = <1>; + #size-cells = <0>; + + panel@0 { + compatible = "google,tg4c"; + reg = <0>; + reset-gpios = <&gpp0 0 GPIO_ACTIVE_LOW>; + vci-supply = <&vci>; + vddi-supply = <&vddi>; + vddd-supply = <&vddd>; + }; + }; + +... From 223b98abf9bef5a2d74688155678052b1464aa46 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Tue, 27 Oct 2026 12:05:24 -0647 Subject: [PATCH 2/2] drm/panel: Add the Google TG4C panel Add a driver for the Google Pixel 9a's TG4C command-mode AMOLED panel. The bootloader powers the panel, initialises it and leaves it running at 60 Hz; the driver takes it over as it is, as the S6E3HC4 driver does, and never resets it or touches its supplies: - sleep in and out around a power cycle of the display pipeline, keeping the panel's registers; - 60 and 120 Hz through drm_panel_set_refresh_rate() (0x2f 0x02 and 0x2f 0x00, Google's tg4c_change_frequency()); - the brightness as a DCS backlight over Google's normal range, levels 1 to 3628 (up to 1200 nits), with Google's default of 1829. The levels above 3628 are high brightness mode and are left for a later control of their own. Command sequences, modes and sizes from Google's MIT-licensed panel driver. Tested on the Pixel 9a (7.3.0-rc6-omamobile-tegu-s2mpg15-m1, this file at blob 19c89b162a5e, which used 4095 as maximum and default) with gs-dsim-cmd and gs-decon: the desktop runs at 120 Hz, DPMS off puts the panel to sleep and DPMS on wakes it, and the brightness follows the backlight across its range. This version changes only the brightness range and default and the physical size, and drops an unused flag. Link: https://android.googlesource.com/kernel/google-modules/display/panels/tegu/+/e3a801fb038fdd1bbaec36d387f27bd99f10757a/panel-gs-tg4c.c Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com> --- MAINTAINERS | 6 + drivers/gpu/drm/panel/Kconfig | 12 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-google-tg4c.c | 269 ++++++++++++++++++++++ 4 files changed, 288 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-google-tg4c.c diff --git a/MAINTAINERS b/MAINTAINERS index 90822d29fc..00e06c4795 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8148,6 +8148,12 @@ T: git https://gitlab.freedesktop.org/drm/misc/kernel.git F: drivers/gpu/drm/gud/ F: include/drm/gud.h +DRM DRIVER FOR GOOGLE TG4C PANELS +M: W4HO <87742609+W4HO-ham@users.noreply.github.com> +S: Maintained +F: Documentation/devicetree/bindings/display/panel/google,tg4c.yaml +F: drivers/gpu/drm/panel/panel-google-tg4c.c + DRM DRIVER FOR GRAIN MEDIA GM12U320 PROJECTORS M: Hans de Goede S: Maintained diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index e77a48b570..5d667d0148 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -198,6 +198,18 @@ config DRM_PANEL_DSI_CM DRM panel driver for DSI command mode panels with support for embedded and external backlights. +config DRM_PANEL_GOOGLE_TG4C + tristate "Google TG4C DSI command mode panel" + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + help + Say Y or M here if you want to enable support for the Google + TG4C 1080x2424 command-mode AMOLED panel, found in the Google + Pixel 9a. The driver takes over the panel the bootloader left + running, switches it between 60 and 120 Hz, puts it to sleep and + exposes its brightness as a backlight. + config DRM_PANEL_LVDS tristate "Generic LVDS panel driver" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 83beb2645e..cbf10d7d4d 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -13,6 +13,7 @@ obj-$(CONFIG_DRM_PANEL_BOE_TV101WUM_NL6) += panel-boe-tv101wum-nl6.o obj-$(CONFIG_DRM_PANEL_CHIPONE_ICNA35XX) += panel-chipone-icna35xx.o obj-$(CONFIG_DRM_PANEL_CHIPWEALTH_CH13726A) += panel-chipwealth-ch13726a.o obj-$(CONFIG_DRM_PANEL_DSI_CM) += panel-dsi-cm.o +obj-$(CONFIG_DRM_PANEL_GOOGLE_TG4C) += panel-google-tg4c.o obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o obj-$(CONFIG_DRM_PANEL_EDP) += panel-edp.o diff --git a/drivers/gpu/drm/panel/panel-google-tg4c.c b/drivers/gpu/drm/panel/panel-google-tg4c.c new file mode 100644 index 0000000000..f956318402 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-google-tg4c.c @@ -0,0 +1,269 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Google TG4C DSI command-mode AMOLED panel (Google Pixel 9a) + * + * Command sequences from Google's MIT-licensed panel driver + * (google-modules/display/panels/tegu/panel-gs-tg4c.c). + * + * The bootloader powers the panel on, initialises it and leaves it running + * at 60 Hz. The driver takes it over as it is and never resets it or + * touches its supplies: it puts it to sleep and wakes it (sleep in/out, + * the panel keeps its registers), switches it between 60 and 120 Hz and + * sets its brightness. A panel without the bootloader's initialisation is + * not handled. + */ + +#include +#include +#include +#include + +#include