* [PATCH v2 0/2] drm/panel: Add Novatek NT36536 panel driver
@ 2026-07-05 15:35 Pengyu Luo
2026-07-05 15:35 ` [PATCH v2 1/2] dt-bindings: display: panel: Add Novatek NT36536 Pengyu Luo
2026-07-05 15:35 ` [PATCH v2 2/2] drm/panel: Add Novatek NT36536 panel driver Pengyu Luo
0 siblings, 2 replies; 6+ messages in thread
From: Pengyu Luo @ 2026-07-05 15:35 UTC (permalink / raw)
To: Neil Armstrong, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: dri-devel, devicetree, linux-kernel, Pengyu Luo
Add a driver for panels using the Novatek NT36536 Display Driver IC,
including support for the CSOT PP8807HB1-1, a dual-link 10-bit panel
found in LENOVO Legion Y700 Gen4.
Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
---
Changes in v2:
- Collect tags
- Mention the CSOT PP8807HB1-1 is a dual-link panel (Krzysztof)
- Use devm_drm_panel_add() (Neil)
- Link to v1: https://lore.kernel.org/dri-devel/20260630023439.248861-1-mitltlatltl@gmail.com
Pengyu Luo (2):
dt-bindings: display: panel: Add Novatek NT36536
drm/panel: Add Novatek NT36536 panel driver
.../display/panel/novatek,nt36536.yaml | 91 ++++
drivers/gpu/drm/panel/Kconfig | 11 +
drivers/gpu/drm/panel/Makefile | 1 +
drivers/gpu/drm/panel/panel-novatek-nt36536.c | 488 ++++++++++++++++++
4 files changed, 591 insertions(+)
create mode 100644 Documentation/devicetree/bindings/display/panel/novatek,nt36536.yaml
create mode 100644 drivers/gpu/drm/panel/panel-novatek-nt36536.c
--
2.54.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/2] dt-bindings: display: panel: Add Novatek NT36536
2026-07-05 15:35 [PATCH v2 0/2] drm/panel: Add Novatek NT36536 panel driver Pengyu Luo
@ 2026-07-05 15:35 ` Pengyu Luo
2026-07-05 15:44 ` sashiko-bot
2026-07-05 15:35 ` [PATCH v2 2/2] drm/panel: Add Novatek NT36536 panel driver Pengyu Luo
1 sibling, 1 reply; 6+ messages in thread
From: Pengyu Luo @ 2026-07-05 15:35 UTC (permalink / raw)
To: Neil Armstrong, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: dri-devel, devicetree, linux-kernel, Pengyu Luo,
Krzysztof Kozlowski
NT36536 is a driver IC used to drive MIPI-DSI panels. It is found in
LENOVO Legion Y700 Gen4 with a dual-link 10-bit CSOT panel.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
---
v2:
- Collect tags
- Mention the CSOT PP8807HB1-1 is a dual-link panel (Krzysztof)
---
.../display/panel/novatek,nt36536.yaml | 91 +++++++++++++++++++
1 file changed, 91 insertions(+)
create mode 100644 Documentation/devicetree/bindings/display/panel/novatek,nt36536.yaml
diff --git a/Documentation/devicetree/bindings/display/panel/novatek,nt36536.yaml b/Documentation/devicetree/bindings/display/panel/novatek,nt36536.yaml
new file mode 100644
index 000000000000..0862998cc6ef
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/novatek,nt36536.yaml
@@ -0,0 +1,91 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/panel/novatek,nt36536.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Novatek NT36536 based DSI display Panels
+
+maintainers:
+ - Pengyu Luo <mitltlatltl@gmail.com>
+
+description:
+ The Novatek NT36536 is a generic DSI Panel IC used to drive dsi
+ panels. Support video mode panels from China Star Optoelectronics
+ Technology (CSOT), such as PP8807HB1-1 which is a dual-link 10-bit
+ panel.
+
+allOf:
+ - $ref: panel-common-dual.yaml#
+
+properties:
+ compatible:
+ items:
+ - enum:
+ - csot,pp8807hb1-1
+ - const: novatek,nt36536
+
+ reg:
+ maxItems: 1
+
+ reset-gpios:
+ maxItems: 1
+
+ vddio-supply:
+ description: I/O source voltage rail
+
+ vsp-supply:
+ description: Positive source voltage rail
+
+ vsn-supply:
+ description: Negative source voltage rail
+
+ backlight: true
+ ports: true
+
+required:
+ - compatible
+ - reg
+ - vddio-supply
+ - reset-gpios
+ - ports
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/gpio/gpio.h>
+
+ dsi {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ panel@0 {
+ compatible = "csot,pp8807hb1-1", "novatek,nt36536";
+ reg = <0>;
+
+ vddio-supply = <&vreg_iovdd_1p8>;
+ reset-gpios = <&tlmm 98 GPIO_ACTIVE_LOW>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ panel_in_0: endpoint {
+ remote-endpoint = <&dsi0_out>;
+ };
+ };
+
+ port@1{
+ reg = <1>;
+ panel_in_1: endpoint {
+ remote-endpoint = <&dsi1_out>;
+ };
+ };
+ };
+ };
+ };
+
+...
--
2.54.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/2] drm/panel: Add Novatek NT36536 panel driver
2026-07-05 15:35 [PATCH v2 0/2] drm/panel: Add Novatek NT36536 panel driver Pengyu Luo
2026-07-05 15:35 ` [PATCH v2 1/2] dt-bindings: display: panel: Add Novatek NT36536 Pengyu Luo
@ 2026-07-05 15:35 ` Pengyu Luo
2026-07-05 15:47 ` sashiko-bot
2026-07-06 17:15 ` Uwe Kleine-König
1 sibling, 2 replies; 6+ messages in thread
From: Pengyu Luo @ 2026-07-05 15:35 UTC (permalink / raw)
To: Neil Armstrong, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: dri-devel, devicetree, linux-kernel, Pengyu Luo
Add a driver for panels using the Novatek NT36536 Display Driver IC,
including support for the CSOT PP8807HB1-1, a dual-link 10-bit panel
found in LENOVO Legion Y700 Gen4.
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
---
v2:
- Collect tags
- Use devm_drm_panel_add() (Neil)
---
drivers/gpu/drm/panel/Kconfig | 11 +
drivers/gpu/drm/panel/Makefile | 1 +
drivers/gpu/drm/panel/panel-novatek-nt36536.c | 488 ++++++++++++++++++
3 files changed, 500 insertions(+)
create mode 100644 drivers/gpu/drm/panel/panel-novatek-nt36536.c
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index cfbfb371bc67..53c0b95c26ca 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -662,6 +662,17 @@ 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_NT36536
+ tristate "Novatek NT36536 panel driver"
+ depends on OF
+ depends on DRM_MIPI_DSI
+ depends on BACKLIGHT_CLASS_DEVICE
+ select DRM_KMS_HELPER
+ help
+ Say Y here if you want to enable support for Novatek NT36536-based
+ display panels, such as the one found in the LENOVO Legion Y700
+ Gen4.
+
config DRM_PANEL_NOVATEK_NT36672A
tristate "Novatek NT36672A DSI panel"
depends on GPIOLIB
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 0f29f22f589e..3b523cf37833 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -64,6 +64,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_NT36536) += panel-novatek-nt36536.o
obj-$(CONFIG_DRM_PANEL_NOVATEK_NT36672A) += panel-novatek-nt36672a.o
obj-$(CONFIG_DRM_PANEL_NOVATEK_NT36672E) += panel-novatek-nt36672e.o
obj-$(CONFIG_DRM_PANEL_NOVATEK_NT37700F) += panel-novatek-nt37700f.o
diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36536.c b/drivers/gpu/drm/panel/panel-novatek-nt36536.c
new file mode 100644
index 000000000000..961bfc605b1a
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-novatek-nt36536.c
@@ -0,0 +1,488 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Novatek NT36536 DriverIC panels driver
+ * Copyright (c) 2026 Pengyu Luo <mitltlatltl@gmail.com>
+ *
+ * Based on the sample code which is generated with
+ * linux-mdss-dsi-panel-driver-generator
+ */
+
+#include <linux/backlight.h>
+#include <linux/delay.h>
+#include <linux/gpio/consumer.h>
+#include <linux/mod_devicetable.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_graph.h>
+#include <linux/regulator/consumer.h>
+
+#include <drm/display/drm_dsc.h>
+#include <drm/display/drm_dsc_helper.h>
+#include <drm/drm_mipi_dsi.h>
+#include <drm/drm_modes.h>
+#include <drm/drm_panel.h>
+#include <drm/drm_probe_helper.h>
+
+#include <video/mipi_display.h>
+
+struct novatek {
+ struct drm_panel panel;
+ struct mipi_dsi_device *dsi[2];
+ const struct panel_desc *desc;
+ struct drm_dsc_config dsc;
+ struct gpio_desc *reset_gpio;
+ struct regulator_bulk_data *supplies;
+ struct backlight_device *backlight;
+};
+
+struct panel_desc {
+ unsigned int width_mm;
+ unsigned int height_mm;
+ unsigned int bpc;
+ unsigned int lanes;
+ enum mipi_dsi_pixel_format format;
+ unsigned long mode_flags;
+ const struct drm_dsc_config *dsc_cfg;
+ const struct drm_display_mode *modes;
+ unsigned int num_modes;
+
+ int (*init_sequence)(struct mipi_dsi_multi_context *dsi_ctx);
+
+ bool is_dual_dsi;
+ bool has_dcs_backlight;
+};
+
+static const struct regulator_bulk_data novatek_supplies[] = {
+ { .supply = "vddio" },
+ { .supply = "vsp" },
+ { .supply = "vsn" },
+};
+
+static inline struct novatek *to_novatek(struct drm_panel *panel)
+{
+ return container_of(panel, struct novatek, panel);
+}
+
+static inline struct mipi_dsi_device *to_primary_dsi(struct novatek *ctx)
+{
+ /* Sync on DSI1 for dual dsi */
+ return ctx->desc->is_dual_dsi ? ctx->dsi[1] : ctx->dsi[0];
+}
+
+static void novatek_reset(struct novatek *ctx)
+{
+ gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+ usleep_range(11000, 12000);
+ gpiod_set_value_cansleep(ctx->reset_gpio, 0);
+ usleep_range(1000, 2000);
+ gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+ usleep_range(3000, 4000);
+ gpiod_set_value_cansleep(ctx->reset_gpio, 0);
+ usleep_range(10000, 11000);
+}
+
+static int novatek_prepare(struct drm_panel *panel)
+{
+ struct novatek *ctx = to_novatek(panel);
+ struct mipi_dsi_device *dsi = to_primary_dsi(ctx);
+ struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
+ struct drm_dsc_picture_parameter_set pps;
+ struct device *dev = &dsi->dev;
+ int ret;
+
+ ret = regulator_bulk_enable(ARRAY_SIZE(novatek_supplies),
+ ctx->supplies);
+ if (ret < 0)
+ return ret;
+
+ novatek_reset(ctx);
+
+ ret = ctx->desc->init_sequence(&dsi_ctx);
+ if (ret < 0) {
+ dev_err(dev, "Failed to initialize panel: %d\n", ret);
+ gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+ regulator_bulk_disable(ARRAY_SIZE(novatek_supplies),
+ ctx->supplies);
+ return ret;
+ }
+
+ drm_dsc_pps_payload_pack(&pps, &ctx->dsc);
+ mipi_dsi_picture_parameter_set_multi(&dsi_ctx, &pps);
+ mipi_dsi_compression_mode_multi(&dsi_ctx, true);
+ mipi_dsi_msleep(&dsi_ctx, 28);
+
+ return backlight_enable(ctx->backlight);
+}
+
+static int novatek_off(struct mipi_dsi_multi_context *dsi_ctx)
+{
+ mipi_dsi_dcs_set_display_off_multi(dsi_ctx);
+ mipi_dsi_dcs_enter_sleep_mode_multi(dsi_ctx);
+
+ return dsi_ctx->accum_err;
+}
+
+static int novatek_unprepare(struct drm_panel *panel)
+{
+ struct novatek *ctx = to_novatek(panel);
+ struct mipi_dsi_device *dsi = to_primary_dsi(ctx);
+ struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
+ struct device *dev = &dsi->dev;
+ int ret;
+
+ backlight_disable(ctx->backlight);
+
+ ret = novatek_off(&dsi_ctx);
+ if (ret < 0)
+ dev_err(dev, "Failed to un-initialize panel: %d\n", ret);
+
+ gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+ regulator_bulk_disable(ARRAY_SIZE(novatek_supplies), ctx->supplies);
+
+ return 0;
+}
+
+static int novatek_get_modes(struct drm_panel *panel,
+ struct drm_connector *connector)
+{
+ struct novatek *ctx = to_novatek(panel);
+ const struct panel_desc *desc = ctx->desc;
+ int i;
+
+ for (i = 0; i < desc->num_modes; i++) {
+ const struct drm_display_mode *m = &desc->modes[i];
+ struct drm_display_mode *mode;
+
+ mode = drm_mode_duplicate(connector->dev, m);
+ if (!mode) {
+ dev_err(panel->dev, "failed to add mode %ux%u@%u\n",
+ m->hdisplay, m->vdisplay, drm_mode_vrefresh(m));
+ return -ENOMEM;
+ }
+
+ mode->type = DRM_MODE_TYPE_DRIVER;
+ if (i == 0)
+ mode->type |= DRM_MODE_TYPE_PREFERRED;
+
+ drm_mode_set_name(mode);
+ drm_mode_probed_add(connector, mode);
+ }
+
+ connector->display_info.width_mm = desc->width_mm;
+ connector->display_info.height_mm = desc->height_mm;
+ connector->display_info.bpc = desc->bpc;
+
+ return desc->num_modes;
+}
+
+static const struct drm_panel_funcs novatek_panel_funcs = {
+ .prepare = novatek_prepare,
+ .unprepare = novatek_unprepare,
+ .get_modes = novatek_get_modes,
+};
+
+static int novatek_bl_update_status(struct backlight_device *bl)
+{
+ struct novatek *ctx = bl_get_data(bl);
+ u16 brightness = backlight_get_brightness(bl);
+
+ return mipi_dsi_dcs_set_display_brightness_large(to_primary_dsi(ctx),
+ brightness);
+}
+
+static const struct backlight_ops novatek_bl_ops = {
+ .update_status = novatek_bl_update_status,
+};
+
+static struct backlight_device *novatek_create_backlight(struct novatek *ctx)
+{
+ struct mipi_dsi_device *dsi = to_primary_dsi(ctx);
+ struct device *dev = &dsi->dev;
+ const struct backlight_properties props = {
+ .type = BACKLIGHT_RAW,
+ .brightness = 512,
+ .max_brightness = 4095,
+ .scale = BACKLIGHT_SCALE_NON_LINEAR,
+ };
+
+ return devm_backlight_device_register(dev, dev_name(dev), dev, ctx,
+ &novatek_bl_ops, &props);
+}
+
+static int csot_pp8807hb1_1_init_seq(struct mipi_dsi_multi_context *dsi_ctx)
+{
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xff, 0x20);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xfb, 0x01);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, MIPI_DCS_SET_PARTIAL_ROWS, 0x50);
+
+ /* cabc */
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xff, 0x23);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xfb, 0x01);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x89, 0xa4);
+
+ /* pen code */
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xff, 0x26);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xfb, 0x01);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xcd, 0x8f, 0xa9, 0x00);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xce, 0x8c, 0xa9, 0x00);
+
+ /* esd init */
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xff, 0x27);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xfb, 0x01);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x79, 0x22);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xd0, 0x31);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xd1, 0x08, 0x08);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xd2, 0x08);
+
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xff, 0xd0);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xfb, 0x01);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x00, 0x31);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x09, 0xee);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x1c, 0x77);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x1d, 0x07);
+
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xff, 0xe0);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xfb, 0x01);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xbb, 0x00);
+
+ /* IC transfer */
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xff, 0xf0);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xfb, 0x01);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xe6, 0x02);
+
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xff, 0x10);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xfb, 0x01);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x3b,
+ 0x03, 0x4e, 0x1a, 0x04, 0x04, 0x01, 0x80,
+ 0x36, 0x36);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x60, 0x00);
+ /* enable DSC */
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x90, 0x03, 0x00);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x91,
+ 0xab, 0xa8, 0x00, 0x14, 0xd2, 0x00, 0x00,
+ 0x00, 0x01, 0xb9, 0x00, 0x06, 0x05, 0x7a,
+ 0x05, 0xb8);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0x92, 0x10, 0xe0);
+ /* frame ctl */
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xb2, 0x91, 0x80);
+ mipi_dsi_dcs_write_seq_multi(dsi_ctx, 0xb3, 0x40);
+ mipi_dsi_dcs_exit_sleep_mode_multi(dsi_ctx);
+ mipi_dsi_msleep(dsi_ctx, 105);
+ mipi_dsi_dcs_set_display_on_multi(dsi_ctx);
+ mipi_dsi_msleep(dsi_ctx, 40);
+
+ return dsi_ctx->accum_err;
+}
+
+static struct drm_dsc_config csot_pp8807hb1_1_dsc_cfg = {
+ .dsc_version_major = 1,
+ .dsc_version_minor = 2,
+ .slice_height = 20,
+ .slice_width = 476,
+ .slice_count = 2,
+ .bits_per_component = 10,
+ .bits_per_pixel = 8 << 4,
+ .block_pred_enable = true,
+};
+
+static const struct drm_display_mode csot_pp8807hb1_1_modes[] = {
+ /* 915552 KHz */
+ {
+ .clock = (952 + 138 + 16 + 16) * 2 * (3040 + 26 + 4 + 330) * 120 / 1000,
+ .hdisplay = 952 * 2,
+ .hsync_start = (952 + 138) * 2,
+ .hsync_end = (952 + 138 + 16) * 2,
+ .htotal = (952 + 138 + 16 + 16) * 2,
+ .vdisplay = 3040,
+ .vsync_start = 3040 + 26,
+ .vsync_end = 3040 + 26 + 4,
+ .vtotal = 3040 + 26 + 4 + 330,
+ },
+ {
+ .clock = (952 + 138 + 16 + 16) * 2 * (3040 + 3426 + 4 + 330) * 60 / 1000,
+ .hdisplay = 952 * 2,
+ .hsync_start = (952 + 138) * 2,
+ .hsync_end = (952 + 138 + 16) * 2,
+ .htotal = (952 + 138 + 16 + 16) * 2,
+ .vdisplay = 3040,
+ .vsync_start = 3040 + 3426,
+ .vsync_end = 3040 + 3426 + 4,
+ .vtotal = 3040 + 3426 + 4 + 330,
+ },
+ {
+ .clock = (952 + 138 + 16 + 16) * 2 * (3040 + 10226 + 4 + 330) * 30 / 1000,
+ .hdisplay = 952 * 2,
+ .hsync_start = (952 + 138) * 2,
+ .hsync_end = (952 + 138 + 16) * 2,
+ .htotal = (952 + 138 + 16 + 16) * 2,
+ .vdisplay = 3040,
+ .vsync_start = 3040 + 10226,
+ .vsync_end = 3040 + 10226 + 4,
+ .vtotal = 3040 + 10226 + 4 + 330,
+ },
+ /* 1064606.4 KHz */
+ {
+ .clock = (952 + 50 + 16 + 16) * 2 * (3040 + 26 + 4 + 50) * 165 / 1000,
+ .hdisplay = 952 * 2,
+ .hsync_start = (952 + 50) * 2,
+ .hsync_end = (952 + 50 + 16) * 2,
+ .htotal = (952 + 50 + 16 + 16) * 2,
+ .vdisplay = 3040,
+ .vsync_start = 3040 + 26,
+ .vsync_end = 3040 + 26 + 4,
+ .vtotal = 3040 + 26 + 4 + 50,
+ },
+ {
+ .clock = (952 + 50 + 16 + 16) * 2 * (3040 + 481 + 4 + 50) * 144 / 1000,
+ .hdisplay = 952 * 2,
+ .hsync_start = (952 + 50) * 2,
+ .hsync_end = (952 + 50 + 16) * 2,
+ .htotal = (952 + 50 + 16 + 16) * 2,
+ .vdisplay = 3040,
+ .vsync_start = 3040 + 481,
+ .vsync_end = 3040 + 481 + 4,
+ .vtotal = 3040 + 481 + 4 + 50,
+ },
+ /* 737942.4 KHz */
+ {
+ .clock = (952 + 330 + 16 + 16) * 2 * (3040 + 26 + 4 + 50) * 90 / 1000,
+ .hdisplay = 952 * 2,
+ .hsync_start = (952 + 330) * 2,
+ .hsync_end = (952 + 330 + 16) * 2,
+ .htotal = (952 + 330 + 16 + 16) * 2,
+ .vdisplay = 3040,
+ .vsync_start = 3040 + 26,
+ .vsync_end = 3040 + 26 + 4,
+ .vtotal = 3040 + 26 + 4 + 50,
+ },
+};
+
+static int novatek_probe(struct mipi_dsi_device *dsi)
+{
+ struct mipi_dsi_device_info dsi_info = {"dsi-secondary", 0, NULL};
+ struct mipi_dsi_host *dsi1_host;
+ struct device *dev = &dsi->dev;
+ const struct panel_desc *desc;
+ struct device_node *dsi1;
+ struct novatek *ctx;
+ int num_dsi = 1;
+ int ret, i;
+
+ ctx = devm_drm_panel_alloc(dev, struct novatek, panel,
+ &novatek_panel_funcs,
+ DRM_MODE_CONNECTOR_DSI);
+ if (IS_ERR(ctx))
+ return PTR_ERR(ctx);
+
+ ret = devm_regulator_bulk_get_const(dev, ARRAY_SIZE(novatek_supplies),
+ novatek_supplies, &ctx->supplies);
+ if (ret < 0)
+ return ret;
+
+ ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
+ if (IS_ERR(ctx->reset_gpio))
+ return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
+ "Failed to get reset-gpios\n");
+
+ desc = of_device_get_match_data(dev);
+ if (!desc)
+ return -ENODEV;
+ ctx->desc = desc;
+ ctx->dsc = *desc->dsc_cfg;
+
+ if (desc->is_dual_dsi) {
+ num_dsi = 2;
+ dsi1 = of_graph_get_remote_node(dsi->dev.of_node, 1, -1);
+ if (!dsi1) {
+ dev_err(dev, "cannot get secondary DSI node.\n");
+ return -ENODEV;
+ }
+
+ dsi1_host = of_find_mipi_dsi_host_by_node(dsi1);
+ of_node_put(dsi1);
+ if (!dsi1_host)
+ return dev_err_probe(dev, -EPROBE_DEFER,
+ "cannot get secondary DSI host\n");
+
+ ctx->dsi[1] = devm_mipi_dsi_device_register_full(dev, dsi1_host,
+ &dsi_info);
+ if (IS_ERR(ctx->dsi[1])) {
+ dev_err(dev, "cannot get secondary DSI device\n");
+ return PTR_ERR(ctx->dsi[1]);
+ }
+
+ mipi_dsi_set_drvdata(ctx->dsi[1], ctx);
+ }
+
+ ctx->dsi[0] = dsi;
+ mipi_dsi_set_drvdata(dsi, ctx);
+
+ ctx->panel.prepare_prev_first = true;
+
+ ret = devm_drm_panel_add(dev, &ctx->panel);
+ if (ret < 0)
+ return dev_err_probe(dev, ret, "failed to add panel\n");
+
+ for (i = 0; i < num_dsi; i++) {
+ ctx->dsi[i]->lanes = desc->lanes;
+ ctx->dsi[i]->format = desc->format;
+ ctx->dsi[i]->mode_flags = desc->mode_flags;
+ ctx->dsi[i]->dsc = &ctx->dsc;
+ ret = devm_mipi_dsi_attach(dev, ctx->dsi[i]);
+ if (ret < 0) {
+ drm_panel_remove(&ctx->panel);
+ return dev_err_probe(dev, ret,
+ "Failed to attach to DSI host\n");
+ }
+ }
+
+ if (desc->has_dcs_backlight) {
+ ctx->backlight = novatek_create_backlight(ctx);
+ if (IS_ERR(ctx->backlight))
+ return dev_err_probe(dev, PTR_ERR(ctx->backlight),
+ "Failed to create backlight\n");
+ } else {
+ ret = drm_panel_of_backlight(&ctx->panel);
+ if (ret)
+ return dev_err_probe(dev, ret, "Failed to get backlight\n");
+ }
+
+ return 0;
+}
+
+/* Model name: CSOT PP8807HB1-1 */
+static const struct panel_desc csot_pp8807hb1_1_desc = {
+ .width_mm = 118,
+ .height_mm = 190,
+ .bpc = 10, /* set this to 8 with RGB888 format to support 8-bit mode */
+ .lanes = 3,
+ .format = MIPI_DSI_FMT_RGB101010,
+ .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS |
+ MIPI_DSI_MODE_NO_EOT_PACKET | MIPI_DSI_MODE_VIDEO_BURST |
+ MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_DSC_ALL_SLICES_IN_PKT,
+ .dsc_cfg = &csot_pp8807hb1_1_dsc_cfg,
+ .modes = csot_pp8807hb1_1_modes,
+ .num_modes = ARRAY_SIZE(csot_pp8807hb1_1_modes),
+ .init_sequence = csot_pp8807hb1_1_init_seq,
+ .is_dual_dsi = true,
+ .has_dcs_backlight = false,
+};
+
+static const struct of_device_id novatek_of_match[] = {
+ { .compatible = "csot,pp8807hb1-1", .data = &csot_pp8807hb1_1_desc },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, novatek_of_match);
+
+static struct mipi_dsi_driver novatek_driver = {
+ .probe = novatek_probe,
+ .driver = {
+ .name = "panel-novatek-nt36536",
+ .of_match_table = novatek_of_match,
+ },
+};
+module_mipi_dsi_driver(novatek_driver);
+
+MODULE_AUTHOR("Pengyu Luo <mitltlatltl@gmail.com>");
+MODULE_DESCRIPTION("Novatek NT36536 DriverIC panels driver");
+MODULE_LICENSE("GPL");
--
2.54.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: display: panel: Add Novatek NT36536
2026-07-05 15:35 ` [PATCH v2 1/2] dt-bindings: display: panel: Add Novatek NT36536 Pengyu Luo
@ 2026-07-05 15:44 ` sashiko-bot
0 siblings, 0 replies; 6+ messages in thread
From: sashiko-bot @ 2026-07-05 15:44 UTC (permalink / raw)
To: Pengyu Luo; +Cc: robh, dri-devel, conor+dt, devicetree
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Incorrect use of `additionalProperties: false` instead of `unevaluatedProperties: false` in a schema containing an `allOf` reference.
--
commit 40b975ec362c58607cb7c58d87a808388df1aa11
Author: Pengyu Luo <mitltlatltl@gmail.com>
dt-bindings: display: panel: Add Novatek NT36536
This commit adds a new devicetree binding schema for the Novatek NT36536 DSI
panel IC, which supports video mode panels like the dual-link 10-bit CSOT
PP8807HB1-1.
> diff --git a/Documentation/devicetree/bindings/display/panel/novatek,nt36536.yaml b/Documentation/devicetree/bindings/display/panel/novatek,nt36536.yaml
> new file mode 100644
> index 0000000000000..1e86f5329b222
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/panel/novatek,nt36536.yaml
[ ... ]
> +allOf:
> + - $ref: panel-common-dual.yaml#
> +
> +properties:
[ ... ]
> + vsn-supply:
> + description: Negative source voltage rail
> +
> + backlight: true
> + ports: true
[Severity: Low]
Should these properties be omitted? They are already defined in the referenced
common schemas and appear to be redundantly redefined here solely because of
how additionalProperties is evaluated below.
> +
> +required:
> + - compatible
> + - reg
> + - vddio-supply
> + - reset-gpios
> + - ports
> +
> +additionalProperties: false
[Severity: Low]
Does this directive incorrectly restrict the schema since there is an allOf
reference above? Using additionalProperties: false will cause dtbs_check to
reject valid board configurations that use standard panel properties defined in
panel-common-dual.yaml and panel-common.yaml (such as rotation or width-mm).
Should this be changed to unevaluatedProperties: false instead? Once that is
corrected, the redundant backlight and ports entries above can likely be
removed.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260705153515.46147-1-mitltlatltl@gmail.com?part=1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/2] drm/panel: Add Novatek NT36536 panel driver
2026-07-05 15:35 ` [PATCH v2 2/2] drm/panel: Add Novatek NT36536 panel driver Pengyu Luo
@ 2026-07-05 15:47 ` sashiko-bot
2026-07-06 17:15 ` Uwe Kleine-König
1 sibling, 0 replies; 6+ messages in thread
From: sashiko-bot @ 2026-07-05 15:47 UTC (permalink / raw)
To: Pengyu Luo; +Cc: robh, conor+dt, devicetree, dri-devel
Thank you for your contribution! Sashiko AI review found 5 potential issue(s) to consider:
- [Medium] Missing 120ms delay after MIPI_DCS_ENTER_SLEEP_MODE before asserting reset and removing power.
- [Medium] The driver ignores transmission errors from DSC-related MIPI DSI multi-context commands in `novatek_prepare()`, masking failures and skipping proper hardware cleanup.
- [Medium] The backlight update_status callback races with the panel unprepare path, allowing DCS commands to be sent to an unpowered panel.
- [Low] Missing dependency for DRM DSC helpers in Kconfig, leading to undefined references at link time.
- [Low] Explicit invocation of `drm_panel_remove()` in the error path for a panel registered with `devm_drm_panel_add()`.
--
commit 51663d35dbaba4a4aee3bdfad1a94da90787d8f6
Author: Pengyu Luo <mitltlatltl@gmail.com>
Subject: drm/panel: Add Novatek NT36536 panel driver
This commit adds a new driver for Novatek NT36536 display panels.
It specifically implements support for the CSOT PP8807HB1-1 dual-link 10-bit
panel used in the LENOVO Legion Y700 Gen4.
> diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
> --- a/drivers/gpu/drm/panel/Kconfig
> +++ b/drivers/gpu/drm/panel/Kconfig
> @@ -620,6 +620,17 @@ 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_NT36536
> + tristate "Novatek NT36536 panel driver"
> + depends on OF
> + depends on DRM_MIPI_DSI
> + depends on BACKLIGHT_CLASS_DEVICE
> + select DRM_KMS_HELPER
[Severity: Low]
Does this Kconfig entry need to select DRM_DISPLAY_DSC_HELPER and
DRM_DISPLAY_HELPER? Building this driver on a configuration that does not
incidentally enable CONFIG_DRM_DISPLAY_DSC_HELPER could result in a build
failure due to an undefined reference to drm_dsc_pps_payload_pack().
> + help
> + Say Y here if you want to enable support for Novatek NT36536-based
> + display panels, such as the one found in the LENOVO Legion Y700
> + Gen4.
> +
[ ... ]
> diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36536.c b/drivers/gpu/drm/panel/panel-novatek-nt36536.c
> --- /dev/null
> +++ b/drivers/gpu/drm/panel/panel-novatek-nt36536.c
[ ... ]
> +static int novatek_prepare(struct drm_panel *panel)
> +{
[ ... ]
> + drm_dsc_pps_payload_pack(&pps, &ctx->dsc);
> + mipi_dsi_picture_parameter_set_multi(&dsi_ctx, &pps);
> + mipi_dsi_compression_mode_multi(&dsi_ctx, true);
> + mipi_dsi_msleep(&dsi_ctx, 28);
> +
> + return backlight_enable(ctx->backlight);
[Severity: Medium]
Should the accumulated error in dsi_ctx.accum_err be checked before returning?
If any of the DSC MIPI DSI commands fail, the error is recorded but never
evaluated by novatek_prepare(). Returning the result of backlight_enable()
directly could mask failures, skip proper hardware cleanup, and leave the
panel in a corrupted state.
> +}
> +
> +static int novatek_off(struct mipi_dsi_multi_context *dsi_ctx)
> +{
> + mipi_dsi_dcs_set_display_off_multi(dsi_ctx);
> + mipi_dsi_dcs_enter_sleep_mode_multi(dsi_ctx);
> +
> + return dsi_ctx->accum_err;
> +}
> +
> +static int novatek_unprepare(struct drm_panel *panel)
> +{
[ ... ]
> + ret = novatek_off(&dsi_ctx);
> + if (ret < 0)
> + dev_err(dev, "Failed to un-initialize panel: %d\n", ret);
> +
> + gpiod_set_value_cansleep(ctx->reset_gpio, 1);
> + regulator_bulk_disable(ARRAY_SIZE(novatek_supplies), ctx->supplies);
[Severity: Medium]
Should there be a delay before removing power? novatek_off() sends the
MIPI_DCS_ENTER_SLEEP_MODE command, but the regulators are disabled and the
reset GPIO is asserted immediately without waiting. Removing power immediately
after sending Sleep In can violate the MIPI DCS specification.
> +
> + return 0;
> +}
[ ... ]
> +static int novatek_bl_update_status(struct backlight_device *bl)
> +{
> + struct novatek *ctx = bl_get_data(bl);
> + u16 brightness = backlight_get_brightness(bl);
> +
> + return mipi_dsi_dcs_set_display_brightness_large(to_primary_dsi(ctx),
> + brightness);
[Severity: Medium]
Could this DCS command be sent to an unpowered panel? A user-space write to
the backlight sysfs interface can trigger novatek_bl_update_status()
asynchronously. If this happens after novatek_unprepare() has disabled the
regulators and asserted reset, it could result in DSI host timeouts or
display controller lockups. Should there be a check to ensure the panel is
currently prepared?
> +}
[ ... ]
> +static int novatek_probe(struct mipi_dsi_device *dsi)
> +{
[ ... ]
> + ret = devm_drm_panel_add(dev, &ctx->panel);
> + if (ret < 0)
> + return dev_err_probe(dev, ret, "failed to add panel\n");
> +
> + for (i = 0; i < num_dsi; i++) {
> + ctx->dsi[i]->lanes = desc->lanes;
> + ctx->dsi[i]->format = desc->format;
> + ctx->dsi[i]->mode_flags = desc->mode_flags;
> + ctx->dsi[i]->dsc = &ctx->dsc;
> + ret = devm_mipi_dsi_attach(dev, ctx->dsi[i]);
> + if (ret < 0) {
> + drm_panel_remove(&ctx->panel);
> + return dev_err_probe(dev, ret,
> + "Failed to attach to DSI host\n");
[Severity: Low]
Is the manual drm_panel_remove() call necessary here? The panel was
registered using the managed API devm_drm_panel_add(), which automatically
handles cleanup. Calling drm_panel_remove() explicitly on the error path
could cause the devres framework to execute it a second time.
> + }
> + }
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260705153515.46147-1-mitltlatltl@gmail.com?part=2
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/2] drm/panel: Add Novatek NT36536 panel driver
2026-07-05 15:35 ` [PATCH v2 2/2] drm/panel: Add Novatek NT36536 panel driver Pengyu Luo
2026-07-05 15:47 ` sashiko-bot
@ 2026-07-06 17:15 ` Uwe Kleine-König
1 sibling, 0 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2026-07-06 17:15 UTC (permalink / raw)
To: Pengyu Luo
Cc: Neil Armstrong, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, dri-devel, devicetree,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 235 bytes --]
Hello,
On Sun, Jul 05, 2026 at 11:35:15PM +0800, Pengyu Luo wrote:
> +#include <linux/mod_devicetable.h>
Please don't add new users for this header file. Just use the
<linux/device-id/*.h> headers that you actually need.
Thanks
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-07-06 17:15 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-05 15:35 [PATCH v2 0/2] drm/panel: Add Novatek NT36536 panel driver Pengyu Luo
2026-07-05 15:35 ` [PATCH v2 1/2] dt-bindings: display: panel: Add Novatek NT36536 Pengyu Luo
2026-07-05 15:44 ` sashiko-bot
2026-07-05 15:35 ` [PATCH v2 2/2] drm/panel: Add Novatek NT36536 panel driver Pengyu Luo
2026-07-05 15:47 ` sashiko-bot
2026-07-06 17:15 ` Uwe Kleine-König
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox