All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/panel: ltk050h3146w: add mipi_dsi_device.mode_flags to of_match_data
@ 2022-01-31 16:47 ` quentin.schulz
  0 siblings, 0 replies; 17+ messages in thread
From: quentin.schulz @ 2022-01-31 16:47 UTC (permalink / raw)
  Cc: thierry.reding, sam, airlied, daniel, robh+dt, dri-devel,
	devicetree, linux-kernel, Quentin Schulz, Quentin Schulz

From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

To prepare for a new display to be supported by this driver which has a
slightly different set of DSI mode related flags, let's move the
currently hardcoded mode flags to the .data field of of_device_id
structure.

Cc: Quentin Schulz <foss+kernel@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
index a5a414920430..67eb474e28c6 100644
--- a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
+++ b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
@@ -25,6 +25,7 @@ struct ltk050h3146w_cmd {
 
 struct ltk050h3146w;
 struct ltk050h3146w_desc {
+	const unsigned long mode_flags;
 	const struct drm_display_mode *mode;
 	int (*init)(struct ltk050h3146w *ctx);
 };
@@ -339,6 +340,8 @@ static const struct drm_display_mode ltk050h3146w_mode = {
 static const struct ltk050h3146w_desc ltk050h3146w_data = {
 	.mode = &ltk050h3146w_mode,
 	.init = ltk050h3146w_init_sequence,
+	.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
+		MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET,
 };
 
 static int ltk050h3146w_a2_select_page(struct ltk050h3146w *ctx, int page)
@@ -433,6 +436,8 @@ static const struct drm_display_mode ltk050h3146w_a2_mode = {
 static const struct ltk050h3146w_desc ltk050h3146w_a2_data = {
 	.mode = &ltk050h3146w_a2_mode,
 	.init = ltk050h3146w_a2_init_sequence,
+	.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
+		MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET,
 };
 
 static int ltk050h3146w_unprepare(struct drm_panel *panel)
@@ -592,8 +597,7 @@ static int ltk050h3146w_probe(struct mipi_dsi_device *dsi)
 
 	dsi->lanes = 4;
 	dsi->format = MIPI_DSI_FMT_RGB888;
-	dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
-			  MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET;
+	dsi->mode_flags = ctx->panel_desc->mode_flags;
 
 	drm_panel_init(&ctx->panel, &dsi->dev, &ltk050h3146w_funcs,
 		       DRM_MODE_CONNECTOR_DSI);
-- 
2.34.1


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

* [PATCH 1/3] drm/panel: ltk050h3146w: add mipi_dsi_device.mode_flags to of_match_data
@ 2022-01-31 16:47 ` quentin.schulz
  0 siblings, 0 replies; 17+ messages in thread
From: quentin.schulz @ 2022-01-31 16:47 UTC (permalink / raw)
  Cc: devicetree, airlied, Quentin Schulz, linux-kernel, dri-devel,
	Quentin Schulz, robh+dt, thierry.reding, sam

From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

To prepare for a new display to be supported by this driver which has a
slightly different set of DSI mode related flags, let's move the
currently hardcoded mode flags to the .data field of of_device_id
structure.

Cc: Quentin Schulz <foss+kernel@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
index a5a414920430..67eb474e28c6 100644
--- a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
+++ b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
@@ -25,6 +25,7 @@ struct ltk050h3146w_cmd {
 
 struct ltk050h3146w;
 struct ltk050h3146w_desc {
+	const unsigned long mode_flags;
 	const struct drm_display_mode *mode;
 	int (*init)(struct ltk050h3146w *ctx);
 };
@@ -339,6 +340,8 @@ static const struct drm_display_mode ltk050h3146w_mode = {
 static const struct ltk050h3146w_desc ltk050h3146w_data = {
 	.mode = &ltk050h3146w_mode,
 	.init = ltk050h3146w_init_sequence,
+	.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
+		MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET,
 };
 
 static int ltk050h3146w_a2_select_page(struct ltk050h3146w *ctx, int page)
@@ -433,6 +436,8 @@ static const struct drm_display_mode ltk050h3146w_a2_mode = {
 static const struct ltk050h3146w_desc ltk050h3146w_a2_data = {
 	.mode = &ltk050h3146w_a2_mode,
 	.init = ltk050h3146w_a2_init_sequence,
+	.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
+		MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET,
 };
 
 static int ltk050h3146w_unprepare(struct drm_panel *panel)
@@ -592,8 +597,7 @@ static int ltk050h3146w_probe(struct mipi_dsi_device *dsi)
 
 	dsi->lanes = 4;
 	dsi->format = MIPI_DSI_FMT_RGB888;
-	dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
-			  MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET;
+	dsi->mode_flags = ctx->panel_desc->mode_flags;
 
 	drm_panel_init(&ctx->panel, &dsi->dev, &ltk050h3146w_funcs,
 		       DRM_MODE_CONNECTOR_DSI);
-- 
2.34.1


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

* [PATCH 2/3] drm/panel: ltk050h3146w: add support for Leadtek LTK050H3148W-CTA6 variant
  2022-01-31 16:47 ` quentin.schulz
@ 2022-01-31 16:47   ` quentin.schulz
  -1 siblings, 0 replies; 17+ messages in thread
From: quentin.schulz @ 2022-01-31 16:47 UTC (permalink / raw)
  Cc: thierry.reding, sam, airlied, daniel, robh+dt, dri-devel,
	devicetree, linux-kernel, Klaus Goger, Quentin Schulz,
	Quentin Schulz

From: Klaus Goger <klaus.goger@theobroma-systems.com>

The LTK050H3148W-CTA6 is a 5.0" 720x1280 DSI display, whose driving
controller is a Himax HX8394-F, slightly different from LTK050H3146W by
its init sequence, mode details and mode flags.

Cc: Quentin Schulz <foss+kernel@0leil.net>
Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 .../drm/panel/panel-leadtek-ltk050h3146w.c    | 87 +++++++++++++++++++
 1 file changed, 87 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
index 67eb474e28c6..3be815c3be68 100644
--- a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
+++ b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
@@ -253,6 +253,89 @@ struct ltk050h3146w *panel_to_ltk050h3146w(struct drm_panel *panel)
 			return ret;					\
 	} while (0)
 
+static int ltk050h3148w_init_sequence(struct ltk050h3146w *ctx)
+{
+	struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
+	int ret;
+
+	/*
+	 * Init sequence was supplied by the panel vendor without much
+	 * documentation.
+	 */
+	dsi_dcs_write_seq(dsi, 0xb9, 0xff, 0x83, 0x94);
+	dsi_dcs_write_seq(dsi, 0xb1, 0x50, 0x15, 0x75, 0x09, 0x32, 0x44, 0x71,
+			  0x31, 0x55, 0x2f);
+	dsi_dcs_write_seq(dsi, 0xba, 0x63, 0x03, 0x68, 0x6b, 0xb2, 0xc0);
+	dsi_dcs_write_seq(dsi, 0xd2, 0x88);
+	dsi_dcs_write_seq(dsi, 0xb2, 0x00, 0x80, 0x64, 0x10, 0x07);
+	dsi_dcs_write_seq(dsi, 0xb4, 0x05, 0x70, 0x05, 0x70, 0x01, 0x70, 0x01,
+			  0x0c, 0x86, 0x75, 0x00, 0x3f, 0x01, 0x74, 0x01, 0x74,
+			  0x01, 0x74, 0x01, 0x0c, 0x86);
+	dsi_dcs_write_seq(dsi, 0xd3, 0x00, 0x00, 0x07, 0x07, 0x40, 0x1e, 0x08,
+			  0x00, 0x32, 0x10, 0x08, 0x00, 0x08, 0x54, 0x15, 0x10,
+			  0x05, 0x04, 0x02, 0x12, 0x10, 0x05, 0x07, 0x33, 0x34,
+			  0x0c, 0x0c, 0x37, 0x10, 0x07, 0x17, 0x11, 0x40);
+	dsi_dcs_write_seq(dsi, 0xd5, 0x19, 0x19, 0x18, 0x18, 0x1b, 0x1b, 0x1a,
+			  0x1a, 0x04, 0x05, 0x06, 0x07, 0x00, 0x01, 0x02, 0x03,
+			  0x20, 0x21, 0x18, 0x18, 0x22, 0x23, 0x18, 0x18, 0x18,
+			  0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+			  0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+			  0x18);
+	 dsi_dcs_write_seq(dsi, 0xd6, 0x18, 0x18, 0x19, 0x19, 0x1b, 0x1b, 0x1a,
+			   0x1a, 0x03, 0x02, 0x01, 0x00, 0x07, 0x06, 0x05, 0x04,
+			   0x23, 0x22, 0x18, 0x18, 0x21, 0x20, 0x18, 0x18, 0x18,
+			   0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+			   0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+			   0x18);
+	dsi_dcs_write_seq(dsi, 0xe0, 0x00, 0x03, 0x09, 0x11, 0x11, 0x14, 0x18,
+			  0x16, 0x2e, 0x3d, 0x4d, 0x4d, 0x58, 0x6c, 0x72, 0x78,
+			  0x88, 0x8b, 0x86, 0xa4, 0xb2, 0x58, 0x55, 0x59, 0x5b,
+			  0x5d, 0x60, 0x64, 0x7f, 0x00, 0x03, 0x09, 0x0f, 0x11,
+			  0x14, 0x18, 0x16, 0x2e, 0x3d, 0x4d, 0x4d, 0x58, 0x6d,
+			  0x73, 0x78, 0x88, 0x8b, 0x87, 0xa5, 0xb2, 0x58, 0x55,
+			  0x58, 0x5b, 0x5d, 0x61, 0x65, 0x7f);
+	dsi_dcs_write_seq(dsi, 0xcc, 0x0b);
+	dsi_dcs_write_seq(dsi, 0xc0, 0x1f, 0x31);
+	dsi_dcs_write_seq(dsi, 0xb6, 0xc4, 0xc4);
+	dsi_dcs_write_seq(dsi, 0xbd, 0x01);
+	dsi_dcs_write_seq(dsi, 0xb1, 0x00);
+	dsi_dcs_write_seq(dsi, 0xbd, 0x00);
+	dsi_dcs_write_seq(dsi, 0xc6, 0xef);
+	dsi_dcs_write_seq(dsi, 0xd4, 0x02);
+	dsi_dcs_write_seq(dsi, 0x11);
+	dsi_dcs_write_seq(dsi, 0x29);
+
+	ret = mipi_dsi_dcs_set_tear_on(dsi, 1);
+	if (ret < 0) {
+		dev_err(ctx->dev, "failed to set tear on: %d\n", ret);
+		return ret;
+	}
+
+	msleep(60);
+
+	return 0;
+}
+
+static const struct drm_display_mode ltk050h3148w_mode = {
+	.hdisplay	= 720,
+	.hsync_start	= 720 + 12,
+	.hsync_end	= 720 + 12 + 6,
+	.htotal		= 720 + 12 + 6 + 24,
+	.vdisplay	= 1280,
+	.vsync_start	= 1280 + 9,
+	.vsync_end	= 1280 + 9 + 2,
+	.vtotal		= 1280 + 9 + 2 + 16,
+	.clock		= 59756,
+	.width_mm	= 62,
+	.height_mm	= 110,
+};
+
+static const struct ltk050h3146w_desc ltk050h3148w_data = {
+	.mode = &ltk050h3148w_mode,
+	.init = ltk050h3148w_init_sequence,
+	.mode_flags = MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
+};
+
 static int ltk050h3146w_init_sequence(struct ltk050h3146w *ctx)
 {
 	struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
@@ -657,6 +740,10 @@ static const struct of_device_id ltk050h3146w_of_match[] = {
 		.compatible = "leadtek,ltk050h3146w-a2",
 		.data = &ltk050h3146w_a2_data,
 	},
+	{
+		.compatible = "leadtek,ltk050h3148w",
+		.data = &ltk050h3148w_data,
+	},
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, ltk050h3146w_of_match);
-- 
2.34.1


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

* [PATCH 2/3] drm/panel: ltk050h3146w: add support for Leadtek LTK050H3148W-CTA6 variant
@ 2022-01-31 16:47   ` quentin.schulz
  0 siblings, 0 replies; 17+ messages in thread
From: quentin.schulz @ 2022-01-31 16:47 UTC (permalink / raw)
  Cc: devicetree, airlied, Quentin Schulz, linux-kernel, dri-devel,
	Quentin Schulz, robh+dt, thierry.reding, Klaus Goger, sam

From: Klaus Goger <klaus.goger@theobroma-systems.com>

The LTK050H3148W-CTA6 is a 5.0" 720x1280 DSI display, whose driving
controller is a Himax HX8394-F, slightly different from LTK050H3146W by
its init sequence, mode details and mode flags.

Cc: Quentin Schulz <foss+kernel@0leil.net>
Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 .../drm/panel/panel-leadtek-ltk050h3146w.c    | 87 +++++++++++++++++++
 1 file changed, 87 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
index 67eb474e28c6..3be815c3be68 100644
--- a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
+++ b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
@@ -253,6 +253,89 @@ struct ltk050h3146w *panel_to_ltk050h3146w(struct drm_panel *panel)
 			return ret;					\
 	} while (0)
 
+static int ltk050h3148w_init_sequence(struct ltk050h3146w *ctx)
+{
+	struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
+	int ret;
+
+	/*
+	 * Init sequence was supplied by the panel vendor without much
+	 * documentation.
+	 */
+	dsi_dcs_write_seq(dsi, 0xb9, 0xff, 0x83, 0x94);
+	dsi_dcs_write_seq(dsi, 0xb1, 0x50, 0x15, 0x75, 0x09, 0x32, 0x44, 0x71,
+			  0x31, 0x55, 0x2f);
+	dsi_dcs_write_seq(dsi, 0xba, 0x63, 0x03, 0x68, 0x6b, 0xb2, 0xc0);
+	dsi_dcs_write_seq(dsi, 0xd2, 0x88);
+	dsi_dcs_write_seq(dsi, 0xb2, 0x00, 0x80, 0x64, 0x10, 0x07);
+	dsi_dcs_write_seq(dsi, 0xb4, 0x05, 0x70, 0x05, 0x70, 0x01, 0x70, 0x01,
+			  0x0c, 0x86, 0x75, 0x00, 0x3f, 0x01, 0x74, 0x01, 0x74,
+			  0x01, 0x74, 0x01, 0x0c, 0x86);
+	dsi_dcs_write_seq(dsi, 0xd3, 0x00, 0x00, 0x07, 0x07, 0x40, 0x1e, 0x08,
+			  0x00, 0x32, 0x10, 0x08, 0x00, 0x08, 0x54, 0x15, 0x10,
+			  0x05, 0x04, 0x02, 0x12, 0x10, 0x05, 0x07, 0x33, 0x34,
+			  0x0c, 0x0c, 0x37, 0x10, 0x07, 0x17, 0x11, 0x40);
+	dsi_dcs_write_seq(dsi, 0xd5, 0x19, 0x19, 0x18, 0x18, 0x1b, 0x1b, 0x1a,
+			  0x1a, 0x04, 0x05, 0x06, 0x07, 0x00, 0x01, 0x02, 0x03,
+			  0x20, 0x21, 0x18, 0x18, 0x22, 0x23, 0x18, 0x18, 0x18,
+			  0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+			  0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+			  0x18);
+	 dsi_dcs_write_seq(dsi, 0xd6, 0x18, 0x18, 0x19, 0x19, 0x1b, 0x1b, 0x1a,
+			   0x1a, 0x03, 0x02, 0x01, 0x00, 0x07, 0x06, 0x05, 0x04,
+			   0x23, 0x22, 0x18, 0x18, 0x21, 0x20, 0x18, 0x18, 0x18,
+			   0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+			   0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
+			   0x18);
+	dsi_dcs_write_seq(dsi, 0xe0, 0x00, 0x03, 0x09, 0x11, 0x11, 0x14, 0x18,
+			  0x16, 0x2e, 0x3d, 0x4d, 0x4d, 0x58, 0x6c, 0x72, 0x78,
+			  0x88, 0x8b, 0x86, 0xa4, 0xb2, 0x58, 0x55, 0x59, 0x5b,
+			  0x5d, 0x60, 0x64, 0x7f, 0x00, 0x03, 0x09, 0x0f, 0x11,
+			  0x14, 0x18, 0x16, 0x2e, 0x3d, 0x4d, 0x4d, 0x58, 0x6d,
+			  0x73, 0x78, 0x88, 0x8b, 0x87, 0xa5, 0xb2, 0x58, 0x55,
+			  0x58, 0x5b, 0x5d, 0x61, 0x65, 0x7f);
+	dsi_dcs_write_seq(dsi, 0xcc, 0x0b);
+	dsi_dcs_write_seq(dsi, 0xc0, 0x1f, 0x31);
+	dsi_dcs_write_seq(dsi, 0xb6, 0xc4, 0xc4);
+	dsi_dcs_write_seq(dsi, 0xbd, 0x01);
+	dsi_dcs_write_seq(dsi, 0xb1, 0x00);
+	dsi_dcs_write_seq(dsi, 0xbd, 0x00);
+	dsi_dcs_write_seq(dsi, 0xc6, 0xef);
+	dsi_dcs_write_seq(dsi, 0xd4, 0x02);
+	dsi_dcs_write_seq(dsi, 0x11);
+	dsi_dcs_write_seq(dsi, 0x29);
+
+	ret = mipi_dsi_dcs_set_tear_on(dsi, 1);
+	if (ret < 0) {
+		dev_err(ctx->dev, "failed to set tear on: %d\n", ret);
+		return ret;
+	}
+
+	msleep(60);
+
+	return 0;
+}
+
+static const struct drm_display_mode ltk050h3148w_mode = {
+	.hdisplay	= 720,
+	.hsync_start	= 720 + 12,
+	.hsync_end	= 720 + 12 + 6,
+	.htotal		= 720 + 12 + 6 + 24,
+	.vdisplay	= 1280,
+	.vsync_start	= 1280 + 9,
+	.vsync_end	= 1280 + 9 + 2,
+	.vtotal		= 1280 + 9 + 2 + 16,
+	.clock		= 59756,
+	.width_mm	= 62,
+	.height_mm	= 110,
+};
+
+static const struct ltk050h3146w_desc ltk050h3148w_data = {
+	.mode = &ltk050h3148w_mode,
+	.init = ltk050h3148w_init_sequence,
+	.mode_flags = MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
+};
+
 static int ltk050h3146w_init_sequence(struct ltk050h3146w *ctx)
 {
 	struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
@@ -657,6 +740,10 @@ static const struct of_device_id ltk050h3146w_of_match[] = {
 		.compatible = "leadtek,ltk050h3146w-a2",
 		.data = &ltk050h3146w_a2_data,
 	},
+	{
+		.compatible = "leadtek,ltk050h3148w",
+		.data = &ltk050h3148w_data,
+	},
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, ltk050h3146w_of_match);
-- 
2.34.1


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

* [PATCH 3/3] dt-bindings: ltk050h3146w: add compatible for LTK050H3148W-CTA6 variant
  2022-01-31 16:47 ` quentin.schulz
@ 2022-01-31 16:47   ` quentin.schulz
  -1 siblings, 0 replies; 17+ messages in thread
From: quentin.schulz @ 2022-01-31 16:47 UTC (permalink / raw)
  Cc: thierry.reding, sam, airlied, daniel, robh+dt, dri-devel,
	devicetree, linux-kernel, Quentin Schulz, Quentin Schulz

From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

The LTK050H3148W-CTA6 is a 5.0" 720x1280 DSI display, whose driving
controller is a Himax HX8394-F, slightly different from LTK050H3146W by
its init sequence, mode details and mode flags.

Cc: Quentin Schulz <foss+kernel@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 .../devicetree/bindings/display/panel/leadtek,ltk050h3146w.yaml  | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/display/panel/leadtek,ltk050h3146w.yaml b/Documentation/devicetree/bindings/display/panel/leadtek,ltk050h3146w.yaml
index 3715882b63b6..63d2a00348e9 100644
--- a/Documentation/devicetree/bindings/display/panel/leadtek,ltk050h3146w.yaml
+++ b/Documentation/devicetree/bindings/display/panel/leadtek,ltk050h3146w.yaml
@@ -17,6 +17,7 @@ properties:
     enum:
       - leadtek,ltk050h3146w
       - leadtek,ltk050h3146w-a2
+      - leadtek,ltk050h3148w
   reg: true
   backlight: true
   reset-gpios: true
-- 
2.34.1


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

* [PATCH 3/3] dt-bindings: ltk050h3146w: add compatible for LTK050H3148W-CTA6 variant
@ 2022-01-31 16:47   ` quentin.schulz
  0 siblings, 0 replies; 17+ messages in thread
From: quentin.schulz @ 2022-01-31 16:47 UTC (permalink / raw)
  Cc: devicetree, airlied, Quentin Schulz, linux-kernel, dri-devel,
	Quentin Schulz, robh+dt, thierry.reding, sam

From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

The LTK050H3148W-CTA6 is a 5.0" 720x1280 DSI display, whose driving
controller is a Himax HX8394-F, slightly different from LTK050H3146W by
its init sequence, mode details and mode flags.

Cc: Quentin Schulz <foss+kernel@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 .../devicetree/bindings/display/panel/leadtek,ltk050h3146w.yaml  | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/display/panel/leadtek,ltk050h3146w.yaml b/Documentation/devicetree/bindings/display/panel/leadtek,ltk050h3146w.yaml
index 3715882b63b6..63d2a00348e9 100644
--- a/Documentation/devicetree/bindings/display/panel/leadtek,ltk050h3146w.yaml
+++ b/Documentation/devicetree/bindings/display/panel/leadtek,ltk050h3146w.yaml
@@ -17,6 +17,7 @@ properties:
     enum:
       - leadtek,ltk050h3146w
       - leadtek,ltk050h3146w-a2
+      - leadtek,ltk050h3148w
   reg: true
   backlight: true
   reset-gpios: true
-- 
2.34.1


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

* Re: [PATCH 3/3] dt-bindings: ltk050h3146w: add compatible for LTK050H3148W-CTA6 variant
  2022-01-31 16:47   ` quentin.schulz
@ 2022-02-11 13:30     ` Rob Herring
  -1 siblings, 0 replies; 17+ messages in thread
From: Rob Herring @ 2022-02-11 13:30 UTC (permalink / raw)
  To: quentin.schulz
  Cc: thierry.reding, devicetree, linux-kernel, daniel, robh+dt, sam,
	dri-devel, Quentin Schulz, airlied

On Mon, 31 Jan 2022 17:47:23 +0100, quentin.schulz@theobroma-systems.com wrote:
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> 
> The LTK050H3148W-CTA6 is a 5.0" 720x1280 DSI display, whose driving
> controller is a Himax HX8394-F, slightly different from LTK050H3146W by
> its init sequence, mode details and mode flags.
> 
> Cc: Quentin Schulz <foss+kernel@0leil.net>
> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> ---
>  .../devicetree/bindings/display/panel/leadtek,ltk050h3146w.yaml  | 1 +
>  1 file changed, 1 insertion(+)
> 

Acked-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH 3/3] dt-bindings: ltk050h3146w: add compatible for LTK050H3148W-CTA6 variant
@ 2022-02-11 13:30     ` Rob Herring
  0 siblings, 0 replies; 17+ messages in thread
From: Rob Herring @ 2022-02-11 13:30 UTC (permalink / raw)
  To: quentin.schulz
  Cc: devicetree, airlied, linux-kernel, dri-devel, Quentin Schulz,
	robh+dt, thierry.reding, sam

On Mon, 31 Jan 2022 17:47:23 +0100, quentin.schulz@theobroma-systems.com wrote:
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> 
> The LTK050H3148W-CTA6 is a 5.0" 720x1280 DSI display, whose driving
> controller is a Himax HX8394-F, slightly different from LTK050H3146W by
> its init sequence, mode details and mode flags.
> 
> Cc: Quentin Schulz <foss+kernel@0leil.net>
> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> ---
>  .../devicetree/bindings/display/panel/leadtek,ltk050h3146w.yaml  | 1 +
>  1 file changed, 1 insertion(+)
> 

Acked-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH 1/3] drm/panel: ltk050h3146w: add mipi_dsi_device.mode_flags to of_match_data
  2022-01-31 16:47 ` quentin.schulz
@ 2022-05-03 15:23   ` Quentin Schulz
  -1 siblings, 0 replies; 17+ messages in thread
From: Quentin Schulz @ 2022-05-03 15:23 UTC (permalink / raw)
  Cc: thierry.reding, sam, airlied, daniel, robh+dt, dri-devel,
	devicetree, linux-kernel, Quentin Schulz

Hi all,

Seems I'm not the only one who forgot about this patch series, so, 
kindly pinging :)

Thanks!
Quentin

On 1/31/22 17:47, quentin.schulz@theobroma-systems.com wrote:
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> 
> To prepare for a new display to be supported by this driver which has a
> slightly different set of DSI mode related flags, let's move the
> currently hardcoded mode flags to the .data field of of_device_id
> structure.
> 
> Cc: Quentin Schulz <foss+kernel@0leil.net>
> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> ---
>   drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
> index a5a414920430..67eb474e28c6 100644
> --- a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
> +++ b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
> @@ -25,6 +25,7 @@ struct ltk050h3146w_cmd {
>   
>   struct ltk050h3146w;
>   struct ltk050h3146w_desc {
> +	const unsigned long mode_flags;
>   	const struct drm_display_mode *mode;
>   	int (*init)(struct ltk050h3146w *ctx);
>   };
> @@ -339,6 +340,8 @@ static const struct drm_display_mode ltk050h3146w_mode = {
>   static const struct ltk050h3146w_desc ltk050h3146w_data = {
>   	.mode = &ltk050h3146w_mode,
>   	.init = ltk050h3146w_init_sequence,
> +	.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
> +		MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET,
>   };
>   
>   static int ltk050h3146w_a2_select_page(struct ltk050h3146w *ctx, int page)
> @@ -433,6 +436,8 @@ static const struct drm_display_mode ltk050h3146w_a2_mode = {
>   static const struct ltk050h3146w_desc ltk050h3146w_a2_data = {
>   	.mode = &ltk050h3146w_a2_mode,
>   	.init = ltk050h3146w_a2_init_sequence,
> +	.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
> +		MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET,
>   };
>   
>   static int ltk050h3146w_unprepare(struct drm_panel *panel)
> @@ -592,8 +597,7 @@ static int ltk050h3146w_probe(struct mipi_dsi_device *dsi)
>   
>   	dsi->lanes = 4;
>   	dsi->format = MIPI_DSI_FMT_RGB888;
> -	dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
> -			  MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET;
> +	dsi->mode_flags = ctx->panel_desc->mode_flags;
>   
>   	drm_panel_init(&ctx->panel, &dsi->dev, &ltk050h3146w_funcs,
>   		       DRM_MODE_CONNECTOR_DSI);

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

* Re: [PATCH 1/3] drm/panel: ltk050h3146w: add mipi_dsi_device.mode_flags to of_match_data
@ 2022-05-03 15:23   ` Quentin Schulz
  0 siblings, 0 replies; 17+ messages in thread
From: Quentin Schulz @ 2022-05-03 15:23 UTC (permalink / raw)
  Cc: devicetree, airlied, linux-kernel, dri-devel, Quentin Schulz,
	robh+dt, thierry.reding, sam

Hi all,

Seems I'm not the only one who forgot about this patch series, so, 
kindly pinging :)

Thanks!
Quentin

On 1/31/22 17:47, quentin.schulz@theobroma-systems.com wrote:
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> 
> To prepare for a new display to be supported by this driver which has a
> slightly different set of DSI mode related flags, let's move the
> currently hardcoded mode flags to the .data field of of_device_id
> structure.
> 
> Cc: Quentin Schulz <foss+kernel@0leil.net>
> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> ---
>   drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
> index a5a414920430..67eb474e28c6 100644
> --- a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
> +++ b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
> @@ -25,6 +25,7 @@ struct ltk050h3146w_cmd {
>   
>   struct ltk050h3146w;
>   struct ltk050h3146w_desc {
> +	const unsigned long mode_flags;
>   	const struct drm_display_mode *mode;
>   	int (*init)(struct ltk050h3146w *ctx);
>   };
> @@ -339,6 +340,8 @@ static const struct drm_display_mode ltk050h3146w_mode = {
>   static const struct ltk050h3146w_desc ltk050h3146w_data = {
>   	.mode = &ltk050h3146w_mode,
>   	.init = ltk050h3146w_init_sequence,
> +	.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
> +		MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET,
>   };
>   
>   static int ltk050h3146w_a2_select_page(struct ltk050h3146w *ctx, int page)
> @@ -433,6 +436,8 @@ static const struct drm_display_mode ltk050h3146w_a2_mode = {
>   static const struct ltk050h3146w_desc ltk050h3146w_a2_data = {
>   	.mode = &ltk050h3146w_a2_mode,
>   	.init = ltk050h3146w_a2_init_sequence,
> +	.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
> +		MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET,
>   };
>   
>   static int ltk050h3146w_unprepare(struct drm_panel *panel)
> @@ -592,8 +597,7 @@ static int ltk050h3146w_probe(struct mipi_dsi_device *dsi)
>   
>   	dsi->lanes = 4;
>   	dsi->format = MIPI_DSI_FMT_RGB888;
> -	dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
> -			  MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET;
> +	dsi->mode_flags = ctx->panel_desc->mode_flags;
>   
>   	drm_panel_init(&ctx->panel, &dsi->dev, &ltk050h3146w_funcs,
>   		       DRM_MODE_CONNECTOR_DSI);

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

* Re: [PATCH 1/3] drm/panel: ltk050h3146w: add mipi_dsi_device.mode_flags to of_match_data
  2022-01-31 16:47 ` quentin.schulz
                   ` (3 preceding siblings ...)
  (?)
@ 2022-06-09  8:50 ` Paul Kocialkowski
  -1 siblings, 0 replies; 17+ messages in thread
From: Paul Kocialkowski @ 2022-06-09  8:50 UTC (permalink / raw)
  To: quentin.schulz
  Cc: devicetree, airlied, linux-kernel, dri-devel, Quentin Schulz,
	robh+dt, thierry.reding, sam

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

Hi,

On Mon 31 Jan 22, 17:47, quentin.schulz@theobroma-systems.com wrote:
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> 
> To prepare for a new display to be supported by this driver which has a
> slightly different set of DSI mode related flags, let's move the
> currently hardcoded mode flags to the .data field of of_device_id
> structure.
> 
> Cc: Quentin Schulz <foss+kernel@0leil.net>
> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>

LGTM:

Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>

Cheers,

Paul

> ---
>  drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
> index a5a414920430..67eb474e28c6 100644
> --- a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
> +++ b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
> @@ -25,6 +25,7 @@ struct ltk050h3146w_cmd {
>  
>  struct ltk050h3146w;
>  struct ltk050h3146w_desc {
> +	const unsigned long mode_flags;
>  	const struct drm_display_mode *mode;
>  	int (*init)(struct ltk050h3146w *ctx);
>  };
> @@ -339,6 +340,8 @@ static const struct drm_display_mode ltk050h3146w_mode = {
>  static const struct ltk050h3146w_desc ltk050h3146w_data = {
>  	.mode = &ltk050h3146w_mode,
>  	.init = ltk050h3146w_init_sequence,
> +	.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
> +		MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET,
>  };
>  
>  static int ltk050h3146w_a2_select_page(struct ltk050h3146w *ctx, int page)
> @@ -433,6 +436,8 @@ static const struct drm_display_mode ltk050h3146w_a2_mode = {
>  static const struct ltk050h3146w_desc ltk050h3146w_a2_data = {
>  	.mode = &ltk050h3146w_a2_mode,
>  	.init = ltk050h3146w_a2_init_sequence,
> +	.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
> +		MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET,
>  };
>  
>  static int ltk050h3146w_unprepare(struct drm_panel *panel)
> @@ -592,8 +597,7 @@ static int ltk050h3146w_probe(struct mipi_dsi_device *dsi)
>  
>  	dsi->lanes = 4;
>  	dsi->format = MIPI_DSI_FMT_RGB888;
> -	dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
> -			  MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET;
> +	dsi->mode_flags = ctx->panel_desc->mode_flags;
>  
>  	drm_panel_init(&ctx->panel, &dsi->dev, &ltk050h3146w_funcs,
>  		       DRM_MODE_CONNECTOR_DSI);
> -- 
> 2.34.1
> 

-- 
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

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

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

* Re: [PATCH 2/3] drm/panel: ltk050h3146w: add support for Leadtek LTK050H3148W-CTA6 variant
  2022-01-31 16:47   ` quentin.schulz
  (?)
@ 2022-06-09  8:51   ` Paul Kocialkowski
  -1 siblings, 0 replies; 17+ messages in thread
From: Paul Kocialkowski @ 2022-06-09  8:51 UTC (permalink / raw)
  To: quentin.schulz
  Cc: devicetree, airlied, linux-kernel, dri-devel, Quentin Schulz,
	robh+dt, thierry.reding, Klaus Goger, sam

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

Hi,

On Mon 31 Jan 22, 17:47, quentin.schulz@theobroma-systems.com wrote:
> From: Klaus Goger <klaus.goger@theobroma-systems.com>
> 
> The LTK050H3148W-CTA6 is a 5.0" 720x1280 DSI display, whose driving
> controller is a Himax HX8394-F, slightly different from LTK050H3146W by
> its init sequence, mode details and mode flags.
> 
> Cc: Quentin Schulz <foss+kernel@0leil.net>
> Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>

Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>

Cheers,

Paul

> ---
>  .../drm/panel/panel-leadtek-ltk050h3146w.c    | 87 +++++++++++++++++++
>  1 file changed, 87 insertions(+)
> 
> diff --git a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
> index 67eb474e28c6..3be815c3be68 100644
> --- a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
> +++ b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c
> @@ -253,6 +253,89 @@ struct ltk050h3146w *panel_to_ltk050h3146w(struct drm_panel *panel)
>  			return ret;					\
>  	} while (0)
>  
> +static int ltk050h3148w_init_sequence(struct ltk050h3146w *ctx)
> +{
> +	struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
> +	int ret;
> +
> +	/*
> +	 * Init sequence was supplied by the panel vendor without much
> +	 * documentation.
> +	 */
> +	dsi_dcs_write_seq(dsi, 0xb9, 0xff, 0x83, 0x94);
> +	dsi_dcs_write_seq(dsi, 0xb1, 0x50, 0x15, 0x75, 0x09, 0x32, 0x44, 0x71,
> +			  0x31, 0x55, 0x2f);
> +	dsi_dcs_write_seq(dsi, 0xba, 0x63, 0x03, 0x68, 0x6b, 0xb2, 0xc0);
> +	dsi_dcs_write_seq(dsi, 0xd2, 0x88);
> +	dsi_dcs_write_seq(dsi, 0xb2, 0x00, 0x80, 0x64, 0x10, 0x07);
> +	dsi_dcs_write_seq(dsi, 0xb4, 0x05, 0x70, 0x05, 0x70, 0x01, 0x70, 0x01,
> +			  0x0c, 0x86, 0x75, 0x00, 0x3f, 0x01, 0x74, 0x01, 0x74,
> +			  0x01, 0x74, 0x01, 0x0c, 0x86);
> +	dsi_dcs_write_seq(dsi, 0xd3, 0x00, 0x00, 0x07, 0x07, 0x40, 0x1e, 0x08,
> +			  0x00, 0x32, 0x10, 0x08, 0x00, 0x08, 0x54, 0x15, 0x10,
> +			  0x05, 0x04, 0x02, 0x12, 0x10, 0x05, 0x07, 0x33, 0x34,
> +			  0x0c, 0x0c, 0x37, 0x10, 0x07, 0x17, 0x11, 0x40);
> +	dsi_dcs_write_seq(dsi, 0xd5, 0x19, 0x19, 0x18, 0x18, 0x1b, 0x1b, 0x1a,
> +			  0x1a, 0x04, 0x05, 0x06, 0x07, 0x00, 0x01, 0x02, 0x03,
> +			  0x20, 0x21, 0x18, 0x18, 0x22, 0x23, 0x18, 0x18, 0x18,
> +			  0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
> +			  0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
> +			  0x18);
> +	 dsi_dcs_write_seq(dsi, 0xd6, 0x18, 0x18, 0x19, 0x19, 0x1b, 0x1b, 0x1a,
> +			   0x1a, 0x03, 0x02, 0x01, 0x00, 0x07, 0x06, 0x05, 0x04,
> +			   0x23, 0x22, 0x18, 0x18, 0x21, 0x20, 0x18, 0x18, 0x18,
> +			   0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
> +			   0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
> +			   0x18);
> +	dsi_dcs_write_seq(dsi, 0xe0, 0x00, 0x03, 0x09, 0x11, 0x11, 0x14, 0x18,
> +			  0x16, 0x2e, 0x3d, 0x4d, 0x4d, 0x58, 0x6c, 0x72, 0x78,
> +			  0x88, 0x8b, 0x86, 0xa4, 0xb2, 0x58, 0x55, 0x59, 0x5b,
> +			  0x5d, 0x60, 0x64, 0x7f, 0x00, 0x03, 0x09, 0x0f, 0x11,
> +			  0x14, 0x18, 0x16, 0x2e, 0x3d, 0x4d, 0x4d, 0x58, 0x6d,
> +			  0x73, 0x78, 0x88, 0x8b, 0x87, 0xa5, 0xb2, 0x58, 0x55,
> +			  0x58, 0x5b, 0x5d, 0x61, 0x65, 0x7f);
> +	dsi_dcs_write_seq(dsi, 0xcc, 0x0b);
> +	dsi_dcs_write_seq(dsi, 0xc0, 0x1f, 0x31);
> +	dsi_dcs_write_seq(dsi, 0xb6, 0xc4, 0xc4);
> +	dsi_dcs_write_seq(dsi, 0xbd, 0x01);
> +	dsi_dcs_write_seq(dsi, 0xb1, 0x00);
> +	dsi_dcs_write_seq(dsi, 0xbd, 0x00);
> +	dsi_dcs_write_seq(dsi, 0xc6, 0xef);
> +	dsi_dcs_write_seq(dsi, 0xd4, 0x02);
> +	dsi_dcs_write_seq(dsi, 0x11);
> +	dsi_dcs_write_seq(dsi, 0x29);
> +
> +	ret = mipi_dsi_dcs_set_tear_on(dsi, 1);
> +	if (ret < 0) {
> +		dev_err(ctx->dev, "failed to set tear on: %d\n", ret);
> +		return ret;
> +	}
> +
> +	msleep(60);
> +
> +	return 0;
> +}
> +
> +static const struct drm_display_mode ltk050h3148w_mode = {
> +	.hdisplay	= 720,
> +	.hsync_start	= 720 + 12,
> +	.hsync_end	= 720 + 12 + 6,
> +	.htotal		= 720 + 12 + 6 + 24,
> +	.vdisplay	= 1280,
> +	.vsync_start	= 1280 + 9,
> +	.vsync_end	= 1280 + 9 + 2,
> +	.vtotal		= 1280 + 9 + 2 + 16,
> +	.clock		= 59756,
> +	.width_mm	= 62,
> +	.height_mm	= 110,
> +};
> +
> +static const struct ltk050h3146w_desc ltk050h3148w_data = {
> +	.mode = &ltk050h3148w_mode,
> +	.init = ltk050h3148w_init_sequence,
> +	.mode_flags = MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
> +};
> +
>  static int ltk050h3146w_init_sequence(struct ltk050h3146w *ctx)
>  {
>  	struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
> @@ -657,6 +740,10 @@ static const struct of_device_id ltk050h3146w_of_match[] = {
>  		.compatible = "leadtek,ltk050h3146w-a2",
>  		.data = &ltk050h3146w_a2_data,
>  	},
> +	{
> +		.compatible = "leadtek,ltk050h3148w",
> +		.data = &ltk050h3148w_data,
> +	},
>  	{ /* sentinel */ }
>  };
>  MODULE_DEVICE_TABLE(of, ltk050h3146w_of_match);
> -- 
> 2.34.1
> 

-- 
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

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

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

* Re: [PATCH 3/3] dt-bindings: ltk050h3146w: add compatible for LTK050H3148W-CTA6 variant
  2022-01-31 16:47   ` quentin.schulz
  (?)
  (?)
@ 2022-06-09  8:52   ` Paul Kocialkowski
  -1 siblings, 0 replies; 17+ messages in thread
From: Paul Kocialkowski @ 2022-06-09  8:52 UTC (permalink / raw)
  To: quentin.schulz
  Cc: devicetree, airlied, linux-kernel, dri-devel, Quentin Schulz,
	robh+dt, thierry.reding, sam

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

Hi,

On Mon 31 Jan 22, 17:47, quentin.schulz@theobroma-systems.com wrote:
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> 
> The LTK050H3148W-CTA6 is a 5.0" 720x1280 DSI display, whose driving
> controller is a Himax HX8394-F, slightly different from LTK050H3146W by
> its init sequence, mode details and mode flags.

No difference needed in the binding at all then, I suppose.

> Cc: Quentin Schulz <foss+kernel@0leil.net>
> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>

Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>

Cheers,

Paul

> ---
>  .../devicetree/bindings/display/panel/leadtek,ltk050h3146w.yaml  | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/display/panel/leadtek,ltk050h3146w.yaml b/Documentation/devicetree/bindings/display/panel/leadtek,ltk050h3146w.yaml
> index 3715882b63b6..63d2a00348e9 100644
> --- a/Documentation/devicetree/bindings/display/panel/leadtek,ltk050h3146w.yaml
> +++ b/Documentation/devicetree/bindings/display/panel/leadtek,ltk050h3146w.yaml
> @@ -17,6 +17,7 @@ properties:
>      enum:
>        - leadtek,ltk050h3146w
>        - leadtek,ltk050h3146w-a2
> +      - leadtek,ltk050h3148w
>    reg: true
>    backlight: true
>    reset-gpios: true
> -- 
> 2.34.1
> 

-- 
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

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

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

* Re: [PATCH 1/3] drm/panel: ltk050h3146w: add mipi_dsi_device.mode_flags to of_match_data
  2022-01-31 16:47 ` quentin.schulz
@ 2023-10-10 16:54   ` Heiko Stuebner
  -1 siblings, 0 replies; 17+ messages in thread
From: Heiko Stuebner @ 2023-10-10 16:54 UTC (permalink / raw)
  To: quentin.schulz
  Cc: Heiko Stuebner, thierry.reding, airlied, sam, robh+dt, dri-devel,
	devicetree, linux-kernel, Quentin Schulz, daniel

On Mon, 31 Jan 2022 17:47:21 +0100, quentin.schulz@theobroma-systems.com wrote:
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> 
> To prepare for a new display to be supported by this driver which has a
> slightly different set of DSI mode related flags, let's move the
> currently hardcoded mode flags to the .data field of of_device_id
> structure.
> 
> [...]

Applied, thanks!

[1/3] drm/panel: ltk050h3146w: add mipi_dsi_device.mode_flags to of_match_data
      commit: 99403d747ae8c7b3bfb5cd14c8908930ec6801c6
[2/3] drm/panel: ltk050h3146w: add support for Leadtek LTK050H3148W-CTA6 variant
      commit: e5f9d543419c78ac58f3b3557bc5a76b20ff600b
[3/3] dt-bindings: ltk050h3146w: add compatible for LTK050H3148W-CTA6 variant
      commit: 29d8e38c36cb662331a833699c359ec1af1edbec

Best regards,
-- 
Heiko Stuebner <heiko@sntech.de>

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

* Re: [PATCH 1/3] drm/panel: ltk050h3146w: add mipi_dsi_device.mode_flags to of_match_data
@ 2023-10-10 16:54   ` Heiko Stuebner
  0 siblings, 0 replies; 17+ messages in thread
From: Heiko Stuebner @ 2023-10-10 16:54 UTC (permalink / raw)
  To: quentin.schulz
  Cc: devicetree, Quentin Schulz, airlied, linux-kernel, dri-devel,
	robh+dt, thierry.reding, sam

On Mon, 31 Jan 2022 17:47:21 +0100, quentin.schulz@theobroma-systems.com wrote:
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> 
> To prepare for a new display to be supported by this driver which has a
> slightly different set of DSI mode related flags, let's move the
> currently hardcoded mode flags to the .data field of of_device_id
> structure.
> 
> [...]

Applied, thanks!

[1/3] drm/panel: ltk050h3146w: add mipi_dsi_device.mode_flags to of_match_data
      commit: 99403d747ae8c7b3bfb5cd14c8908930ec6801c6
[2/3] drm/panel: ltk050h3146w: add support for Leadtek LTK050H3148W-CTA6 variant
      commit: e5f9d543419c78ac58f3b3557bc5a76b20ff600b
[3/3] dt-bindings: ltk050h3146w: add compatible for LTK050H3148W-CTA6 variant
      commit: 29d8e38c36cb662331a833699c359ec1af1edbec

Best regards,
-- 
Heiko Stuebner <heiko@sntech.de>

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

* Re: [PATCH 1/3] drm/panel: ltk050h3146w: add mipi_dsi_device.mode_flags to of_match_data
  2023-10-10 16:54   ` Heiko Stuebner
@ 2023-10-10 16:55     ` Heiko Stübner
  -1 siblings, 0 replies; 17+ messages in thread
From: Heiko Stübner @ 2023-10-10 16:55 UTC (permalink / raw)
  To: quentin.schulz
  Cc: thierry.reding, airlied, sam, robh+dt, dri-devel, devicetree,
	linux-kernel, Quentin Schulz, daniel

Am Dienstag, 10. Oktober 2023, 18:54:11 CEST schrieb Heiko Stuebner:
> On Mon, 31 Jan 2022 17:47:21 +0100, quentin.schulz@theobroma-systems.com wrote:
> > From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> > 
> > To prepare for a new display to be supported by this driver which has a
> > slightly different set of DSI mode related flags, let's move the
> > currently hardcoded mode flags to the .data field of of_device_id
> > structure.
> > 
> > [...]
> 
> Applied, thanks!
> 
> [1/3] drm/panel: ltk050h3146w: add mipi_dsi_device.mode_flags to of_match_data
>       commit: 99403d747ae8c7b3bfb5cd14c8908930ec6801c6
> [2/3] drm/panel: ltk050h3146w: add support for Leadtek LTK050H3148W-CTA6 variant
>       commit: e5f9d543419c78ac58f3b3557bc5a76b20ff600b
> [3/3] dt-bindings: ltk050h3146w: add compatible for LTK050H3148W-CTA6 variant
>       commit: 29d8e38c36cb662331a833699c359ec1af1edbec

forgot to add, I included the move to the generic mipi_dsi_dcs_write_seq()
for the new sequence.





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

* Re: [PATCH 1/3] drm/panel: ltk050h3146w: add mipi_dsi_device.mode_flags to of_match_data
@ 2023-10-10 16:55     ` Heiko Stübner
  0 siblings, 0 replies; 17+ messages in thread
From: Heiko Stübner @ 2023-10-10 16:55 UTC (permalink / raw)
  To: quentin.schulz
  Cc: devicetree, Quentin Schulz, airlied, linux-kernel, dri-devel,
	robh+dt, thierry.reding, sam

Am Dienstag, 10. Oktober 2023, 18:54:11 CEST schrieb Heiko Stuebner:
> On Mon, 31 Jan 2022 17:47:21 +0100, quentin.schulz@theobroma-systems.com wrote:
> > From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> > 
> > To prepare for a new display to be supported by this driver which has a
> > slightly different set of DSI mode related flags, let's move the
> > currently hardcoded mode flags to the .data field of of_device_id
> > structure.
> > 
> > [...]
> 
> Applied, thanks!
> 
> [1/3] drm/panel: ltk050h3146w: add mipi_dsi_device.mode_flags to of_match_data
>       commit: 99403d747ae8c7b3bfb5cd14c8908930ec6801c6
> [2/3] drm/panel: ltk050h3146w: add support for Leadtek LTK050H3148W-CTA6 variant
>       commit: e5f9d543419c78ac58f3b3557bc5a76b20ff600b
> [3/3] dt-bindings: ltk050h3146w: add compatible for LTK050H3148W-CTA6 variant
>       commit: 29d8e38c36cb662331a833699c359ec1af1edbec

forgot to add, I included the move to the generic mipi_dsi_dcs_write_seq()
for the new sequence.





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

end of thread, other threads:[~2023-10-10 16:56 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-31 16:47 [PATCH 1/3] drm/panel: ltk050h3146w: add mipi_dsi_device.mode_flags to of_match_data quentin.schulz
2022-01-31 16:47 ` quentin.schulz
2022-01-31 16:47 ` [PATCH 2/3] drm/panel: ltk050h3146w: add support for Leadtek LTK050H3148W-CTA6 variant quentin.schulz
2022-01-31 16:47   ` quentin.schulz
2022-06-09  8:51   ` Paul Kocialkowski
2022-01-31 16:47 ` [PATCH 3/3] dt-bindings: ltk050h3146w: add compatible for " quentin.schulz
2022-01-31 16:47   ` quentin.schulz
2022-02-11 13:30   ` Rob Herring
2022-02-11 13:30     ` Rob Herring
2022-06-09  8:52   ` Paul Kocialkowski
2022-05-03 15:23 ` [PATCH 1/3] drm/panel: ltk050h3146w: add mipi_dsi_device.mode_flags to of_match_data Quentin Schulz
2022-05-03 15:23   ` Quentin Schulz
2022-06-09  8:50 ` Paul Kocialkowski
2023-10-10 16:54 ` Heiko Stuebner
2023-10-10 16:54   ` Heiko Stuebner
2023-10-10 16:55   ` Heiko Stübner
2023-10-10 16:55     ` Heiko Stübner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.