* [PATCH v1 0/2] drm/panel: add Novatek NT36525 (Samsung Galaxy XCover5)
@ 2026-11-16 7:02 Adil Hüsrev Tepe
2026-11-16 7:02 ` [PATCH v1 1/2] dt-bindings: display: panel: add Novatek NT36525 Adil Hüsrev Tepe
2026-11-16 7:02 ` [PATCH v1 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-11-16 7:02 UTC (permalink / raw)
To: Neil Armstrong, Jessica Zhang, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, dri-devel, devicetree, linux-kernel,
Adil Hüsrev Tepe
This series adds a DRM panel driver and its DT binding for MIPI-DSI
video-mode panels based on the Novatek NT36525 controller, as fitted on
the Samsung Galaxy XCover5 (SM-G525F, Exynos850). The panel is 720x1480,
uses an active-high reset (RESX), and a DCS init sequence that mirrors
the stock Samsung bring-up. Backlight goes through drm_panel_of_backlight().
Patch 1 dt-bindings (compatible: "samsung,xcover5-nt36525",
"novatek,nt36525")
Patch 2 the panel driver
Tested on a Samsung Galaxy XCover5 running 7.4-rc1 plus this series: the
panel initialises and displays correctly under phosh. checkpatch.pl and
dt_binding_check are clean (bar the usual new-file MAINTAINERS note; the
files are covered by the DRM PANEL DRIVERS wildcards).
Based on v7.4-rc1.
Tool usage
----------
This series was developed during XCover5 mainline bring-up with the help
of an AI coding assistant (Claude Code, Anthropic). The assistant converted
the vendor init stream to mipi_dsi_dcs_write_seq_multi(), drafted the driver
skeleton and the DT binding, and drafted these changelogs. I reviewed every
line, validated the binding (dt_binding_check, yamllint), tested the driver
on hardware, and take full responsibility for the contribution.
Prompt summary: "convert the XCover5 NT36525 vendor panel init into a
mainline drm_panel driver plus DT binding; keep it checkpatch- and
dt_binding_check-clean; test on the device." Review comments are welcome
and I will answer them myself.
Adil Hüsrev Tepe (2):
dt-bindings: display: panel: add Novatek NT36525
drm/panel: add Novatek NT36525 panel driver
.../display/panel/novatek,nt36525.yaml | 71 +++
drivers/gpu/drm/panel/Kconfig | 13 +
drivers/gpu/drm/panel/Makefile | 1 +
drivers/gpu/drm/panel/panel-novatek-nt36525.c | 486 ++++++++++++++++++
4 files changed, 571 insertions(+)
create mode 100644 Documentation/devicetree/bindings/display/panel/novatek,nt36525.yaml
create mode 100644 drivers/gpu/drm/panel/panel-novatek-nt36525.c
--
2.53.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v1 1/2] dt-bindings: display: panel: add Novatek NT36525
2026-11-16 7:02 [PATCH v1 0/2] drm/panel: add Novatek NT36525 (Samsung Galaxy XCover5) Adil Hüsrev Tepe
@ 2026-11-16 7:02 ` Adil Hüsrev Tepe
2026-11-16 7:14 ` sashiko-bot
2026-11-16 7:02 ` [PATCH v1 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-11-16 7:02 UTC (permalink / raw)
To: Neil Armstrong, Jessica Zhang, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, dri-devel, devicetree, linux-kernel,
Adil Hüsrev Tepe
Add a binding for MIPI-DSI video-mode panels based on the Novatek
NT36525 controller. The first compatible names the specific panel as
fitted in a device; the second is the NT36525 controller it is based
on. The initial user is the panel in the Samsung Galaxy XCover5
(SM-G525F).
The binding was drafted during XCover5 mainline bring-up with the help
of an AI coding assistant (Claude Code, Anthropic), from a description
of the panel and the stock device tree, and reviewed and validated
(dt_binding_check, yamllint) by me.
Signed-off-by: Adil Hüsrev Tepe <tadilhusrev@gmail.com>
---
.../display/panel/novatek,nt36525.yaml | 71 +++++++++++++++++++
1 file changed, 71 insertions(+)
create mode 100644 Documentation/devicetree/bindings/display/panel/novatek,nt36525.yaml
diff --git a/Documentation/devicetree/bindings/display/panel/novatek,nt36525.yaml b/Documentation/devicetree/bindings/display/panel/novatek,nt36525.yaml
new file mode 100644
index 000000000..5c6e7cce0
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/novatek,nt36525.yaml
@@ -0,0 +1,71 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/panel/novatek,nt36525.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Novatek NT36525 MIPI-DSI panel
+
+maintainers:
+ - Adil Hüsrev Tepe <tadilhusrev@gmail.com>
+
+description:
+ A MIPI-DSI video-mode panel driven by a Novatek NT36525 controller,
+ 720x1480. The first compatible string names the specific panel as fitted
+ in a device; the second is the NT36525 controller it is based on. The
+ panel reset (RESX) is active high in the Samsung Galaxy XCover5 bring-up
+ sequence.
+
+allOf:
+ - $ref: panel-common.yaml#
+
+properties:
+ compatible:
+ items:
+ - enum:
+ - samsung,xcover5-nt36525
+ - const: novatek,nt36525
+
+ reg:
+ maxItems: 1
+ description: DSI virtual channel
+
+ reset-gpios:
+ maxItems: 1
+
+ vdd-supply:
+ description: panel power supply
+
+ port: true
+
+required:
+ - compatible
+ - reg
+ - reset-gpios
+ - vdd-supply
+ - port
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/gpio/gpio.h>
+
+ dsi {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ panel@0 {
+ compatible = "samsung,xcover5-nt36525", "novatek,nt36525";
+ reg = <0>;
+ reset-gpios = <&gpa0 0 GPIO_ACTIVE_HIGH>;
+ vdd-supply = <&panel_vdd>;
+
+ port {
+ panel_in: endpoint {
+ remote-endpoint = <&dsi_out>;
+ };
+ };
+ };
+ };
+...
--
2.53.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v1 2/2] drm/panel: add Novatek NT36525 panel driver
2026-11-16 7:02 [PATCH v1 0/2] drm/panel: add Novatek NT36525 (Samsung Galaxy XCover5) Adil Hüsrev Tepe
2026-11-16 7:02 ` [PATCH v1 1/2] dt-bindings: display: panel: add Novatek NT36525 Adil Hüsrev Tepe
@ 2026-11-16 7:02 ` Adil Hüsrev Tepe
2026-11-16 7:22 ` sashiko-bot
1 sibling, 1 reply; 5+ messages in thread
From: Adil Hüsrev Tepe @ 2026-11-16 7:02 UTC (permalink / raw)
To: Neil Armstrong, Jessica Zhang, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, dri-devel, devicetree, linux-kernel,
Adil Hüsrev Tepe
Add a DRM panel driver for MIPI-DSI video-mode panels based on the
Novatek NT36525 controller, as fitted on the Samsung Galaxy XCover5
(SM-G525F): 720x1480, active-high reset (RESX), and a DCS init
sequence that mirrors the stock Samsung bring-up. Backlight is handled
through the common drm_panel_of_backlight() path.
The driver was developed during XCover5 mainline bring-up with the help
of an AI coding assistant (Claude Code, Anthropic), which converted the
init sequence to mipi_dsi_dcs_write_seq_multi() and drafted the driver
skeleton; I reviewed every line. Tested on a Samsung Galaxy XCover5
running 7.4-rc1 plus this driver: the panel initialises and displays
correctly under phosh.
Signed-off-by: Adil Hüsrev Tepe <tadilhusrev@gmail.com>
---
drivers/gpu/drm/panel/Kconfig | 13 +
drivers/gpu/drm/panel/Makefile | 1 +
drivers/gpu/drm/panel/panel-novatek-nt36525.c | 486 ++++++++++++++++++
3 files changed, 500 insertions(+)
create mode 100644 drivers/gpu/drm/panel/panel-novatek-nt36525.c
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 7a520b4d6..b76b9521f 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 DSI panel for Samsung Galaxy XCover5"
+ depends on GPIOLIB
+ 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 Novatek NT36525
+ 720x1480 MIPI-DSI video-mode panel, such as the one fitted on the
+ Samsung Galaxy XCover5 (SM-G525F). The panel uses an active-high
+ reset and a DCS initialisation sequence that mirrors the stock
+ Samsung bring-up.
+
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 da5175909..46de72db7 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 000000000..246476af4
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-novatek-nt36525.c
@@ -0,0 +1,486 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Novatek NT36525 MIPI DSI panel driver for the Samsung Galaxy XCover5
+ *
+ * Panel timing and the DCS initialisation sequence 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/mod_devicetable.h>
+#include <linux/regulator/consumer.h>
+
+#include <video/mipi_display.h>
+
+#include <drm/drm_mipi_dsi.h>
+#include <drm/drm_modes.h>
+#include <drm/drm_panel.h>
+
+struct nt36525 {
+ struct drm_panel panel;
+ struct mipi_dsi_device *dsi;
+ struct regulator *vdd; /* vdd_ldo28, 1.8 V */
+ struct regulator *vpos; /* LCD positive bias */
+ struct regulator *vneg; /* LCD negative bias */
+ struct gpio_desc *reset_gpio; /* panel RESX, active-high per Samsung */
+};
+
+static inline struct nt36525 *panel_to_nt36525(struct drm_panel *p)
+{
+ return container_of(p, struct nt36525, panel);
+}
+
+/* XCover5 panel timing, exact from Samsung DTS node. 720x1480@60. */
+static const struct drm_display_mode nt36525_xcover5_mode = {
+ .clock = (720 + 128 + 20 + 130) * (1480 + 18 + 2 + 232) * 60 / 1000,
+ .hdisplay = 720,
+ .hsync_start = 720 + 128, /* HFP */
+ .hsync_end = 720 + 128 + 20, /* HSA */
+ .htotal = 720 + 128 + 20 + 130, /* +HBP */
+ .vdisplay = 1480,
+ .vsync_start = 1480 + 18, /* VFP */
+ .vsync_end = 1480 + 18 + 2, /* VSA */
+ .vtotal = 1480 + 18 + 2 + 232, /* +VBP */
+ .width_mm = 59, /* from panel size node */
+ .height_mm = 121,
+ .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,
+};
+
+static int nt36525_on(struct nt36525 *p)
+{
+ struct mipi_dsi_multi_context ctx = { .dsi = p->dsi };
+
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x20);
+ mipi_dsi_msleep(&ctx, 1);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x00, 0x01);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x01, 0x55);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x03, 0x55);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x05, 0xa9);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x07, 0x73);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x08, 0xc1);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x0e, 0x91);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x0f, 0x5f);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x1f, 0x00);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x69, 0xa9);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x94, 0x00);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x95, 0xeb);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x96, 0xeb);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x24);
+ mipi_dsi_msleep(&ctx, 1);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x00, 0x00);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x04, 0x21);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x06, 0x22);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x07, 0x20);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x08, 0x1d);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x0a, 0x0c);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x0b, 0x0d);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x0c, 0x0e);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x0d, 0x0f);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x0f, 0x04);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x10, 0x05);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x12, 0x1e);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x13, 0x1e);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x14, 0x1e);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x16, 0x00);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x1a, 0x21);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x1c, 0x22);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x1d, 0x20);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x1e, 0x1d);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x20, 0x0c);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x21, 0x0d);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x22, 0x0e);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x23, 0x0f);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x25, 0x04);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x26, 0x05);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x28, 0x1e);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x29, 0x1e);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x2a, 0x1e);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x2f, 0x09);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x30, 0x07);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x33, 0x07);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x34, 0x09);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x37, 0x33);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x39, 0x00);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x3a, 0x05);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x3b, 0x94);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x3d, 0x92);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x4d, 0x12);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x4e, 0x34);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x51, 0x43);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x52, 0x21);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x55, 0x86);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x56, 0x34);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x5a, 0x05);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x5b, 0x94);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x5c, 0xc0);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x5d, 0x06);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x5e, 0x0c);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x5f, 0x00);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x60, 0x80);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x61, 0x72);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x64, 0x11);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x82, 0x0a);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x83, 0x0c);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x85, 0x00);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x86, 0x51);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x92, 0xba);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x93, 0x12);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x94, 0x0a);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xab, 0x00);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xac, 0x00);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xad, 0x00);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xaf, 0x04);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x05);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xb1, 0xb5);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x25);
+ mipi_dsi_msleep(&ctx, 1);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x0a, 0x82);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x0b, 0x50);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x0c, 0x01);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x17, 0x82);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x18, 0x06);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x19, 0x0f);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x58, 0x00);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x59, 0x00);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x5a, 0x40);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x5b, 0x80);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x5c, 0x00);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x5d, 0x05);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x5e, 0x94);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x5f, 0x05);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x60, 0x94);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x61, 0x05);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x62, 0x94);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x65, 0x05);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x66, 0xb5);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xc0, 0x03);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xca, 0x1c);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xcc, 0x1c);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xd3, 0x11);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xd4, 0xc8);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xd5, 0x11);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xd6, 0x1c);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xd7, 0x11);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x26);
+ mipi_dsi_msleep(&ctx, 1);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x00, 0xa0);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x27);
+ mipi_dsi_msleep(&ctx, 1);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x13, 0x00);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x15, 0xb4);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x1f, 0x55);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x26, 0x0f);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xc0, 0x18);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xc1, 0xe0);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xc2, 0x00);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xc3, 0x00);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xc4, 0xe0);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xc5, 0x00);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xc6, 0x00);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xc7, 0x03);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x23);
+ mipi_dsi_msleep(&ctx, 1);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x07, 0x20);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x08, 0x10);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x12, 0xa6);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x15, 0xfc);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x16, 0x0b);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x04, 0x00);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x19, 0x00);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x1a, 0x00);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x1b, 0x08);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x1c, 0x0a);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x1d, 0x0c);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x1e, 0x12);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x1f, 0x16);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x20, 0x1a);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x21, 0x1c);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x22, 0x20);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x23, 0x24);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x24, 0x28);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x25, 0x2c);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x26, 0x30);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x27, 0x38);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x28, 0x3c);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x29, 0x10);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x30, 0xff);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x31, 0xff);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x32, 0xfe);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x33, 0xfd);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x34, 0xfd);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x35, 0xfc);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x36, 0xfb);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x37, 0xf9);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x38, 0xf7);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x39, 0xf3);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x3a, 0xea);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x3b, 0xe6);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x3d, 0xe0);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x3f, 0xdd);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x40, 0xdb);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x41, 0xd9);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x20);
+ mipi_dsi_msleep(&ctx, 1);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x00, 0x08, 0x00, 0x18, 0x00, 0x34, 0x00, 0x4c,
+ 0x00, 0x61, 0x00, 0x74, 0x00, 0x86, 0x00, 0x96);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xb1, 0x00, 0xa5, 0x00, 0xdb, 0x01, 0x02, 0x01, 0x43,
+ 0x01, 0x71, 0x01, 0xbd, 0x01, 0xf7, 0x01, 0xfa);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xb2, 0x02, 0x34, 0x02, 0x6f, 0x02, 0x98, 0x02, 0xcc,
+ 0x02, 0xf1, 0x03, 0x1d, 0x03, 0x2d, 0x03, 0x3b);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xb3, 0x03, 0x4d, 0x03, 0x60, 0x03, 0x7a, 0x03, 0x94,
+ 0x03, 0xa6, 0x03, 0xa7);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xb4, 0x00, 0x08, 0x00, 0x18, 0x00, 0x34, 0x00, 0x4c,
+ 0x00, 0x61, 0x00, 0x74, 0x00, 0x86, 0x00, 0x96);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xb5, 0x00, 0xa5, 0x00, 0xdb, 0x01, 0x02, 0x01, 0x43,
+ 0x01, 0x71, 0x01, 0xbd, 0x01, 0xf7, 0x01, 0xfa);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xb6, 0x02, 0x34, 0x02, 0x6f, 0x02, 0x98, 0x02, 0xcc,
+ 0x02, 0xf1, 0x03, 0x1d, 0x03, 0x2d, 0x03, 0x3b);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xb7, 0x03, 0x4d, 0x03, 0x60, 0x03, 0x7a, 0x03, 0x94,
+ 0x03, 0xa6, 0x03, 0xa7);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xb8, 0x00, 0x08, 0x00, 0x18, 0x00, 0x34, 0x00, 0x4c,
+ 0x00, 0x61, 0x00, 0x74, 0x00, 0x86, 0x00, 0x96);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xb9, 0x00, 0xa5, 0x00, 0xdb, 0x01, 0x02, 0x01, 0x43,
+ 0x01, 0x71, 0x01, 0xbd, 0x01, 0xf7, 0x01, 0xfa);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xba, 0x02, 0x34, 0x02, 0x6f, 0x02, 0x98, 0x02, 0xcc,
+ 0x02, 0xf1, 0x03, 0x1d, 0x03, 0x2d, 0x03, 0x3b);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xbb, 0x03, 0x4d, 0x03, 0x60, 0x03, 0x7a, 0x03, 0x94,
+ 0x03, 0xa6, 0x03, 0xa7);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x21);
+ mipi_dsi_msleep(&ctx, 1);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x2c, 0x00, 0x44,
+ 0x00, 0x59, 0x00, 0x6c, 0x00, 0x7e, 0x00, 0x8e);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xb1, 0x00, 0x9d, 0x00, 0xd3, 0x00, 0xfa, 0x01, 0x3b,
+ 0x01, 0x69, 0x01, 0xb5, 0x01, 0xef, 0x01, 0xf2);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xb2, 0x02, 0x2c, 0x02, 0x79, 0x02, 0xaa, 0x02, 0xe6,
+ 0x03, 0x0f, 0x03, 0x3f, 0x03, 0x4f, 0x03, 0x5f);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xb3, 0x03, 0x71, 0x03, 0x86, 0x03, 0xa0, 0x03, 0xbc,
+ 0x03, 0xce, 0x03, 0xd9);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xb4, 0x00, 0x00, 0x00, 0x10, 0x00, 0x2c, 0x00, 0x44,
+ 0x00, 0x59, 0x00, 0x6c, 0x00, 0x7e, 0x00, 0x8e);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xb5, 0x00, 0x9d, 0x00, 0xd3, 0x00, 0xfa, 0x01, 0x3b,
+ 0x01, 0x69, 0x01, 0xb5, 0x01, 0xef, 0x01, 0xf2);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xb6, 0x02, 0x2c, 0x02, 0x79, 0x02, 0xaa, 0x02, 0xe6,
+ 0x03, 0x0f, 0x03, 0x3f, 0x03, 0x4f, 0x03, 0x5f);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xb7, 0x03, 0x71, 0x03, 0x86, 0x03, 0xa0, 0x03, 0xbc,
+ 0x03, 0xce, 0x03, 0xd9);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xb8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x2c, 0x00, 0x44,
+ 0x00, 0x59, 0x00, 0x6c, 0x00, 0x7e, 0x00, 0x8e);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xb9, 0x00, 0x9d, 0x00, 0xd3, 0x00, 0xfa, 0x01, 0x3b,
+ 0x01, 0x69, 0x01, 0xb5, 0x01, 0xef, 0x01, 0xf2);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xba, 0x02, 0x2c, 0x02, 0x79, 0x02, 0xaa, 0x02, 0xe6,
+ 0x03, 0x0f, 0x03, 0x3f, 0x03, 0x4f, 0x03, 0x5f);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xbb, 0x03, 0x71, 0x03, 0x86, 0x03, 0xa0, 0x03, 0xbc,
+ 0x03, 0xce, 0x03, 0xd9);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0xd0);
+ mipi_dsi_msleep(&ctx, 1);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x25, 0xa9);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xff, 0x10);
+ mipi_dsi_msleep(&ctx, 1);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xfb, 0x01);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0xba, 0x02);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x55, 0x01);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x53, 0x2c);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x51, 0x0f, 0xff);
+ mipi_dsi_dcs_write_seq_multi(&ctx, 0x68, 0x00, 0x01);
+ mipi_dsi_dcs_exit_sleep_mode_multi(&ctx);
+ mipi_dsi_msleep(&ctx, 100);
+ mipi_dsi_dcs_set_display_on_multi(&ctx);
+
+ return ctx.accum_err;
+}
+
+static int nt36525_prepare(struct drm_panel *panel)
+{
+ struct nt36525 *p = panel_to_nt36525(panel);
+ int ret;
+
+ /* Power-up sequence from Samsung decon_board_nt36525 panel_power_enable */
+ ret = regulator_enable(p->vdd);
+ if (ret)
+ return ret;
+ usleep_range(1000, 1500);
+ ret = regulator_enable(p->vpos);
+ if (ret)
+ goto disable_vdd;
+ usleep_range(1000, 1500);
+ ret = regulator_enable(p->vneg);
+ if (ret)
+ goto disable_vpos;
+ usleep_range(1000, 1500);
+
+ /* Reset pulse, Samsung sequence from panel_reset */
+ usleep_range(10000, 11000);
+ gpiod_set_value_cansleep(p->reset_gpio, 1);
+ usleep_range(1000, 1500);
+ gpiod_set_value_cansleep(p->reset_gpio, 0);
+ usleep_range(3500, 4000);
+ gpiod_set_value_cansleep(p->reset_gpio, 1);
+ usleep_range(10000, 11000);
+
+ ret = nt36525_on(p);
+ if (ret)
+ goto fail;
+
+ return 0;
+
+fail:
+ gpiod_set_value_cansleep(p->reset_gpio, 0);
+ regulator_disable(p->vneg);
+ usleep_range(1000, 1500);
+disable_vpos:
+ regulator_disable(p->vpos);
+ usleep_range(5000, 5500);
+disable_vdd:
+ regulator_disable(p->vdd);
+ return ret;
+}
+
+static int nt36525_unprepare(struct drm_panel *panel)
+{
+ struct nt36525 *p = panel_to_nt36525(panel);
+ struct mipi_dsi_multi_context ctx = { .dsi = p->dsi };
+
+ mipi_dsi_dcs_set_display_off_multi(&ctx);
+ mipi_dsi_msleep(&ctx, 20);
+ mipi_dsi_dcs_enter_sleep_mode_multi(&ctx);
+ mipi_dsi_msleep(&ctx, 60);
+
+ usleep_range(3000, 3500);
+ regulator_disable(p->vneg);
+ usleep_range(1000, 1500);
+ regulator_disable(p->vpos);
+ usleep_range(5000, 5500);
+ regulator_disable(p->vdd);
+ msleep(30);
+ gpiod_set_value_cansleep(p->reset_gpio, 0);
+ return 0;
+}
+
+static int nt36525_get_modes(struct drm_panel *panel, struct drm_connector *conn)
+{
+ struct drm_display_mode *m;
+
+ m = drm_mode_duplicate(conn->dev, &nt36525_xcover5_mode);
+ if (!m)
+ return -ENOMEM;
+ drm_mode_set_name(m);
+ drm_mode_probed_add(conn, m);
+ conn->display_info.width_mm = m->width_mm;
+ conn->display_info.height_mm = m->height_mm;
+ return 1;
+}
+
+static const struct drm_panel_funcs nt36525_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;
+ struct nt36525 *p;
+ int ret;
+
+ p = devm_drm_panel_alloc(dev, struct nt36525, panel, &nt36525_funcs,
+ DRM_MODE_CONNECTOR_DSI);
+ if (IS_ERR(p))
+ return PTR_ERR(p);
+
+ p->dsi = dsi;
+ ret = drm_panel_of_backlight(&p->panel);
+ if (ret)
+ return ret;
+
+ p->vdd = devm_regulator_get(dev, "vdd");
+ if (IS_ERR(p->vdd))
+ return dev_err_probe(dev, PTR_ERR(p->vdd), "vdd supply\n");
+
+ p->vpos = devm_regulator_get(dev, "vpos");
+ if (IS_ERR(p->vpos))
+ return dev_err_probe(dev, PTR_ERR(p->vpos), "vpos supply\n");
+
+ p->vneg = devm_regulator_get(dev, "vneg");
+ if (IS_ERR(p->vneg))
+ return dev_err_probe(dev, PTR_ERR(p->vneg), "vneg supply\n");
+
+ /*
+ * Request RESX released (high) rather than asserting it here. At probe the
+ * TDDI may still be running the image the bootloader (or a kernel that
+ * kexec'd into this one) left on screen; asserting RESX mid-stream made the
+ * touch half of the chip raise its interrupt before any driver had mapped it.
+ * The real fix for that livelock is in pinctrl-exynos (inherited EINTs are
+ * masked at init); this only avoids resetting a live panel needlessly.
+ * prepare() still performs the full 1-0-1 reset pulse, and vdd_ldo28 is
+ * always-on, so driving RESX high never drives an unpowered chip.
+ */
+ p->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
+ if (IS_ERR(p->reset_gpio))
+ return dev_err_probe(dev, PTR_ERR(p->reset_gpio), "reset gpio\n");
+
+ /* MIPI DSI config from Samsung panel node: 3-lane, video mode, RGB888 */
+ dsi->lanes = 3;
+ dsi->format = MIPI_DSI_FMT_RGB888;
+ /*
+ * MIPI_DSI_MODE_LPM is load-bearing: .prepare sends the DCS init sequence
+ * before the DSIM video stream is running. Without LPM those writes go out
+ * in HS, which blocks waiting for a stream that does not exist yet, so
+ * .prepare never returns and the modeset hangs. In LP mode the init goes
+ * over the low-power escape clock, independent of the video stream.
+ */
+ dsi->mode_flags = MIPI_DSI_MODE_VIDEO /* video (non-burst) */
+ | MIPI_DSI_MODE_VIDEO_SYNC_PULSE
+ | MIPI_DSI_MODE_LPM /* force LP for all transfers */
+ | MIPI_DSI_CLOCK_NON_CONTINUOUS;
+
+ drm_panel_add(&p->panel);
+
+ mipi_dsi_set_drvdata(dsi, p);
+ ret = mipi_dsi_attach(dsi);
+ if (ret) {
+ drm_panel_remove(&p->panel);
+ return dev_err_probe(dev, ret, "failed to attach to DSI host\n");
+ }
+
+ return 0;
+}
+
+static void nt36525_remove(struct mipi_dsi_device *dsi)
+{
+ struct nt36525 *p = mipi_dsi_get_drvdata(dsi);
+
+ mipi_dsi_detach(dsi);
+ drm_panel_remove(&p->panel);
+}
+
+static const struct of_device_id nt36525_of_match[] = {
+ { .compatible = "samsung,xcover5-nt36525" },
+ { }
+};
+MODULE_DEVICE_TABLE(of, nt36525_of_match);
+
+static struct mipi_dsi_driver nt36525_driver = {
+ .probe = nt36525_probe,
+ .remove = nt36525_remove,
+ .driver = {
+ .name = "panel-novatek-nt36525",
+ .of_match_table = nt36525_of_match,
+ },
+};
+module_mipi_dsi_driver(nt36525_driver);
+
+MODULE_DESCRIPTION("Novatek NT36525 panel driver for Samsung Galaxy XCover5");
+MODULE_AUTHOR("Adil Hüsrev Tepe <tadilhusrev@gmail.com>");
+MODULE_LICENSE("GPL");
--
2.53.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v1 1/2] dt-bindings: display: panel: add Novatek NT36525
2026-11-16 7:02 ` [PATCH v1 1/2] dt-bindings: display: panel: add Novatek NT36525 Adil Hüsrev Tepe
@ 2026-11-16 7:14 ` sashiko-bot
0 siblings, 0 replies; 5+ messages in thread
From: sashiko-bot @ 2026-11-16 7:14 UTC (permalink / raw)
To: Adil Hüsrev Tepe; +Cc: dri-devel, devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [Medium] dt-bindings: display: panel: novatek,nt36525: inverted RESX
reset-gpios polarity
- [Medium] dt-bindings: display: panel: novatek,nt36525: missing
vpos-supply and vneg-supply properties
- [Medium] dt-bindings: display: novatek,nt36525: additionalProperties
blocks backlight
--
commit ff4d190494305111a5c1b07276dbb75205cedb54
Author: Adil Hüsrev Tepe <tadilhusrev@gmail.com>
dt-bindings: display: panel: add Novatek NT36525
This commit adds a Device Tree binding schema for MIPI-DSI video-mode
panels based on the Novatek NT36525 controller.
> diff --git a/Documentation/devicetree/bindings/display/panel/novatek,nt36525.yaml b/Documentation/devicetree/bindings/display/panel/novatek,nt36525.yaml
> new file mode 100644
> index 0000000000000..5c6e7cce06411
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/panel/novatek,nt36525.yaml
> @@ -0,0 +1,71 @@
[ ... ]
> +description:
> + A MIPI-DSI video-mode panel driven by a Novatek NT36525 controller,
> + 720x1480. The first compatible string names the specific panel as fitted
> + in a device; the second is the NT36525 controller it is based on. The
> + panel reset (RESX) is active high in the Samsung Galaxy XCover5 bring-up
> + sequence.
> +
> +allOf:
> + - $ref: panel-common.yaml#
> +
> +properties:
> + compatible:
> + items:
> + - enum:
> + - samsung,xcover5-nt36525
> + - const: novatek,nt36525
> +
> + reg:
> + maxItems: 1
> + description: DSI virtual channel
> +
> + reset-gpios:
> + maxItems: 1
> +
> + vdd-supply:
> + description: panel power supply
[Severity: Medium]
Should this binding also declare vpos-supply and vneg-supply?
In commit "drm/panel: add Novatek NT36525 panel driver", nt36525_probe()
requests three separate regulators ("vdd", "vpos", and "vneg") and
nt36525_prepare() sequences all three rails. Without vpos-supply and
vneg-supply in the schema, device tree nodes that provide the positive and
negative analog bias supplies consumed by the driver will fail dtbs_check
validation.
> +
> + port: true
> +
> +required:
> + - compatible
> + - reg
> + - reset-gpios
> + - vdd-supply
> + - port
> +
> +additionalProperties: false
[Severity: Medium]
Does additionalProperties: false reject the backlight property and other
common properties inherited from panel-common.yaml#?
Because additionalProperties: false forbids any property from a referenced
schema that is not re-listed locally, standard properties from
panel-common.yaml# such as backlight cause dtbs_check errors, even though
nt36525_probe() in commit "drm/panel: add Novatek NT36525 panel driver"
parses backlight via drm_panel_of_backlight(). Using
unevaluatedProperties: false instead allows the inherited properties from
panel-common.yaml# and avoids needing to duplicate reset-gpios and port.
> +
> +examples:
> + - |
> + #include <dt-bindings/gpio/gpio.h>
> +
> + dsi {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + panel@0 {
> + compatible = "samsung,xcover5-nt36525", "novatek,nt36525";
> + reg = <0>;
> + reset-gpios = <&gpa0 0 GPIO_ACTIVE_HIGH>;
[Severity: Medium]
Is the reset-gpios polarity inverted in the description and example?
Under panel-common.yaml#, reset-gpios is logically active when asserting
reset. The RESX pin on the NT36525 is physically active-low (asserted low
to reset and driven high to release reset, as shown by the 1-0-1 pulse in
nt36525_prepare() in commit "drm/panel: add Novatek NT36525 panel driver"),
so it should be described as active-low and use GPIO_ACTIVE_LOW.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261116070212.314228-1-tadilhusrev@gmail.com?part=1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1 2/2] drm/panel: add Novatek NT36525 panel driver
2026-11-16 7:02 ` [PATCH v1 2/2] drm/panel: add Novatek NT36525 panel driver Adil Hüsrev Tepe
@ 2026-11-16 7:22 ` sashiko-bot
0 siblings, 0 replies; 5+ messages in thread
From: sashiko-bot @ 2026-11-16 7:22 UTC (permalink / raw)
To: Adil Hüsrev Tepe; +Cc: dri-devel, devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 4 potential
issues to consider:
- [High] drm/panel: missing prepare_prev_first = true in nt36525_probe()
- [Medium] drm/panel: vpos, vneg, and backlight in nt36525_probe()
mismatch DT binding
- [Medium] drm/panel: inverted gpiod logical polarity for reset_gpio in
nt36525
- [Low] drm/panel: negative return and open-coded helper in
nt36525_get_modes()
--
commit bba87e5acae9fff577a4366212e7273dead1f8e4
Author: Adil Hüsrev Tepe <tadilhusrev@gmail.com>
drm/panel: add Novatek NT36525 panel driver
This commit adds a DRM panel driver for Novatek NT36525-based MIPI-DSI
video-mode panels used in the Samsung Galaxy XCover5.
> 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..246476af49b15
> --- /dev/null
> +++ b/drivers/gpu/drm/panel/panel-novatek-nt36525.c
[ ... ]
> +static int nt36525_prepare(struct drm_panel *panel)
> +{
> + struct nt36525 *p = panel_to_nt36525(panel);
> + int ret;
> +
> + /* Power-up sequence from Samsung decon_board_nt36525 panel_power_enable */
> + ret = regulator_enable(p->vdd);
> + if (ret)
> + return ret;
> + usleep_range(1000, 1500);
> + ret = regulator_enable(p->vpos);
> + if (ret)
> + goto disable_vdd;
> + usleep_range(1000, 1500);
> + ret = regulator_enable(p->vneg);
> + if (ret)
> + goto disable_vpos;
> + usleep_range(1000, 1500);
> +
> + /* Reset pulse, Samsung sequence from panel_reset */
> + usleep_range(10000, 11000);
> + gpiod_set_value_cansleep(p->reset_gpio, 1);
> + usleep_range(1000, 1500);
> + gpiod_set_value_cansleep(p->reset_gpio, 0);
> + usleep_range(3500, 4000);
> + gpiod_set_value_cansleep(p->reset_gpio, 1);
> + usleep_range(10000, 11000);
> +
> + ret = nt36525_on(p);
> + if (ret)
> + goto fail;
> +
> + return 0;
> +
> +fail:
> + gpiod_set_value_cansleep(p->reset_gpio, 0);
> + regulator_disable(p->vneg);
> + usleep_range(1000, 1500);
> +disable_vpos:
> + regulator_disable(p->vpos);
> + usleep_range(5000, 5500);
> +disable_vdd:
> + regulator_disable(p->vdd);
> + return ret;
> +}
> +
> +static int nt36525_unprepare(struct drm_panel *panel)
> +{
> + struct nt36525 *p = panel_to_nt36525(panel);
> + struct mipi_dsi_multi_context ctx = { .dsi = p->dsi };
> +
> + mipi_dsi_dcs_set_display_off_multi(&ctx);
> + mipi_dsi_msleep(&ctx, 20);
> + mipi_dsi_dcs_enter_sleep_mode_multi(&ctx);
> + mipi_dsi_msleep(&ctx, 60);
> +
> + usleep_range(3000, 3500);
> + regulator_disable(p->vneg);
> + usleep_range(1000, 1500);
> + regulator_disable(p->vpos);
> + usleep_range(5000, 5500);
> + regulator_disable(p->vdd);
> + msleep(30);
> + gpiod_set_value_cansleep(p->reset_gpio, 0);
> + return 0;
> +}
[Severity: Medium]
Are the gpiod logical states for p->reset_gpio inverted across
nt36525_prepare(), nt36525_unprepare(), and nt36525_probe()?
As noted in the comment in nt36525_probe() ("Request RESX released (high)
rather than asserting it here"), the hardware RESX pin is active-low
(physical 0 asserts reset, physical 1 releases it). Under the gpiod API
and panel-common.yaml, logical 1 (GPIOD_OUT_HIGH) means reset asserted and
logical 0 (GPIOD_OUT_LOW) means reset deasserted, with the physical
inversion described via GPIO_ACTIVE_LOW in Device Tree.
Passing physical levels directly means a Device Tree using standard
GPIO_ACTIVE_LOW polarity holds the panel in reset during nt36525_on() and
releases reset when powering off, or else has to misdeclare the active-low
pin as GPIO_ACTIVE_HIGH.
> +static int nt36525_get_modes(struct drm_panel *panel, struct drm_connector *conn)
> +{
> + struct drm_display_mode *m;
> +
> + m = drm_mode_duplicate(conn->dev, &nt36525_xcover5_mode);
> + if (!m)
> + return -ENOMEM;
> + drm_mode_set_name(m);
> + drm_mode_probed_add(conn, m);
> + conn->display_info.width_mm = m->width_mm;
> + conn->display_info.height_mm = m->height_mm;
> + return 1;
> +}
[Severity: Low]
Can nt36525_get_modes() use drm_connector_helper_get_modes_fixed(conn,
&nt36525_xcover5_mode) instead of open-coding mode duplication?
drm_helper_probe_get_modes() expects .get_modes() callbacks to return the
number of modes (0 on failure) and logs a drm_err() if a negative error
code such as -ENOMEM is returned. drm_connector_helper_get_modes_fixed()
handles duplicating the mode, setting its name, updating display_info
dimensions, and returning 0 on failure.
[ ... ]
> +static int nt36525_probe(struct mipi_dsi_device *dsi)
> +{
> + struct device *dev = &dsi->dev;
> + struct nt36525 *p;
> + int ret;
> +
> + p = devm_drm_panel_alloc(dev, struct nt36525, panel, &nt36525_funcs,
> + DRM_MODE_CONNECTOR_DSI);
> + if (IS_ERR(p))
> + return PTR_ERR(p);
> +
> + p->dsi = dsi;
> + ret = drm_panel_of_backlight(&p->panel);
> + if (ret)
> + return ret;
> +
> + p->vdd = devm_regulator_get(dev, "vdd");
> + if (IS_ERR(p->vdd))
> + return dev_err_probe(dev, PTR_ERR(p->vdd), "vdd supply\n");
> +
> + p->vpos = devm_regulator_get(dev, "vpos");
> + if (IS_ERR(p->vpos))
> + return dev_err_probe(dev, PTR_ERR(p->vpos), "vpos supply\n");
> +
> + p->vneg = devm_regulator_get(dev, "vneg");
> + if (IS_ERR(p->vneg))
> + return dev_err_probe(dev, PTR_ERR(p->vneg), "vneg supply\n");
[Severity: Medium]
Do the vpos, vneg, and backlight properties requested here match the DT
binding in Documentation/devicetree/bindings/display/panel/novatek,nt36525.yaml?
The binding schema only defines compatible, reg, reset-gpios, vdd-supply,
and port with additionalProperties: false. A Device Tree conforming to
that schema will lack vpos-supply, vneg-supply, and backlight, causing
devm_regulator_get() to fall back to dummy regulators with a warning
(leaving the positive and negative LCD bias supplies unswitched) and
drm_panel_of_backlight() to find no backlight, while a Device Tree that
includes them will fail dtbs_check.
[ ... ]
> + dsi->mode_flags = MIPI_DSI_MODE_VIDEO /* video (non-burst) */
> + | MIPI_DSI_MODE_VIDEO_SYNC_PULSE
> + | MIPI_DSI_MODE_LPM /* force LP for all transfers */
> + | MIPI_DSI_CLOCK_NON_CONTINUOUS;
> +
> + drm_panel_add(&p->panel);
[Severity: High]
Should p->panel.prepare_prev_first = true be set before calling
drm_panel_add(&p->panel)?
drm_panel_add() copies panel->prepare_prev_first into
panel->bridge.pre_enable_prev_first. Because it is left false,
drm_atomic_bridge_chain_pre_enable() calls nt36525_prepare() ->
nt36525_on() before the upstream DSI host bridge's atomic_pre_enable()
callback, and drm_atomic_bridge_chain_post_disable() disables the upstream
DSI host bridge before nt36525_unprepare() sends display-off and sleep-in
commands. On bridge-based DSI hosts such as samsung-dsim, transfers sent
while DSIM_STATE_ENABLED is cleared are rejected by
samsung_dsim_host_transfer() with -EINVAL, causing panel bring-up and
power-down to fail.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261116070212.314228-1-tadilhusrev@gmail.com?part=2
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-11-16 9:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-16 7:02 [PATCH v1 0/2] drm/panel: add Novatek NT36525 (Samsung Galaxy XCover5) Adil Hüsrev Tepe
2026-11-16 7:02 ` [PATCH v1 1/2] dt-bindings: display: panel: add Novatek NT36525 Adil Hüsrev Tepe
2026-11-16 7:14 ` sashiko-bot
2026-11-16 7:02 ` [PATCH v1 2/2] drm/panel: add Novatek NT36525 panel driver Adil Hüsrev Tepe
2026-11-16 7:22 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox