mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] drm/panel: st7703: add support for DCLTek DT300248
@ 2026-10-07 20:18 Marc-Olivier Champagne
  2026-10-07 20:18 ` [PATCH 1/4] drm/panel: st7703: set prepare_prev_first Marc-Olivier Champagne
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Marc-Olivier Champagne @ 2026-10-07 20:18 UTC (permalink / raw)
  To: Neil Armstrong, Jessica Zhang, Guido Günther
  Cc: Ondrej Jirman, Purism Kernel Team, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Hugo Villeneuve,
	Marc-Olivier Champagne, dri-devel, devicetree, linux-kernel,
	Jerome Oufella, Felix Boucher, Quentin Lehoux

This series adds support for the DCLTek DT300248 10.25-inch MIPI DSI
panel based on the Sitronix ST7703 controller.

Patches 1 and 2 are necessary preparation: they make the driver send
the init sequence from prepare() with the DSI host guaranteed up,
since not all hosts accept commands once the video stream is running.
These affect all panels using the driver.

Patches 3 and 4 add the binding and panel.

Marc-Olivier Champagne (4):
  drm/panel: st7703: set prepare_prev_first
  drm/panel: st7703: move init commands to prepare()
  dt-bindings: display: panel: add compatible for DCLTek 300248 10.25in
    panel
  drm/panel: st7703: Add DCLTek 300248 10.25in display

 .../display/panel/rocktech,jh057n00900.yaml   |   2 +
 drivers/gpu/drm/panel/panel-sitronix-st7703.c | 117 +++++++++++++++++-
 2 files changed, 116 insertions(+), 3 deletions(-)


base-commit: 5d7b464a4f517d1db533b1b231f42ddcf4e1dff4
-- 
2.34.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/4] drm/panel: st7703: set prepare_prev_first
  2026-10-07 20:18 [PATCH 0/4] drm/panel: st7703: add support for DCLTek DT300248 Marc-Olivier Champagne
@ 2026-10-07 20:18 ` Marc-Olivier Champagne
  2026-10-08  8:24   ` Neil Armstrong
  2026-10-07 20:18 ` [PATCH 2/4] drm/panel: st7703: move init commands to prepare() Marc-Olivier Champagne
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Marc-Olivier Champagne @ 2026-10-07 20:18 UTC (permalink / raw)
  To: Neil Armstrong, Jessica Zhang, Guido Günther
  Cc: Ondrej Jirman, Purism Kernel Team, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Hugo Villeneuve,
	Marc-Olivier Champagne, dri-devel, devicetree, linux-kernel,
	Jerome Oufella, Felix Boucher, Quentin Lehoux

The DSI host must be enabled for the panel to be initialized in
prepare(). Set the prepare_prev_first flag to guarantee this.

Suggested-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Signed-off-by: Marc-Olivier Champagne <marc-olivier.champagne@savoirfairelinux.com>
---
 drivers/gpu/drm/panel/panel-sitronix-st7703.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
index 70f7282471e6..368c57591817 100644
--- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
+++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
@@ -973,6 +973,8 @@ static int st7703_probe(struct mipi_dsi_device *dsi)
 	if (ret < 0)
 		return dev_err_probe(&dsi->dev, ret, "Failed to get orientation\n");
 
+	ctx->panel.prepare_prev_first = true;
+
 	ret = drm_panel_of_backlight(&ctx->panel);
 	if (ret)
 		return ret;
-- 
2.34.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 2/4] drm/panel: st7703: move init commands to prepare()
  2026-10-07 20:18 [PATCH 0/4] drm/panel: st7703: add support for DCLTek DT300248 Marc-Olivier Champagne
  2026-10-07 20:18 ` [PATCH 1/4] drm/panel: st7703: set prepare_prev_first Marc-Olivier Champagne
@ 2026-10-07 20:18 ` Marc-Olivier Champagne
  2026-10-08  8:24   ` Neil Armstrong
  2026-10-07 20:18 ` [PATCH 3/4] dt-bindings: display: panel: add compatible for DCLTek 300248 10.25in panel Marc-Olivier Champagne
  2026-10-07 20:18 ` [PATCH 4/4] drm/panel: st7703: Add DCLTek 300248 10.25in display Marc-Olivier Champagne
  3 siblings, 1 reply; 10+ messages in thread
From: Marc-Olivier Champagne @ 2026-10-07 20:18 UTC (permalink / raw)
  To: Neil Armstrong, Jessica Zhang, Guido Günther
  Cc: Ondrej Jirman, Purism Kernel Team, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Hugo Villeneuve,
	Marc-Olivier Champagne, dri-devel, devicetree, linux-kernel,
	Jerome Oufella, Felix Boucher, Quentin Lehoux

The panel init sequence is currently sent from enable(), i.e. after
the DSI host has started the video stream. Not all DSI hosts accept
command packets in that state, so the init sequence may never reach
the panel.

Move the init sequence to prepare(), right after the panel reset, to
ensure it is sent before the host enables the video stream.

Since the init sequence can now fail in prepare(), power the panel
back down on error: the panel core does not call unprepare() when
prepare() fails, leaving the power supplies enabled.

Both patterns are already used by other DSI panel drivers.

Suggested-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Signed-off-by: Marc-Olivier Champagne <marc-olivier.champagne@savoirfairelinux.com>
---
 drivers/gpu/drm/panel/panel-sitronix-st7703.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
index 368c57591817..f4635a7327de 100644
--- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
+++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
@@ -774,8 +774,6 @@ static int st7703_enable(struct drm_panel *panel)
 	struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
 	struct mipi_dsi_multi_context dsi_ctx = {.dsi = dsi};
 
-	ctx->desc->init_sequence(&dsi_ctx);
-
 	mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
 
 	/* It takes the controller 120 msec to wake up after sleep. */
@@ -784,7 +782,7 @@ static int st7703_enable(struct drm_panel *panel)
 	mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
 
 	if (!dsi_ctx.accum_err)
-		dev_dbg(ctx->dev, "Panel init sequence done\n");
+		dev_dbg(ctx->dev, "Panel enable done\n");
 
 	return dsi_ctx.accum_err;
 }
@@ -819,6 +817,8 @@ static int st7703_unprepare(struct drm_panel *panel)
 static int st7703_prepare(struct drm_panel *panel)
 {
 	struct st7703 *ctx = panel_to_st7703(panel);
+	struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
+	struct mipi_dsi_multi_context dsi_ctx = {.dsi = dsi};
 	int ret;
 
 	dev_dbg(ctx->dev, "Resetting the panel\n");
@@ -843,6 +843,18 @@ static int st7703_prepare(struct drm_panel *panel)
 	gpiod_set_value_cansleep(ctx->reset_gpio, 0);
 	usleep_range(15000, 20000);
 
+	ctx->desc->init_sequence(&dsi_ctx);
+
+	if (dsi_ctx.accum_err) {
+		gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+		regulator_disable(ctx->iovcc);
+		regulator_disable(ctx->vcc);
+
+		return dsi_ctx.accum_err;
+	}
+
+	dev_dbg(ctx->dev, "Panel init sequence done\n");
+
 	return 0;
 }
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 3/4] dt-bindings: display: panel: add compatible for DCLTek 300248 10.25in panel
  2026-10-07 20:18 [PATCH 0/4] drm/panel: st7703: add support for DCLTek DT300248 Marc-Olivier Champagne
  2026-10-07 20:18 ` [PATCH 1/4] drm/panel: st7703: set prepare_prev_first Marc-Olivier Champagne
  2026-10-07 20:18 ` [PATCH 2/4] drm/panel: st7703: move init commands to prepare() Marc-Olivier Champagne
@ 2026-10-07 20:18 ` Marc-Olivier Champagne
  2026-10-08  7:30   ` Conor Dooley
  2026-10-08  7:36   ` Conor Dooley
  2026-10-07 20:18 ` [PATCH 4/4] drm/panel: st7703: Add DCLTek 300248 10.25in display Marc-Olivier Champagne
  3 siblings, 2 replies; 10+ messages in thread
From: Marc-Olivier Champagne @ 2026-10-07 20:18 UTC (permalink / raw)
  To: Neil Armstrong, Jessica Zhang, Guido Günther
  Cc: Ondrej Jirman, Purism Kernel Team, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Hugo Villeneuve,
	Marc-Olivier Champagne, dri-devel, devicetree, linux-kernel,
	Jerome Oufella, Felix Boucher, Quentin Lehoux

The DCLTek dt300248 is a panel using the Sitronix ST7703 controller.
Add a new compatible for it.

Suggested-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Signed-off-by: Marc-Olivier Champagne <marc-olivier.champagne@savoirfairelinux.com>
---
 .../devicetree/bindings/display/panel/rocktech,jh057n00900.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml b/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml
index 91e06d6a6819..b05f3e8cfcd4 100644
--- a/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml
+++ b/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml
@@ -24,6 +24,8 @@ properties:
       - anbernic,rg353v-panel-v2
       # AYANEO Pocket DS lower 5.0" 1024x768 IPS LCD panel
       - ayaneo,pocket-ds-lower-panel
+      # DCLTek DT300248 10.25" 440x1920 LCD panel
+      - dcltek,dt300248
       # GameForce Chi 3.5" 640x480 TFT LCD panel
       - gameforce,chi-panel
       # Powkiddy RGB10MAX3 5.0" 720x1280 TFT LCD panel
-- 
2.34.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 4/4] drm/panel: st7703: Add DCLTek 300248 10.25in display
  2026-10-07 20:18 [PATCH 0/4] drm/panel: st7703: add support for DCLTek DT300248 Marc-Olivier Champagne
                   ` (2 preceding siblings ...)
  2026-10-07 20:18 ` [PATCH 3/4] dt-bindings: display: panel: add compatible for DCLTek 300248 10.25in panel Marc-Olivier Champagne
@ 2026-10-07 20:18 ` Marc-Olivier Champagne
  2026-10-08  8:25   ` Neil Armstrong
  3 siblings, 1 reply; 10+ messages in thread
From: Marc-Olivier Champagne @ 2026-10-07 20:18 UTC (permalink / raw)
  To: Neil Armstrong, Jessica Zhang, Guido Günther
  Cc: Ondrej Jirman, Purism Kernel Team, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Hugo Villeneuve,
	Marc-Olivier Champagne, dri-devel, devicetree, linux-kernel,
	Jerome Oufella, Felix Boucher, Quentin Lehoux

The DCLTek dt300248 is an LCD panel using the Sitronix ST7703
controller. Add the panel to the driver.

Suggested-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Signed-off-by: Marc-Olivier Champagne <marc-olivier.champagne@savoirfairelinux.com>
---
 drivers/gpu/drm/panel/panel-sitronix-st7703.c | 97 +++++++++++++++++++
 1 file changed, 97 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
index f4635a7327de..b3abfe8c9ed9 100644
--- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
+++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
@@ -768,6 +768,102 @@ static const struct st7703_panel_desc ayaneo_pocket_ds_lower_desc = {
 	.init_sequence = ayaneo_pocket_ds_lower_init_sequence,
 };
 
+static void dcltek_dt300248_init_sequence(struct mipi_dsi_multi_context *dsi_ctx)
+{
+	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETEXTC, 0xf1, 0x12, 0x87);
+	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETDISP, 0xe0, 0x05, 0xf8);
+	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETRGBIF, 0x10, 0x10, 0x28,
+				     0x28, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00);
+	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETCYC, 0x80);
+	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETBGP, 0x0d, 0x0b);
+	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETVCOM, 0x6d, 0x6d);
+	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETPOWER_EXT, 0x25, 0x62,
+				     0x20, 0x03);
+	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETMIPI,
+				     0x33, 0x81, 0x05, 0xf9, 0x0e, 0x0e, 0x20, 0x00,
+				     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x25,
+				     0x00, 0x91, 0x0a, 0x00, 0x00, 0x01, 0x4f, 0x01,
+				     0x00, 0x00, 0x37);
+	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETVDC, 0x47);
+	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_UNKNOWN_BF,
+				     0x02, 0x10, 0x00, 0x80, 0x04);
+
+	mipi_dsi_msleep(dsi_ctx, 20);
+
+	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETSCR,
+				     0x73, 0x73, 0x50, 0x50, 0xa0, 0x00, 0x12, 0x53,
+				     0x00);
+	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETPOWER,
+				     0x25, 0x00, 0x32, 0x32, 0x77, 0xe4, 0x77, 0x77,
+				     0xcc, 0xcc, 0xff, 0xff, 0x11, 0x11, 0x00, 0x00,
+				     0x32);
+	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETIO,
+				     0x10, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00,
+				     0xed, 0xc5, 0x00, 0xa5);
+	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETCABC,
+				     0x10, 0x40, 0x1e, 0x03);
+	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETPANEL, 0x07);
+	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETGAMMA,
+				     0x00, 0x13, 0x1a, 0x2c, 0x34, 0x3f, 0x4f, 0x3f,
+				     0x06, 0x0c, 0x0d, 0x14, 0x15, 0x13, 0x13, 0x11,
+				     0x19, 0x00, 0x13, 0x1a, 0x2c, 0x34, 0x3f, 0x4f,
+				     0x3f, 0x06, 0x0c, 0x0d, 0x14, 0x15, 0x13, 0x13,
+				     0x11, 0x19);
+	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_UNKNOWN_E1,
+				     0x11, 0x11, 0x91, 0x00, 0x00, 0x00, 0x00);
+	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETEQ,
+				     0x07, 0x07, 0x0b, 0x0b, 0x0b, 0x0b, 0x00, 0x00,
+				     0x00, 0x00, 0x2f, 0x04, 0xc0, 0x10);
+	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETGIP1,
+				     0xc8, 0x10, 0x0a, 0x10, 0x0e, 0x80, 0x38, 0x12,
+				     0x31, 0x23, 0x4f, 0x86, 0x80, 0x38, 0x47, 0x08,
+				     0x00, 0x0c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x0c,
+				     0x04, 0x00, 0x00, 0x00, 0x8f, 0x44, 0x60, 0x28,
+				     0xba, 0x02, 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f,
+				     0x45, 0x71, 0x38, 0xba, 0x13, 0x88, 0x88, 0x88,
+				     0x88, 0x88, 0x00, 0x00, 0x00, 0x01, 0x00, 0x80,
+				     0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETGIP2,
+				     0x96, 0x18, 0x00, 0x00, 0x00, 0xb4, 0x01, 0x0b,
+				     0x41, 0x01, 0x02, 0x00, 0xf8, 0x43, 0x17, 0x58,
+				     0xba, 0x31, 0x88, 0x88, 0x88, 0x88, 0x88, 0xf8,
+				     0x42, 0x06, 0x48, 0xba, 0x20, 0x88, 0x88, 0x88,
+				     0x88, 0x88, 0x23, 0x00, 0x00, 0x00, 0xd7, 0x00,
+				     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+				     0x00, 0x00, 0x07, 0x8b, 0x00, 0x00, 0x40, 0x80,
+				     0x81, 0x40, 0x80, 0x81, 0x00);
+	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_UNKNOWN_EF,
+				     0xff, 0xff, 0x01);
+}
+
+static const struct drm_display_mode dcltek_dt300248_mode = {
+	.clock		= (440 + 8 + 32 + 40) * (1920 + 41 + 8 + 6) * 60 / 1000,
+
+	.hdisplay	= 440,
+	.hsync_start	= 440 + 8,
+	.hsync_end	= 440 + 8 + 32,
+	.htotal		= 440 + 8 + 32 + 40,
+
+	.vdisplay	= 1920,
+	.vsync_start	= 1920 + 41,
+	.vsync_end	= 1920 + 41 + 8,
+	.vtotal		= 1920 + 41 + 8 + 6,
+
+	.width_mm	= 58,
+	.height_mm	= 253,
+	.flags		= DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
+};
+
+static const struct st7703_panel_desc dcltek_dt300248_desc = {
+	.mode = &dcltek_dt300248_mode,
+	.lanes = 4,
+	.mode_flags = MIPI_DSI_MODE_VIDEO |
+		MIPI_DSI_MODE_VIDEO_BURST | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
+		MIPI_DSI_MODE_LPM,
+	.format = MIPI_DSI_FMT_RGB888,
+	.init_sequence = dcltek_dt300248_init_sequence,
+};
+
 static int st7703_enable(struct drm_panel *panel)
 {
 	struct st7703 *ctx = panel_to_st7703(panel);
@@ -1026,6 +1122,7 @@ static void st7703_remove(struct mipi_dsi_device *dsi)
 static const struct of_device_id st7703_of_match[] = {
 	{ .compatible = "anbernic,rg353v-panel-v2", .data = &rg353v2_desc },
 	{ .compatible = "ayaneo,pocket-ds-lower-panel", .data = &ayaneo_pocket_ds_lower_desc },
+	{ .compatible = "dcltek,dt300248", .data = &dcltek_dt300248_desc },
 	{ .compatible = "gameforce,chi-panel", .data = &gameforcechi_desc },
 	{ .compatible = "powkiddy,rgb10max3-panel", .data = &rgb10max3_panel_desc },
 	{ .compatible = "powkiddy,rgb30-panel", .data = &rgb30panel_desc },
-- 
2.34.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 3/4] dt-bindings: display: panel: add compatible for DCLTek 300248 10.25in panel
  2026-10-07 20:18 ` [PATCH 3/4] dt-bindings: display: panel: add compatible for DCLTek 300248 10.25in panel Marc-Olivier Champagne
@ 2026-10-08  7:30   ` Conor Dooley
  2026-10-08  7:36   ` Conor Dooley
  1 sibling, 0 replies; 10+ messages in thread
From: Conor Dooley @ 2026-10-08  7:30 UTC (permalink / raw)
  To: Marc-Olivier Champagne
  Cc: Neil Armstrong, Jessica Zhang, Guido Günther, Ondrej Jirman,
	Purism Kernel Team, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Hugo Villeneuve, dri-devel,
	devicetree, linux-kernel, Jerome Oufella, Felix Boucher,
	Quentin Lehoux

[-- Attachment #1: Type: text/plain, Size: 75 bytes --]

Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 3/4] dt-bindings: display: panel: add compatible for DCLTek 300248 10.25in panel
  2026-10-07 20:18 ` [PATCH 3/4] dt-bindings: display: panel: add compatible for DCLTek 300248 10.25in panel Marc-Olivier Champagne
  2026-10-08  7:30   ` Conor Dooley
@ 2026-10-08  7:36   ` Conor Dooley
  1 sibling, 0 replies; 10+ messages in thread
From: Conor Dooley @ 2026-10-08  7:36 UTC (permalink / raw)
  To: Marc-Olivier Champagne
  Cc: Neil Armstrong, Jessica Zhang, Guido Günther, Ondrej Jirman,
	Purism Kernel Team, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Hugo Villeneuve, dri-devel,
	devicetree, linux-kernel, Jerome Oufella, Felix Boucher,
	Quentin Lehoux

[-- Attachment #1: Type: text/plain, Size: 75 bytes --]

Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/4] drm/panel: st7703: set prepare_prev_first
  2026-10-07 20:18 ` [PATCH 1/4] drm/panel: st7703: set prepare_prev_first Marc-Olivier Champagne
@ 2026-10-08  8:24   ` Neil Armstrong
  0 siblings, 0 replies; 10+ messages in thread
From: Neil Armstrong @ 2026-10-08  8:24 UTC (permalink / raw)
  To: Marc-Olivier Champagne, Jessica Zhang, Guido Günther
  Cc: Ondrej Jirman, Purism Kernel Team, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Hugo Villeneuve, dri-devel,
	devicetree, linux-kernel, Jerome Oufella, Felix Boucher,
	Quentin Lehoux

On 10/7/26 22:18, Marc-Olivier Champagne wrote:
> The DSI host must be enabled for the panel to be initialized in
> prepare(). Set the prepare_prev_first flag to guarantee this.
> 
> Suggested-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
> Signed-off-by: Marc-Olivier Champagne <marc-olivier.champagne@savoirfairelinux.com>
> ---
>   drivers/gpu/drm/panel/panel-sitronix-st7703.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> index 70f7282471e6..368c57591817 100644
> --- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> +++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> @@ -973,6 +973,8 @@ static int st7703_probe(struct mipi_dsi_device *dsi)
>   	if (ret < 0)
>   		return dev_err_probe(&dsi->dev, ret, "Failed to get orientation\n");
>   
> +	ctx->panel.prepare_prev_first = true;
> +
>   	ret = drm_panel_of_backlight(&ctx->panel);
>   	if (ret)
>   		return ret;

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

Thanks,
Neil

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/4] drm/panel: st7703: move init commands to prepare()
  2026-10-07 20:18 ` [PATCH 2/4] drm/panel: st7703: move init commands to prepare() Marc-Olivier Champagne
@ 2026-10-08  8:24   ` Neil Armstrong
  0 siblings, 0 replies; 10+ messages in thread
From: Neil Armstrong @ 2026-10-08  8:24 UTC (permalink / raw)
  To: Marc-Olivier Champagne, Jessica Zhang, Guido Günther
  Cc: Ondrej Jirman, Purism Kernel Team, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Hugo Villeneuve, dri-devel,
	devicetree, linux-kernel, Jerome Oufella, Felix Boucher,
	Quentin Lehoux

On 10/7/26 22:18, Marc-Olivier Champagne wrote:
> The panel init sequence is currently sent from enable(), i.e. after
> the DSI host has started the video stream. Not all DSI hosts accept
> command packets in that state, so the init sequence may never reach
> the panel.
> 
> Move the init sequence to prepare(), right after the panel reset, to
> ensure it is sent before the host enables the video stream.
> 
> Since the init sequence can now fail in prepare(), power the panel
> back down on error: the panel core does not call unprepare() when
> prepare() fails, leaving the power supplies enabled.
> 
> Both patterns are already used by other DSI panel drivers.
> 
> Suggested-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
> Signed-off-by: Marc-Olivier Champagne <marc-olivier.champagne@savoirfairelinux.com>
> ---
>   drivers/gpu/drm/panel/panel-sitronix-st7703.c | 18 +++++++++++++++---
>   1 file changed, 15 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> index 368c57591817..f4635a7327de 100644
> --- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> +++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> @@ -774,8 +774,6 @@ static int st7703_enable(struct drm_panel *panel)
>   	struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
>   	struct mipi_dsi_multi_context dsi_ctx = {.dsi = dsi};
>   
> -	ctx->desc->init_sequence(&dsi_ctx);
> -
>   	mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
>   
>   	/* It takes the controller 120 msec to wake up after sleep. */
> @@ -784,7 +782,7 @@ static int st7703_enable(struct drm_panel *panel)
>   	mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
>   
>   	if (!dsi_ctx.accum_err)
> -		dev_dbg(ctx->dev, "Panel init sequence done\n");
> +		dev_dbg(ctx->dev, "Panel enable done\n");
>   
>   	return dsi_ctx.accum_err;
>   }
> @@ -819,6 +817,8 @@ static int st7703_unprepare(struct drm_panel *panel)
>   static int st7703_prepare(struct drm_panel *panel)
>   {
>   	struct st7703 *ctx = panel_to_st7703(panel);
> +	struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
> +	struct mipi_dsi_multi_context dsi_ctx = {.dsi = dsi};
>   	int ret;
>   
>   	dev_dbg(ctx->dev, "Resetting the panel\n");
> @@ -843,6 +843,18 @@ static int st7703_prepare(struct drm_panel *panel)
>   	gpiod_set_value_cansleep(ctx->reset_gpio, 0);
>   	usleep_range(15000, 20000);
>   
> +	ctx->desc->init_sequence(&dsi_ctx);
> +
> +	if (dsi_ctx.accum_err) {
> +		gpiod_set_value_cansleep(ctx->reset_gpio, 1);
> +		regulator_disable(ctx->iovcc);
> +		regulator_disable(ctx->vcc);
> +
> +		return dsi_ctx.accum_err;
> +	}
> +
> +	dev_dbg(ctx->dev, "Panel init sequence done\n");
> +
>   	return 0;
>   }
>   

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

Thanks,
Neil

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 4/4] drm/panel: st7703: Add DCLTek 300248 10.25in display
  2026-10-07 20:18 ` [PATCH 4/4] drm/panel: st7703: Add DCLTek 300248 10.25in display Marc-Olivier Champagne
@ 2026-10-08  8:25   ` Neil Armstrong
  0 siblings, 0 replies; 10+ messages in thread
From: Neil Armstrong @ 2026-10-08  8:25 UTC (permalink / raw)
  To: Marc-Olivier Champagne, Jessica Zhang, Guido Günther
  Cc: Ondrej Jirman, Purism Kernel Team, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Hugo Villeneuve, dri-devel,
	devicetree, linux-kernel, Jerome Oufella, Felix Boucher,
	Quentin Lehoux

On 10/7/26 22:18, Marc-Olivier Champagne wrote:
> The DCLTek dt300248 is an LCD panel using the Sitronix ST7703
> controller. Add the panel to the driver.
> 
> Suggested-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
> Signed-off-by: Marc-Olivier Champagne <marc-olivier.champagne@savoirfairelinux.com>
> ---
>   drivers/gpu/drm/panel/panel-sitronix-st7703.c | 97 +++++++++++++++++++
>   1 file changed, 97 insertions(+)
> 
> diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> index f4635a7327de..b3abfe8c9ed9 100644
> --- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> +++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> @@ -768,6 +768,102 @@ static const struct st7703_panel_desc ayaneo_pocket_ds_lower_desc = {
>   	.init_sequence = ayaneo_pocket_ds_lower_init_sequence,
>   };
>   
> +static void dcltek_dt300248_init_sequence(struct mipi_dsi_multi_context *dsi_ctx)
> +{
> +	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETEXTC, 0xf1, 0x12, 0x87);
> +	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETDISP, 0xe0, 0x05, 0xf8);
> +	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETRGBIF, 0x10, 0x10, 0x28,
> +				     0x28, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00);
> +	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETCYC, 0x80);
> +	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETBGP, 0x0d, 0x0b);
> +	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETVCOM, 0x6d, 0x6d);
> +	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETPOWER_EXT, 0x25, 0x62,
> +				     0x20, 0x03);
> +	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETMIPI,
> +				     0x33, 0x81, 0x05, 0xf9, 0x0e, 0x0e, 0x20, 0x00,
> +				     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x25,
> +				     0x00, 0x91, 0x0a, 0x00, 0x00, 0x01, 0x4f, 0x01,
> +				     0x00, 0x00, 0x37);
> +	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETVDC, 0x47);
> +	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_UNKNOWN_BF,
> +				     0x02, 0x10, 0x00, 0x80, 0x04);
> +
> +	mipi_dsi_msleep(dsi_ctx, 20);
> +
> +	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETSCR,
> +				     0x73, 0x73, 0x50, 0x50, 0xa0, 0x00, 0x12, 0x53,
> +				     0x00);
> +	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETPOWER,
> +				     0x25, 0x00, 0x32, 0x32, 0x77, 0xe4, 0x77, 0x77,
> +				     0xcc, 0xcc, 0xff, 0xff, 0x11, 0x11, 0x00, 0x00,
> +				     0x32);
> +	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETIO,
> +				     0x10, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00,
> +				     0xed, 0xc5, 0x00, 0xa5);
> +	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETCABC,
> +				     0x10, 0x40, 0x1e, 0x03);
> +	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETPANEL, 0x07);
> +	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETGAMMA,
> +				     0x00, 0x13, 0x1a, 0x2c, 0x34, 0x3f, 0x4f, 0x3f,
> +				     0x06, 0x0c, 0x0d, 0x14, 0x15, 0x13, 0x13, 0x11,
> +				     0x19, 0x00, 0x13, 0x1a, 0x2c, 0x34, 0x3f, 0x4f,
> +				     0x3f, 0x06, 0x0c, 0x0d, 0x14, 0x15, 0x13, 0x13,
> +				     0x11, 0x19);
> +	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_UNKNOWN_E1,
> +				     0x11, 0x11, 0x91, 0x00, 0x00, 0x00, 0x00);
> +	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETEQ,
> +				     0x07, 0x07, 0x0b, 0x0b, 0x0b, 0x0b, 0x00, 0x00,
> +				     0x00, 0x00, 0x2f, 0x04, 0xc0, 0x10);
> +	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETGIP1,
> +				     0xc8, 0x10, 0x0a, 0x10, 0x0e, 0x80, 0x38, 0x12,
> +				     0x31, 0x23, 0x4f, 0x86, 0x80, 0x38, 0x47, 0x08,
> +				     0x00, 0x0c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x0c,
> +				     0x04, 0x00, 0x00, 0x00, 0x8f, 0x44, 0x60, 0x28,
> +				     0xba, 0x02, 0x88, 0x88, 0x88, 0x88, 0x88, 0x8f,
> +				     0x45, 0x71, 0x38, 0xba, 0x13, 0x88, 0x88, 0x88,
> +				     0x88, 0x88, 0x00, 0x00, 0x00, 0x01, 0x00, 0x80,
> +				     0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
> +	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_SETGIP2,
> +				     0x96, 0x18, 0x00, 0x00, 0x00, 0xb4, 0x01, 0x0b,
> +				     0x41, 0x01, 0x02, 0x00, 0xf8, 0x43, 0x17, 0x58,
> +				     0xba, 0x31, 0x88, 0x88, 0x88, 0x88, 0x88, 0xf8,
> +				     0x42, 0x06, 0x48, 0xba, 0x20, 0x88, 0x88, 0x88,
> +				     0x88, 0x88, 0x23, 0x00, 0x00, 0x00, 0xd7, 0x00,
> +				     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +				     0x00, 0x00, 0x07, 0x8b, 0x00, 0x00, 0x40, 0x80,
> +				     0x81, 0x40, 0x80, 0x81, 0x00);
> +	mipi_dsi_dcs_write_seq_multi(dsi_ctx, ST7703_CMD_UNKNOWN_EF,
> +				     0xff, 0xff, 0x01);
> +}
> +
> +static const struct drm_display_mode dcltek_dt300248_mode = {
> +	.clock		= (440 + 8 + 32 + 40) * (1920 + 41 + 8 + 6) * 60 / 1000,
> +
> +	.hdisplay	= 440,
> +	.hsync_start	= 440 + 8,
> +	.hsync_end	= 440 + 8 + 32,
> +	.htotal		= 440 + 8 + 32 + 40,
> +
> +	.vdisplay	= 1920,
> +	.vsync_start	= 1920 + 41,
> +	.vsync_end	= 1920 + 41 + 8,
> +	.vtotal		= 1920 + 41 + 8 + 6,
> +
> +	.width_mm	= 58,
> +	.height_mm	= 253,
> +	.flags		= DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
> +};
> +
> +static const struct st7703_panel_desc dcltek_dt300248_desc = {
> +	.mode = &dcltek_dt300248_mode,
> +	.lanes = 4,
> +	.mode_flags = MIPI_DSI_MODE_VIDEO |
> +		MIPI_DSI_MODE_VIDEO_BURST | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
> +		MIPI_DSI_MODE_LPM,
> +	.format = MIPI_DSI_FMT_RGB888,
> +	.init_sequence = dcltek_dt300248_init_sequence,
> +};
> +
>   static int st7703_enable(struct drm_panel *panel)
>   {
>   	struct st7703 *ctx = panel_to_st7703(panel);
> @@ -1026,6 +1122,7 @@ static void st7703_remove(struct mipi_dsi_device *dsi)
>   static const struct of_device_id st7703_of_match[] = {
>   	{ .compatible = "anbernic,rg353v-panel-v2", .data = &rg353v2_desc },
>   	{ .compatible = "ayaneo,pocket-ds-lower-panel", .data = &ayaneo_pocket_ds_lower_desc },
> +	{ .compatible = "dcltek,dt300248", .data = &dcltek_dt300248_desc },
>   	{ .compatible = "gameforce,chi-panel", .data = &gameforcechi_desc },
>   	{ .compatible = "powkiddy,rgb10max3-panel", .data = &rgb10max3_panel_desc },
>   	{ .compatible = "powkiddy,rgb30-panel", .data = &rgb30panel_desc },

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

Thanks,
Neil

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-10-08  8:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-07 20:18 [PATCH 0/4] drm/panel: st7703: add support for DCLTek DT300248 Marc-Olivier Champagne
2026-10-07 20:18 ` [PATCH 1/4] drm/panel: st7703: set prepare_prev_first Marc-Olivier Champagne
2026-10-08  8:24   ` Neil Armstrong
2026-10-07 20:18 ` [PATCH 2/4] drm/panel: st7703: move init commands to prepare() Marc-Olivier Champagne
2026-10-08  8:24   ` Neil Armstrong
2026-10-07 20:18 ` [PATCH 3/4] dt-bindings: display: panel: add compatible for DCLTek 300248 10.25in panel Marc-Olivier Champagne
2026-10-08  7:30   ` Conor Dooley
2026-10-08  7:36   ` Conor Dooley
2026-10-07 20:18 ` [PATCH 4/4] drm/panel: st7703: Add DCLTek 300248 10.25in display Marc-Olivier Champagne
2026-10-08  8:25   ` Neil Armstrong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®