diff --git a/Documentation/devicetree/bindings/display/panel/samsung,s6e3fc3-p10.yaml b/Documentation/devicetree/bindings/display/panel/samsung,s6e3fc3-p10.yaml new file mode 100644 index 0000000000..085df99a8b --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/samsung,s6e3fc3-p10.yaml @@ -0,0 +1,62 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/panel/samsung,s6e3fc3-p10.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Samsung S6E3FC3 P10 AMOLED DSI panel + +description: + The S6E3FC3 is a display driver IC from Samsung Mobile Display. The P10 + panel is its 1080x2400 command-mode AMOLED panel in the Google Pixel 7. + It takes DSC-compressed pixel data over four MIPI DSI lanes and reports + its refresh timing on a tearing effect (TE) line. + +maintainers: + - Alejandro Garcia + +allOf: + - $ref: panel-common.yaml# + +properties: + compatible: + const: samsung,s6e3fc3-p10 + + reg: + maxItems: 1 + + reset-gpios: true + + vddi-supply: + description: I/O supply + + vci-supply: + description: Analog supply + +required: + - compatible + - reg + - reset-gpios + +unevaluatedProperties: false + +examples: + - | + #include + + dsi { + #address-cells = <1>; + #size-cells = <0>; + + panel@0 { + compatible = "samsung,s6e3fc3-p10"; + reg = <0>; + reset-gpios = <&gpa7 1 GPIO_ACTIVE_LOW>; + vddi-supply = <&vddi>; + vci-supply = <&vci>; + width-mm = <66>; + height-mm = <146>; + }; + }; + +... diff --git a/arch/arm64/boot/dts/exynos/google/gs201-panther.dts b/arch/arm64/boot/dts/exynos/google/gs201-panther.dts index cae0e762a9..97bc574501 100644 --- a/arch/arm64/boot/dts/exynos/google/gs201-panther.dts +++ b/arch/arm64/boot/dts/exynos/google/gs201-panther.dts @@ -5,8 +5,8 @@ * USB (NCM + ACM), the cluster watchdogs from gs201.dtsi, a * simple-framebuffer on the buffer ABL leaves DPP0 scanning out, UFS, the * three keys, the touchscreen with its rails on the main PMIC, the GPU, the - * haptics and the MAX77759's I2C bus with its fuel gauge. The panel driver - * stays disabled. + * haptics, the MAX77759's I2C bus with its fuel gauge and the DSI command + * path to the panel. The display itself stays on simple-framebuffer. */ /dts-v1/; @@ -35,8 +35,8 @@ /* * ABL leaves DECON0 -> DSIM0 -> panel (sdc-s6e3fc3) running in * command mode with DPP0 scanning 0xfac00000 (RDMA_BASEADDR_Y8, - * read on this phone). There is no panel driver, so no panel - * phandle; the size comes from this node. + * read on this phone). simplefb scans it out and takes the size + * from this node; the panel under dsi0 only takes commands. */ framebuffer0: framebuffer@fac00000 { compatible = "simple-framebuffer"; @@ -161,6 +161,34 @@ }; }; +/* + * Display bring-up, gate D1 (device/panther/DISPLAY-PLAN.md): the DPU and + * DISP clock controllers, and DSIM0 with the panel, so the panel driver can + * take the bootloader's panel over and send it DCS commands. DECON0 stays + * disabled, and simplefb keeps scanning out. + */ +&cmu_disp { + status = "okay"; +}; + +&cmu_dpu { + status = "okay"; +}; + +&dsi0 { + status = "okay"; + + panel@0 { + compatible = "samsung,s6e3fc3-p10"; + reg = <0>; + /* high = running; the bootloader leaves it high */ + reset-gpios = <&gpa7 1 GPIO_ACTIVE_LOW>; + /* vci (S2MPG12 LDO27M) and vddi (S2MPG13 BUCKA): no driver yet */ + width-mm = <66>; + height-mm = <146>; + }; +}; + &gpu { /* No mali-supply: the G3D rails follow the PMU power domain and ACPM. */ status = "okay"; diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 5d667d0148..ffefd2d9fa 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -1020,6 +1020,21 @@ config DRM_PANEL_SAMSUNG_S6E3FC2X01 Samsung AMS641RW (found in the OnePlus 6T smartphone) +config DRM_PANEL_SAMSUNG_S6E3FC3 + tristate "Samsung S6E3FC3 DSI command mode panel" + depends on GPIOLIB + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + select DRM_DISPLAY_HELPER + select DRM_DISPLAY_DSC_HELPER + help + Say Y or M here if you want to enable support for the Samsung + S6E3FC3 DDIC and its P10 1080x2400 command-mode AMOLED panel, + found in the Google Pixel 7. The driver can take over a panel the + bootloader left running and exposes its brightness as a backlight + device. + config DRM_PANEL_SAMSUNG_S6E3HA2 tristate "Samsung S6E3HA2 DSI video mode panel" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index cbf10d7d4d..2149785e7b 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -98,6 +98,7 @@ obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6D27A1) += panel-samsung-s6d27a1.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6D7AA0) += panel-samsung-s6d7aa0.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3FA7) += panel-samsung-s6e3fa7.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3FC2X01) += panel-samsung-s6e3fc2x01.o +obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3FC3) += panel-samsung-s6e3fc3.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HA2) += panel-samsung-s6e3ha2.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HA8) += panel-samsung-s6e3ha8.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HC4) += panel-samsung-s6e3hc4.o diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e3fc3.c b/drivers/gpu/drm/panel/panel-samsung-s6e3fc3.c new file mode 100644 index 0000000000..56d97ec744 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-samsung-s6e3fc3.c @@ -0,0 +1,433 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Samsung S6E3FC3 DSI command-mode AMOLED panel, P10 (Google Pixel 7) + * + * Command sequences from Google's GPL panel driver + * (google-modules/display/samsung/panel/panel-samsung-s6e3fc3-p10.c), + * restricted to the EVT1 and later panels that ship in phones. Local HBM, + * low-power (AOD) modes and the panel revision reads are left out. + * + * The bootloader powers the panel on and leaves it running. When the + * reset line is released at probe, the driver takes the panel over as it + * is: it sends nothing until the brightness or the power state changes. + */ + +#include +#include +#include +#include +#include +#include + +#include