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>; + }; + }; + +... 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