* [PATCH v5 0/2] drm/panel: Add Novatek NT36525 (Samsung Galaxy XCover5)
@ 2026-12-05 3:20 Adil Hüsrev Tepe
2026-12-05 3:20 ` [PATCH v5 1/2] dt-bindings: display: panel: novatek,nt36672a: Add NT36525 CSOT panel Adil Hüsrev Tepe
2026-12-05 3:20 ` [PATCH v5 2/2] drm/panel: Add Novatek NT36525 panel driver Adil Hüsrev Tepe
0 siblings, 2 replies; 5+ messages in thread
From: Adil Hüsrev Tepe @ 2026-12-05 3:20 UTC (permalink / raw)
To: Sumit Semwal, Neil Armstrong, Jessica Zhang, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: Krzysztof Kozlowski, Uwe Kleine-König, Michael McAllister,
phone-devel, dri-devel, devicetree, linux-kernel,
Adil Hüsrev Tepe
Add a driver for DSI panels built around the Novatek NT36525 display
controller, and describe the first such panel in the bindings: the
720x1480 video mode panel of the Samsung Galaxy XCover5 (SM-G525F,
Exynos850), made by CSOT. The board DTS of this phone is not in mainline
yet.
Three points need a maintainer's decision. I will rename or move
whatever you prefer:
- Compatible "samsung,xcover5-csot-nt36525" with the fallback
"novatek,nt36525". I do not know the CSOT part number: Samsung's kernel
only has the vendor "CSO" and the model "CSO_5_31_inch". I read "CSO"
as CSOT.
The module label was not read (that needs disassembly of the phone),
and no part number is available from Samsung's kernel (only "CSO" /
"CSO_5_31_inch"), the vendor firmware, or market listings, so the
compatible keeps samsung,xcover5-csot-nt36525.
The name follows xiaomi,elish-csot-nt36523 in novatek,nt36523.yaml.
- The panel is added to novatek,nt36672a.yaml and not to
novatek,nt36536.yaml, which I named in my reply to the v4 review.
nt36536.yaml uses panel-common-dual.yaml, which requires port or ports.
nt36672a.yaml is single link and has the same three supplies.
- port is not required for this panel: it has no OF graph connection, it
is only a child node of the DSI host. I read "Drop port" as "do not
require it"; the property is still allowed through panel-common.yaml.
port stays required for the existing NT36672A panel so that its schema
does not change. If you meant to drop the requirement for both panels,
I will remove the if.
Michael, the driver is now built around per-panel data, so the Moto G10
DJN NT36525B panel can be a second entry. DCS backlight and your reset
timing are left to your patch because I cannot test them here.
v5 is sent with b4 as a new thread, as asked.
Tested on one Samsung Galaxy XCover5 (SM-G525F, Exynos850) with this exact
code: the driver probes and the DSI panel is brought up. The vddio, vddpos
and vddneg supplies resolve to the board's regulators (1.8 V, and the
+/-5.9 V LCD bias) with no dummy-regulator fallback and are enabled on
power-on, the DSI connector reports connected, a backlight device
registers, and the display pipeline enables and scans out without error.
The Moto G10 NT36525B path is untested (no hardware).
An AI coding assistant (Claude Code) helped convert the vendor init
sequence and draft these patches.
I reviewed and tested them on the device.
Changes in v5:
- binding: no new file, the panel is added to novatek,nt36672a.yaml
- binding: compatible renamed to samsung,xcover5-csot-nt36525
- binding: supplies are vddio, vddpos, vddneg; port is not required
- driver: per-panel data selected by the compatible
- driver: devm_drm_panel_add() and devm_mipi_dsi_attach(), no remove()
- driver: include <linux/of.h>, drop <video/mipi_display.h>
- driver: generic Kconfig text and comments, MAINTAINERS entry
- shorter commit messages
- Link to v4: https://patch.msgid.link/20261120114100.978148-1-tadilhusrev@gmail.com
---
Adil Hüsrev Tepe (2):
dt-bindings: display: panel: novatek,nt36672a: Add NT36525 CSOT panel
drm/panel: Add Novatek NT36525 panel driver
.../bindings/display/panel/novatek,nt36672a.yaml | 70 ++-
MAINTAINERS | 7 +
drivers/gpu/drm/panel/Kconfig | 13 +
drivers/gpu/drm/panel/Makefile | 1 +
drivers/gpu/drm/panel/panel-novatek-nt36525.c | 513 +++++++++++++++++++++
5 files changed, 586 insertions(+), 18 deletions(-)
---
base-commit: aebb7274476403040d582c61478df8f4a7bf9cd3
change-id: 20261129-nt36525-44137b7180ab
Best regards,
--
Adil Hüsrev Tepe <tadilhusrev@gmail.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v5 1/2] dt-bindings: display: panel: novatek,nt36672a: Add NT36525 CSOT panel
2026-12-05 3:20 [PATCH v5 0/2] drm/panel: Add Novatek NT36525 (Samsung Galaxy XCover5) Adil Hüsrev Tepe
@ 2026-12-05 3:20 ` Adil Hüsrev Tepe
2026-12-05 3:32 ` sashiko-bot
2026-12-05 3:20 ` [PATCH v5 2/2] drm/panel: Add Novatek NT36525 panel driver Adil Hüsrev Tepe
1 sibling, 1 reply; 5+ messages in thread
From: Adil Hüsrev Tepe @ 2026-12-05 3:20 UTC (permalink / raw)
To: Sumit Semwal, Neil Armstrong, Jessica Zhang, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: Krzysztof Kozlowski, Uwe Kleine-König, Michael McAllister,
phone-devel, dri-devel, devicetree, linux-kernel,
Adil Hüsrev Tepe
The Samsung Galaxy XCover5 (SM-G525F) has a 720x1480 video mode DSI panel
made by CSOT that is built around the Novatek NT36525. It is a single
link panel with the same three supplies as the NT36672A panel described
here, so add it to this binding. Its reset line is active low.
The panel has no OF graph connection: it is only a child node of the DSI
host, whose binding does not require an output port. So "port" is not
required for this panel. The requirement is kept for the existing
NT36672A panel so that its schema does not change.
Signed-off-by: Adil Hüsrev Tepe <tadilhusrev@gmail.com>
---
Changes in v5:
- drop the new file novatek,nt36525.yaml and add the panel to
novatek,nt36672a.yaml
- rename the compatible from novatek,nt36525-xcover5 to
samsung,xcover5-csot-nt36525
- supplies follow this file: vddio, vddpos, vddneg (were vdd, vpos, vneg)
- port is not required for this panel
---
.../bindings/display/panel/novatek,nt36672a.yaml | 70 ++++++++++++++++------
1 file changed, 52 insertions(+), 18 deletions(-)
diff --git a/Documentation/devicetree/bindings/display/panel/novatek,nt36672a.yaml b/Documentation/devicetree/bindings/display/panel/novatek,nt36672a.yaml
index 5d16d851172..b7e077e0f48 100644
--- a/Documentation/devicetree/bindings/display/panel/novatek,nt36672a.yaml
+++ b/Documentation/devicetree/bindings/display/panel/novatek,nt36672a.yaml
@@ -4,30 +4,34 @@
$id: http://devicetree.org/schemas/display/panel/novatek,nt36672a.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
-title: Novatek NT36672A based DSI display Panels
+title: Novatek NT36672A and NT36525 based DSI display Panels
maintainers:
- Sumit Semwal <sumit.semwal@linaro.org>
description: |
- The nt36672a IC from Novatek is a generic DSI Panel IC used to drive dsi
- panels.
- Right now, support is added only for a Tianma FHD+ LCD display panel with a
- resolution of 1080x2246. It is a video mode DSI panel.
-
-allOf:
- - $ref: panel-common.yaml#
+ The nt36672a and nt36525 ICs from Novatek are generic DSI Panel ICs used to
+ drive dsi panels. The following video mode DSI panels are described here:
+ - Tianma FHD+ LCD display panel with a resolution of 1080x2246, based on
+ the nt36672a
+ - CSOT HD+ LCD display panel with a resolution of 720x1480, based on the
+ nt36525, used in the Samsung Galaxy XCover5
properties:
compatible:
- items:
- - enum:
- - tianma,fhd-video
- - const: novatek,nt36672a
- description: This indicates the panel manufacturer of the panel that is
- in turn using the NT36672A panel driver. This compatible string
- determines how the NT36672A panel driver is configured for the indicated
- panel. The novatek,nt36672a compatible shall always be provided as a fallback.
+ oneOf:
+ - items:
+ - enum:
+ - tianma,fhd-video
+ - const: novatek,nt36672a
+ - items:
+ - enum:
+ - samsung,xcover5-csot-nt36525
+ - const: novatek,nt36525
+ description: The first compatible string identifies the panel, which
+ determines how the display controller has to be configured. The
+ compatible string of the Novatek IC that the panel is built around shall
+ always be provided as a fallback.
reg:
maxItems: 1
@@ -35,7 +39,8 @@ properties:
reset-gpios:
maxItems: 1
description: phandle of gpio for reset line - This should be 8mA, gpio
- can be configured using mux, pinctrl, pinctrl-names (active high)
+ can be configured using mux, pinctrl, pinctrl-names. Active high for the
+ Tianma panel, active low for the Samsung Galaxy XCover5 panel.
vddio-supply:
description: phandle of the regulator that provides the supply voltage
@@ -54,7 +59,17 @@ required:
- vddpos-supply
- vddneg-supply
- reset-gpios
- - port
+
+allOf:
+ - $ref: panel-common.yaml#
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: novatek,nt36672a
+ then:
+ required:
+ - port
unevaluatedProperties: false
@@ -84,4 +99,23 @@ examples:
};
};
+ - |
+ #include <dt-bindings/gpio/gpio.h>
+
+ dsi {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ panel@0 {
+ compatible = "samsung,xcover5-csot-nt36525", "novatek,nt36525";
+ reg = <0>;
+ vddio-supply = <&vdd_ldo28>;
+ vddpos-supply = <&lcd_vpos>;
+ vddneg-supply = <&lcd_vneg>;
+
+ backlight = <&lcd_backlight>;
+ reset-gpios = <&gpg2 4 GPIO_ACTIVE_LOW>;
+ };
+ };
+
...
--
2.53.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v5 2/2] drm/panel: Add Novatek NT36525 panel driver
2026-12-05 3:20 [PATCH v5 0/2] drm/panel: Add Novatek NT36525 (Samsung Galaxy XCover5) Adil Hüsrev Tepe
2026-12-05 3:20 ` [PATCH v5 1/2] dt-bindings: display: panel: novatek,nt36672a: Add NT36525 CSOT panel Adil Hüsrev Tepe
@ 2026-12-05 3:20 ` Adil Hüsrev Tepe
2026-12-05 3:33 ` sashiko-bot
1 sibling, 1 reply; 5+ messages in thread
From: Adil Hüsrev Tepe @ 2026-12-05 3:20 UTC (permalink / raw)
To: Sumit Semwal, Neil Armstrong, Jessica Zhang, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: Krzysztof Kozlowski, Uwe Kleine-König, Michael McAllister,
phone-devel, dri-devel, devicetree, linux-kernel,
Adil Hüsrev Tepe
Add a driver for DSI video mode panels built around the Novatek NT36525
display controller. The first supported panel is the 720x1480 CSOT panel
of the Samsung Galaxy XCover5 (SM-G525F): three data lanes, RGB888, an
active low reset line and three supplies (I/O, positive and negative
bias) that are switched on one after the other. Its mode and init
sequence are taken from the Samsung GPL kernel release for this phone.
The driver is built around per-panel data (mode, lane count, pixel
format, mode flags and init sequence) selected by the compatible, so
other NT36525 panels can be added as further entries. The backlight of
this panel has its own driver IC and is taken from the "backlight"
property.
Signed-off-by: Adil Hüsrev Tepe <tadilhusrev@gmail.com>
---
Changes in v5:
- per-panel descriptor selected with of_device_get_match_data(), with the
XCover5 CSOT panel as the only entry; the bytes and delays of the init
sequence are unchanged
- match samsung,xcover5-csot-nt36525 (was novatek,nt36525-xcover5)
- supplies renamed to vddio, vddpos, vddneg to follow the binding
- use devm_drm_panel_add() and devm_mipi_dsi_attach(), drop remove()
- include <linux/of.h>, drop the unused <video/mipi_display.h>
- generic Kconfig text, drop "depends on GPIOLIB"
- shorter comments
- add a MAINTAINERS entry
- commit message without the test log
---
MAINTAINERS | 7 +
drivers/gpu/drm/panel/Kconfig | 13 +
drivers/gpu/drm/panel/Makefile | 1 +
drivers/gpu/drm/panel/panel-novatek-nt36525.c | 513 ++++++++++++++++++++++++++
4 files changed, 534 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index ccbcdc0799b..3dfe91e41c0 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8534,6 +8534,13 @@ T: git https://gitlab.freedesktop.org/drm/misc/kernel.git
F: Documentation/devicetree/bindings/display/panel/novatek,nt36523.yaml
F: drivers/gpu/drm/panel/panel-novatek-nt36523.c
+DRM DRIVER FOR NOVATEK NT36525 PANELS
+M: Adil Hüsrev Tepe <tadilhusrev@gmail.com>
+S: Maintained
+T: git https://gitlab.freedesktop.org/drm/misc/kernel.git
+F: Documentation/devicetree/bindings/display/panel/novatek,nt36672a.yaml
+F: drivers/gpu/drm/panel/panel-novatek-nt36525.c
+
DRM DRIVER FOR NOVATEK NT36532 PANELS
M: Junjie Cao <junjie.cao@linux.dev>
S: Maintained
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 7a520b4d60f..b61284bd513 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -676,6 +676,19 @@ config DRM_PANEL_NOVATEK_NT36523
around the Novatek NT36523 display controller, such as some
Boe panels used in Xiaomi Mi Pad 5 and 5 Pro tablets.
+config DRM_PANEL_NOVATEK_NT36525
+ tristate "Novatek NT36525-based MIPI-DSI panels"
+ depends on OF
+ depends on DRM_MIPI_DSI
+ depends on BACKLIGHT_CLASS_DEVICE
+ help
+ Say Y here if you want to enable support for the panels built
+ around the Novatek NT36525 display controller, such as the CSOT
+ panel used in the Samsung Galaxy XCover5 phone.
+
+ To compile this driver as a module, choose M here: the module
+ will be called panel-novatek-nt36525.
+
config DRM_PANEL_NOVATEK_NT36532
tristate "Novatek NT36532-based MIPI-DSI panels"
depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index da5175909d5..46de72db71d 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -65,6 +65,7 @@ obj-$(CONFIG_DRM_PANEL_NOVATEK_NT35532) += panel-novatek-nt35532.o
obj-$(CONFIG_DRM_PANEL_NOVATEK_NT35560) += panel-novatek-nt35560.o
obj-$(CONFIG_DRM_PANEL_NOVATEK_NT35950) += panel-novatek-nt35950.o
obj-$(CONFIG_DRM_PANEL_NOVATEK_NT36523) += panel-novatek-nt36523.o
+obj-$(CONFIG_DRM_PANEL_NOVATEK_NT36525) += panel-novatek-nt36525.o
obj-$(CONFIG_DRM_PANEL_NOVATEK_NT36532) += panel-novatek-nt36532.o
obj-$(CONFIG_DRM_PANEL_NOVATEK_NT36536) += panel-novatek-nt36536.o
obj-$(CONFIG_DRM_PANEL_NOVATEK_NT36672A) += panel-novatek-nt36672a.o
diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36525.c b/drivers/gpu/drm/panel/panel-novatek-nt36525.c
new file mode 100644
index 00000000000..91ce09cf91d
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-novatek-nt36525.c
@@ -0,0 +1,513 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Novatek NT36525 DriverIC panels driver
+ *
+ * The mode and the init sequence of the Samsung Galaxy XCover5 panel are
+ * taken from the Samsung GPL kernel release for the SM-G525F
+ * (drivers/video/fbdev/exynos/panel/nt36525/nt36525_xcover5_panel.h).
+ */
+
+#include <linux/delay.h>
+#include <linux/gpio/consumer.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/regulator/consumer.h>
+
+#include <drm/drm_mipi_dsi.h>
+#include <drm/drm_modes.h>
+#include <drm/drm_panel.h>
+#include <drm/drm_probe_helper.h>
+
+struct nt36525_panel_desc {
+ struct drm_display_mode mode;
+ unsigned int lanes;
+ enum mipi_dsi_pixel_format format;
+ unsigned long mode_flags;
+
+ int (*init_sequence)(struct mipi_dsi_multi_context *dsi_ctx);
+};
+
+struct nt36525 {
+ struct drm_panel panel;
+ struct mipi_dsi_device *dsi;
+ const struct nt36525_panel_desc *desc;
+ struct regulator *vddio;
+ struct regulator *vddpos;
+ struct regulator *vddneg;
+ struct gpio_desc *reset_gpio;
+};
+
+static inline struct nt36525 *to_nt36525(struct drm_panel *panel)
+{
+ return container_of(panel, struct nt36525, panel);
+}
+
+static int samsung_xcover5_csot_init_seq(struct mipi_dsi_multi_context *dsi_ctx)
+{
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xff, 0x20);
+ mipi_dsi_msleep(dsi_ctx, 1);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xfb, 0x01);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x00, 0x01);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x01, 0x55);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x03, 0x55);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x05, 0xa9);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x07, 0x73);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x08, 0xc1);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x0e, 0x91);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x0f, 0x5f);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x1f, 0x00);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x69, 0xa9);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x94, 0x00);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x95, 0xeb);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x96, 0xeb);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xff, 0x24);
+ mipi_dsi_msleep(dsi_ctx, 1);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xfb, 0x01);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x00, 0x00);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x04, 0x21);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x06, 0x22);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x07, 0x20);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x08, 0x1d);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x0a, 0x0c);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x0b, 0x0d);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x0c, 0x0e);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x0d, 0x0f);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x0f, 0x04);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x10, 0x05);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x12, 0x1e);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x13, 0x1e);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x14, 0x1e);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x16, 0x00);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x1a, 0x21);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x1c, 0x22);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x1d, 0x20);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x1e, 0x1d);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x20, 0x0c);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x21, 0x0d);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x22, 0x0e);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x23, 0x0f);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x25, 0x04);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x26, 0x05);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x28, 0x1e);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x29, 0x1e);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x2a, 0x1e);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x2f, 0x09);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x30, 0x07);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x33, 0x07);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x34, 0x09);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x37, 0x33);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x39, 0x00);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x3a, 0x05);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x3b, 0x94);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x3d, 0x92);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x4d, 0x12);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x4e, 0x34);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x51, 0x43);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x52, 0x21);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x55, 0x86);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x56, 0x34);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x5a, 0x05);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x5b, 0x94);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x5c, 0xc0);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x5d, 0x06);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x5e, 0x0c);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x5f, 0x00);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x60, 0x80);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x61, 0x72);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x64, 0x11);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x82, 0x0a);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x83, 0x0c);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x85, 0x00);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x86, 0x51);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x92, 0xba);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x93, 0x12);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x94, 0x0a);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xab, 0x00);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xac, 0x00);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xad, 0x00);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xaf, 0x04);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xb0, 0x05);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xb1, 0xb5);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xff, 0x25);
+ mipi_dsi_msleep(dsi_ctx, 1);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xfb, 0x01);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x0a, 0x82);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x0b, 0x50);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x0c, 0x01);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x17, 0x82);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x18, 0x06);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x19, 0x0f);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x58, 0x00);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x59, 0x00);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x5a, 0x40);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x5b, 0x80);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x5c, 0x00);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x5d, 0x05);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x5e, 0x94);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x5f, 0x05);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x60, 0x94);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x61, 0x05);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x62, 0x94);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x65, 0x05);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x66, 0xb5);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xc0, 0x03);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xca, 0x1c);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xcc, 0x1c);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xd3, 0x11);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xd4, 0xc8);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xd5, 0x11);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xd6, 0x1c);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xd7, 0x11);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xff, 0x26);
+ mipi_dsi_msleep(dsi_ctx, 1);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xfb, 0x01);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x00, 0xa0);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xff, 0x27);
+ mipi_dsi_msleep(dsi_ctx, 1);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xfb, 0x01);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x13, 0x00);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x15, 0xb4);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x1f, 0x55);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x26, 0x0f);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xc0, 0x18);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xc1, 0xe0);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xc2, 0x00);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xc3, 0x00);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xc4, 0xe0);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xc5, 0x00);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xc6, 0x00);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xc7, 0x03);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xff, 0x23);
+ mipi_dsi_msleep(dsi_ctx, 1);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xfb, 0x01);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x07, 0x20);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x08, 0x10);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x12, 0xa6);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x15, 0xfc);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x16, 0x0b);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x04, 0x00);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x19, 0x00);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x1a, 0x00);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x1b, 0x08);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x1c, 0x0a);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x1d, 0x0c);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x1e, 0x12);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x1f, 0x16);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x20, 0x1a);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x21, 0x1c);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x22, 0x20);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x23, 0x24);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x24, 0x28);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x25, 0x2c);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x26, 0x30);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x27, 0x38);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x28, 0x3c);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x29, 0x10);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x30, 0xff);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x31, 0xff);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x32, 0xfe);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x33, 0xfd);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x34, 0xfd);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x35, 0xfc);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x36, 0xfb);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x37, 0xf9);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x38, 0xf7);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x39, 0xf3);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x3a, 0xea);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x3b, 0xe6);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x3d, 0xe0);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x3f, 0xdd);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x40, 0xdb);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x41, 0xd9);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xff, 0x20);
+ mipi_dsi_msleep(dsi_ctx, 1);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xfb, 0x01);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xb0,
+ 0x00, 0x08, 0x00, 0x18, 0x00, 0x34, 0x00, 0x4c,
+ 0x00, 0x61, 0x00, 0x74, 0x00, 0x86, 0x00, 0x96);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xb1,
+ 0x00, 0xa5, 0x00, 0xdb, 0x01, 0x02, 0x01, 0x43,
+ 0x01, 0x71, 0x01, 0xbd, 0x01, 0xf7, 0x01, 0xfa);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xb2,
+ 0x02, 0x34, 0x02, 0x6f, 0x02, 0x98, 0x02, 0xcc,
+ 0x02, 0xf1, 0x03, 0x1d, 0x03, 0x2d, 0x03, 0x3b);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xb3,
+ 0x03, 0x4d, 0x03, 0x60, 0x03, 0x7a, 0x03, 0x94,
+ 0x03, 0xa6, 0x03, 0xa7);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xb4,
+ 0x00, 0x08, 0x00, 0x18, 0x00, 0x34, 0x00, 0x4c,
+ 0x00, 0x61, 0x00, 0x74, 0x00, 0x86, 0x00, 0x96);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xb5,
+ 0x00, 0xa5, 0x00, 0xdb, 0x01, 0x02, 0x01, 0x43,
+ 0x01, 0x71, 0x01, 0xbd, 0x01, 0xf7, 0x01, 0xfa);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xb6,
+ 0x02, 0x34, 0x02, 0x6f, 0x02, 0x98, 0x02, 0xcc,
+ 0x02, 0xf1, 0x03, 0x1d, 0x03, 0x2d, 0x03, 0x3b);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xb7,
+ 0x03, 0x4d, 0x03, 0x60, 0x03, 0x7a, 0x03, 0x94,
+ 0x03, 0xa6, 0x03, 0xa7);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xb8,
+ 0x00, 0x08, 0x00, 0x18, 0x00, 0x34, 0x00, 0x4c,
+ 0x00, 0x61, 0x00, 0x74, 0x00, 0x86, 0x00, 0x96);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xb9,
+ 0x00, 0xa5, 0x00, 0xdb, 0x01, 0x02, 0x01, 0x43,
+ 0x01, 0x71, 0x01, 0xbd, 0x01, 0xf7, 0x01, 0xfa);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xba,
+ 0x02, 0x34, 0x02, 0x6f, 0x02, 0x98, 0x02, 0xcc,
+ 0x02, 0xf1, 0x03, 0x1d, 0x03, 0x2d, 0x03, 0x3b);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xbb,
+ 0x03, 0x4d, 0x03, 0x60, 0x03, 0x7a, 0x03, 0x94,
+ 0x03, 0xa6, 0x03, 0xa7);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xff, 0x21);
+ mipi_dsi_msleep(dsi_ctx, 1);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xfb, 0x01);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xb0,
+ 0x00, 0x00, 0x00, 0x10, 0x00, 0x2c, 0x00, 0x44,
+ 0x00, 0x59, 0x00, 0x6c, 0x00, 0x7e, 0x00, 0x8e);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xb1,
+ 0x00, 0x9d, 0x00, 0xd3, 0x00, 0xfa, 0x01, 0x3b,
+ 0x01, 0x69, 0x01, 0xb5, 0x01, 0xef, 0x01, 0xf2);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xb2,
+ 0x02, 0x2c, 0x02, 0x79, 0x02, 0xaa, 0x02, 0xe6,
+ 0x03, 0x0f, 0x03, 0x3f, 0x03, 0x4f, 0x03, 0x5f);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xb3,
+ 0x03, 0x71, 0x03, 0x86, 0x03, 0xa0, 0x03, 0xbc,
+ 0x03, 0xce, 0x03, 0xd9);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xb4,
+ 0x00, 0x00, 0x00, 0x10, 0x00, 0x2c, 0x00, 0x44,
+ 0x00, 0x59, 0x00, 0x6c, 0x00, 0x7e, 0x00, 0x8e);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xb5,
+ 0x00, 0x9d, 0x00, 0xd3, 0x00, 0xfa, 0x01, 0x3b,
+ 0x01, 0x69, 0x01, 0xb5, 0x01, 0xef, 0x01, 0xf2);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xb6,
+ 0x02, 0x2c, 0x02, 0x79, 0x02, 0xaa, 0x02, 0xe6,
+ 0x03, 0x0f, 0x03, 0x3f, 0x03, 0x4f, 0x03, 0x5f);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xb7,
+ 0x03, 0x71, 0x03, 0x86, 0x03, 0xa0, 0x03, 0xbc,
+ 0x03, 0xce, 0x03, 0xd9);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xb8,
+ 0x00, 0x00, 0x00, 0x10, 0x00, 0x2c, 0x00, 0x44,
+ 0x00, 0x59, 0x00, 0x6c, 0x00, 0x7e, 0x00, 0x8e);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xb9,
+ 0x00, 0x9d, 0x00, 0xd3, 0x00, 0xfa, 0x01, 0x3b,
+ 0x01, 0x69, 0x01, 0xb5, 0x01, 0xef, 0x01, 0xf2);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xba,
+ 0x02, 0x2c, 0x02, 0x79, 0x02, 0xaa, 0x02, 0xe6,
+ 0x03, 0x0f, 0x03, 0x3f, 0x03, 0x4f, 0x03, 0x5f);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xbb,
+ 0x03, 0x71, 0x03, 0x86, 0x03, 0xa0, 0x03, 0xbc,
+ 0x03, 0xce, 0x03, 0xd9);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xff, 0xd0);
+ mipi_dsi_msleep(dsi_ctx, 1);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xfb, 0x01);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x25, 0xa9);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xff, 0x10);
+ mipi_dsi_msleep(dsi_ctx, 1);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xfb, 0x01);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xba, 0x02);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x55, 0x01);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x53, 0x2c);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x51, 0x0f, 0xff);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x68, 0x00, 0x01);
+ mipi_dsi_dcs_exit_sleep_mode_multi(dsi_ctx);
+ mipi_dsi_msleep(dsi_ctx, 100);
+ mipi_dsi_dcs_set_display_on_multi(dsi_ctx);
+
+ return dsi_ctx->accum_err;
+}
+
+static int nt36525_prepare(struct drm_panel *panel)
+{
+ struct nt36525 *ctx = to_nt36525(panel);
+ struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
+ int ret;
+
+ /* Enable the rails one by one, in the order the vendor kernel uses */
+ ret = regulator_enable(ctx->vddio);
+ if (ret)
+ return ret;
+ usleep_range(1000, 1500);
+ ret = regulator_enable(ctx->vddpos);
+ if (ret)
+ goto disable_vddio;
+ usleep_range(1000, 1500);
+ ret = regulator_enable(ctx->vddneg);
+ if (ret)
+ goto disable_vddpos;
+ usleep_range(1000, 1500);
+
+ /* Reset pulse: RESX released, asserted, released */
+ usleep_range(10000, 11000);
+ gpiod_set_value_cansleep(ctx->reset_gpio, 0);
+ usleep_range(1000, 1500);
+ gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+ usleep_range(3500, 4000);
+ gpiod_set_value_cansleep(ctx->reset_gpio, 0);
+ usleep_range(10000, 11000);
+
+ ret = ctx->desc->init_sequence(&dsi_ctx);
+ if (ret)
+ goto assert_reset;
+
+ return 0;
+
+assert_reset:
+ gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+ regulator_disable(ctx->vddneg);
+ usleep_range(1000, 1500);
+disable_vddpos:
+ regulator_disable(ctx->vddpos);
+ usleep_range(5000, 5500);
+disable_vddio:
+ regulator_disable(ctx->vddio);
+ return ret;
+}
+
+static int nt36525_unprepare(struct drm_panel *panel)
+{
+ struct nt36525 *ctx = to_nt36525(panel);
+ struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
+
+ mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
+ mipi_dsi_msleep(&dsi_ctx, 20);
+ mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
+ mipi_dsi_msleep(&dsi_ctx, 60);
+
+ usleep_range(3000, 3500);
+ regulator_disable(ctx->vddneg);
+ usleep_range(1000, 1500);
+ regulator_disable(ctx->vddpos);
+ usleep_range(5000, 5500);
+ regulator_disable(ctx->vddio);
+ msleep(30);
+ gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+
+ return 0;
+}
+
+static int nt36525_get_modes(struct drm_panel *panel,
+ struct drm_connector *connector)
+{
+ struct nt36525 *ctx = to_nt36525(panel);
+
+ return drm_connector_helper_get_modes_fixed(connector,
+ &ctx->desc->mode);
+}
+
+static const struct drm_panel_funcs nt36525_panel_funcs = {
+ .prepare = nt36525_prepare,
+ .unprepare = nt36525_unprepare,
+ .get_modes = nt36525_get_modes,
+};
+
+static int nt36525_probe(struct mipi_dsi_device *dsi)
+{
+ struct device *dev = &dsi->dev;
+ const struct nt36525_panel_desc *desc;
+ struct nt36525 *ctx;
+ int ret;
+
+ desc = of_device_get_match_data(dev);
+ if (!desc)
+ return -ENODEV;
+
+ ctx = devm_drm_panel_alloc(dev, struct nt36525, panel,
+ &nt36525_panel_funcs,
+ DRM_MODE_CONNECTOR_DSI);
+ if (IS_ERR(ctx))
+ return PTR_ERR(ctx);
+
+ ctx->dsi = dsi;
+ ctx->desc = desc;
+
+ ret = drm_panel_of_backlight(&ctx->panel);
+ if (ret)
+ return dev_err_probe(dev, ret, "Failed to get backlight\n");
+
+ ctx->vddio = devm_regulator_get(dev, "vddio");
+ if (IS_ERR(ctx->vddio))
+ return dev_err_probe(dev, PTR_ERR(ctx->vddio),
+ "Failed to get vddio supply\n");
+
+ ctx->vddpos = devm_regulator_get(dev, "vddpos");
+ if (IS_ERR(ctx->vddpos))
+ return dev_err_probe(dev, PTR_ERR(ctx->vddpos),
+ "Failed to get vddpos supply\n");
+
+ ctx->vddneg = devm_regulator_get(dev, "vddneg");
+ if (IS_ERR(ctx->vddneg))
+ return dev_err_probe(dev, PTR_ERR(ctx->vddneg),
+ "Failed to get vddneg supply\n");
+
+ /*
+ * Keep RESX released here, the bootloader may have left the panel
+ * running. prepare() does the full reset pulse.
+ */
+ ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
+ if (IS_ERR(ctx->reset_gpio))
+ return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
+ "Failed to get reset-gpios\n");
+
+ dsi->lanes = desc->lanes;
+ dsi->format = desc->format;
+ dsi->mode_flags = desc->mode_flags;
+
+ ctx->panel.prepare_prev_first = true;
+
+ ret = devm_drm_panel_add(dev, &ctx->panel);
+ if (ret)
+ return dev_err_probe(dev, ret, "Failed to add panel\n");
+
+ ret = devm_mipi_dsi_attach(dev, dsi);
+ if (ret)
+ return dev_err_probe(dev, ret,
+ "Failed to attach to DSI host\n");
+
+ return 0;
+}
+
+/* CSOT 5.3 inch panel of the Samsung Galaxy XCover5 (SM-G525F) */
+static const struct nt36525_panel_desc samsung_xcover5_csot_desc = {
+ .mode = {
+ .clock = (720 + 128 + 20 + 130) *
+ (1480 + 18 + 2 + 232) * 60 / 1000,
+ .hdisplay = 720,
+ .hsync_start = 720 + 128,
+ .hsync_end = 720 + 128 + 20,
+ .htotal = 720 + 128 + 20 + 130,
+ .vdisplay = 1480,
+ .vsync_start = 1480 + 18,
+ .vsync_end = 1480 + 18 + 2,
+ .vtotal = 1480 + 18 + 2 + 232,
+ .width_mm = 59,
+ .height_mm = 121,
+ .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,
+ },
+ .lanes = 3,
+ .format = MIPI_DSI_FMT_RGB888,
+ .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
+ MIPI_DSI_MODE_LPM | MIPI_DSI_CLOCK_NON_CONTINUOUS,
+ .init_sequence = samsung_xcover5_csot_init_seq,
+};
+
+static const struct of_device_id nt36525_of_match[] = {
+ {
+ .compatible = "samsung,xcover5-csot-nt36525",
+ .data = &samsung_xcover5_csot_desc,
+ },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, nt36525_of_match);
+
+static struct mipi_dsi_driver nt36525_driver = {
+ .probe = nt36525_probe,
+ .driver = {
+ .name = "panel-novatek-nt36525",
+ .of_match_table = nt36525_of_match,
+ },
+};
+module_mipi_dsi_driver(nt36525_driver);
+
+MODULE_AUTHOR("Adil Hüsrev Tepe <tadilhusrev@gmail.com>");
+MODULE_DESCRIPTION("DRM driver for Novatek NT36525 based MIPI DSI panels");
+MODULE_LICENSE("GPL");
--
2.53.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v5 1/2] dt-bindings: display: panel: novatek,nt36672a: Add NT36525 CSOT panel
2026-12-05 3:20 ` [PATCH v5 1/2] dt-bindings: display: panel: novatek,nt36672a: Add NT36525 CSOT panel Adil Hüsrev Tepe
@ 2026-12-05 3:32 ` sashiko-bot
0 siblings, 0 replies; 5+ messages in thread
From: sashiko-bot @ 2026-12-05 3:32 UTC (permalink / raw)
To: Adil Hüsrev Tepe; +Cc: dri-devel, devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] dt-bindings: panel: inaccurate active-high reset polarity for
Tianma panel
--
commit be90f8e4429d4afbd5be8d48dedae0be27654ffe
Author: Adil Hüsrev Tepe <tadilhusrev@gmail.com>
dt-bindings: display: panel: novatek,nt36672a: Add NT36525 CSOT panel
This commit extends the Novatek NT36672A panel DT binding to also cover
the NT36525-based CSOT panel used in the Samsung Galaxy XCover5, making
the port property required only for NT36672A.
> diff --git a/Documentation/devicetree/bindings/display/panel/novatek,nt36672a.yaml b/Documentation/devicetree/bindings/display/panel/novatek,nt36672a.yaml
> index 5d16d85117254..b7e077e0f4835 100644
> --- a/Documentation/devicetree/bindings/display/panel/novatek,nt36672a.yaml
> +++ b/Documentation/devicetree/bindings/display/panel/novatek,nt36672a.yaml
[ ... ]
> @@ -35,7 +39,8 @@ properties:
> reset-gpios:
> maxItems: 1
> description: phandle of gpio for reset line - This should be 8mA, gpio
> - can be configured using mux, pinctrl, pinctrl-names (active high)
> + can be configured using mux, pinctrl, pinctrl-names. Active high for the
> + Tianma panel, active low for the Samsung Galaxy XCover5 panel.
[Severity: Low]
Is the reset-gpios polarity for the Tianma panel actually active high?
The only in-tree user of tianma,fhd-video
(sdm845-xiaomi-beryllium-common.dtsi) specifies GPIO_ACTIVE_LOW. In
panel-novatek-nt36672a.c, nt36672a_panel_power_on() asserts reset with 1
and releases it with 0 before init, matching active-low reset semantics.
Following the documented active-high polarity would leave the Tianma
panel held in reset during initialization. Since panel-common.yaml
already defines reset-gpios as active low, both panels share the same
polarity and this distinction can be dropped.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261205-nt36525-v5-0-8c3f07ee3311@gmail.com?part=1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v5 2/2] drm/panel: Add Novatek NT36525 panel driver
2026-12-05 3:20 ` [PATCH v5 2/2] drm/panel: Add Novatek NT36525 panel driver Adil Hüsrev Tepe
@ 2026-12-05 3:33 ` sashiko-bot
0 siblings, 0 replies; 5+ messages in thread
From: sashiko-bot @ 2026-12-05 3:33 UTC (permalink / raw)
To: Adil Hüsrev Tepe; +Cc: dri-devel, devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] drm/panel: nt36525_unprepare() disables vddio before
asserting reset_gpio
- [Low] drm/panel: nt36525 uses mipi_dsi_msleep(1) instead of
mipi_dsi_usleep_range()
--
commit d1ea9a8be5efeab14d7d9759b6739e475ac7c1ef
Author: Adil Hüsrev Tepe <tadilhusrev@gmail.com>
drm/panel: Add Novatek NT36525 panel driver
This commit adds a MIPI-DSI panel driver for Novatek NT36525-based
panels, initially supporting the 720x1480 CSOT panel used in the
Samsung Galaxy XCover5 (SM-G525F).
> diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36525.c b/drivers/gpu/drm/panel/panel-novatek-nt36525.c
> new file mode 100644
> index 0000000000000..91ce09cf91dfe
> --- /dev/null
> +++ b/drivers/gpu/drm/panel/panel-novatek-nt36525.c
> @@ -0,0 +1,513 @@
[ ... ]
> +static int samsung_xcover5_csot_init_seq(struct mipi_dsi_multi_context *dsi_ctx)
> +{
> + mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xff, 0x20);
> + mipi_dsi_msleep(dsi_ctx, 1);
> + mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xfb, 0x01);
[Severity: Low]
Should the ten 1 ms delays after 0xff page switches in
samsung_xcover5_csot_init_seq() use mipi_dsi_usleep_range() instead of
mipi_dsi_msleep()?
mipi_dsi_msleep() wraps jiffy-based msleep(), sleeping 1-2 jiffies per
call (4-8 ms at HZ=250) and turning 10 ms of delays into 40-80 ms on
every panel power-on and resume. mipi_dsi_usleep_range(dsi_ctx, 1000,
1500) would avoid the overshoot.
[ ... ]
> +assert_reset:
> + gpiod_set_value_cansleep(ctx->reset_gpio, 1);
> + regulator_disable(ctx->vddneg);
> + usleep_range(1000, 1500);
> +disable_vddpos:
> + regulator_disable(ctx->vddpos);
> + usleep_range(5000, 5500);
> +disable_vddio:
> + regulator_disable(ctx->vddio);
> + return ret;
> +}
> +
> +static int nt36525_unprepare(struct drm_panel *panel)
> +{
> + struct nt36525 *ctx = to_nt36525(panel);
> + struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
> +
> + mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
> + mipi_dsi_msleep(&dsi_ctx, 20);
> + mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
> + mipi_dsi_msleep(&dsi_ctx, 60);
> +
> + usleep_range(3000, 3500);
> + regulator_disable(ctx->vddneg);
> + usleep_range(1000, 1500);
> + regulator_disable(ctx->vddpos);
> + usleep_range(5000, 5500);
> + regulator_disable(ctx->vddio);
> + msleep(30);
> + gpiod_set_value_cansleep(ctx->reset_gpio, 1);
> +
> + return 0;
> +}
[Severity: Medium]
Does nt36525_unprepare() disable vddio while reset_gpio is still
deasserted?
Because reset_gpio is active low, logical 0 drives the physical reset
pin high. Disabling vddio 30 ms before asserting reset_gpio leaves the
pin driven high into an unpowered I/O rail, which can back-power vddio
through the ESD clamp and contradicts assert_reset in nt36525_prepare().
Similarly, because nt36525_probe() requests reset_gpio with
GPIOD_OUT_LOW, failing regulator_enable() for vddpos or vddneg jumps to
disable_vddio or disable_vddpos and turns off vddio without asserting
reset_gpio.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261205-nt36525-v5-0-8c3f07ee3311@gmail.com?part=2
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-12-05 3:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-05 3:20 [PATCH v5 0/2] drm/panel: Add Novatek NT36525 (Samsung Galaxy XCover5) Adil Hüsrev Tepe
2026-12-05 3:20 ` [PATCH v5 1/2] dt-bindings: display: panel: novatek,nt36672a: Add NT36525 CSOT panel Adil Hüsrev Tepe
2026-12-05 3:32 ` sashiko-bot
2026-12-05 3:20 ` [PATCH v5 2/2] drm/panel: Add Novatek NT36525 panel driver Adil Hüsrev Tepe
2026-12-05 3:33 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox