* [PATCH v3 0/3] Add support for Saef SFTO340XC panel.
@ 2026-12-04 17:14 Kory Maincent
2026-12-04 17:14 ` [PATCH v3 1/3] dt-bindings: ili9881c: Add Saef SFTO340XC support Kory Maincent
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Kory Maincent @ 2026-12-04 17:14 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: Kory Maincent, luca.ceresoli, Thomas Petazzoni, dri-devel,
linux-kernel, devicetree, Conor Dooley, Dmitry Baryshkov
Add support for Saef Technology Limited SFTO340XC LCD panel.
Add alongside the number of lanes configuration in the ili9881c driver
as the board on my desc use the panel with only two lanes.
Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
---
Changes in v3:
- Remove the patch trying to fix panel-common binding as it was not the
right fix.
- Read the number of lanes from the data-lanes property of the remote
- Link to v2: https://lore.kernel.org/r/20250424-feature_sfto340xc-v2-0-ff7da6192df2@bootlin.com
Changes in v2:
- Add new patch trying to fix panel-common binding.
- Read the data-lanes parameter from the port endpoint and use
drm_of_get_data_lanes_count instead of of_property_read_u32.
- Link to v1: https://lore.kernel.org/r/20250408-feature_sfto340xc-v1-0-f303d1b9a996@bootlin.com
To: Neil Armstrong <neil.armstrong@linaro.org>
To: Jessica Zhang <jesszhan0024@gmail.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Maxime Ripard <mripard@kernel.org>
To: Thomas Zimmermann <tzimmermann@suse.de>
To: David Airlie <airlied@gmail.com>
To: Simona Vetter <simona@ffwll.ch>
To: Rob Herring <robh@kernel.org>
To: Krzysztof Kozlowski <krzk+dt@kernel.org>
To: Conor Dooley <conor+dt@kernel.org>
Cc: luca.ceresoli@bootlin.com
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org
Cc: devicetree@vger.kernel.org
---
Kory Maincent (3):
dt-bindings: ili9881c: Add Saef SFTO340XC support
drm/panel: ilitek-ili9881c: Add support for two-lane configuration
drm/panel: ilitek-ili9881c: Add Saef SFTO340XC LCD panel
.../bindings/display/panel/ilitek,ili9881c.yaml | 1 +
drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 261 ++++++++++++++++++++-
2 files changed, 258 insertions(+), 4 deletions(-)
---
base-commit: 92722c4470ba3407aceacbe7ef1a489ae72477d7
change-id: 20250129-feature_sfto340xc-d2b25a5b5748
Best regards,
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v3 1/3] dt-bindings: ili9881c: Add Saef SFTO340XC support
2026-12-04 17:14 [PATCH v3 0/3] Add support for Saef SFTO340XC panel Kory Maincent
@ 2026-12-04 17:14 ` Kory Maincent
2026-12-04 17:14 ` [PATCH v3 2/3] drm/panel: ilitek-ili9881c: Add support for two-lane configuration Kory Maincent
2026-12-04 17:14 ` [PATCH v3 3/3] drm/panel: ilitek-ili9881c: Add Saef SFTO340XC LCD panel Kory Maincent
2 siblings, 0 replies; 8+ messages in thread
From: Kory Maincent @ 2026-12-04 17:14 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: Kory Maincent, luca.ceresoli, Thomas Petazzoni, dri-devel,
linux-kernel, devicetree, Conor Dooley
Document the compatible value for Saef SFTO340XC panels.
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
---
Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml b/Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml
index 616cf988efa1d..b28a990a4cb88 100644
--- a/Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml
+++ b/Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml
@@ -24,6 +24,7 @@ properties:
- mingjun,mj070bi30ia2
- raspberrypi,dsi-5inch
- raspberrypi,dsi-7inch
+ - saef,sfto340xc
- startek,kd050hdfia020
- tdo,tl050hdv35
- waveshare,7.0-dsi-touch-a
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v3 2/3] drm/panel: ilitek-ili9881c: Add support for two-lane configuration
2026-12-04 17:14 [PATCH v3 0/3] Add support for Saef SFTO340XC panel Kory Maincent
2026-12-04 17:14 ` [PATCH v3 1/3] dt-bindings: ili9881c: Add Saef SFTO340XC support Kory Maincent
@ 2026-12-04 17:14 ` Kory Maincent
2026-12-04 17:28 ` sashiko-bot
2026-12-04 17:14 ` [PATCH v3 3/3] drm/panel: ilitek-ili9881c: Add Saef SFTO340XC LCD panel Kory Maincent
2 siblings, 1 reply; 8+ messages in thread
From: Kory Maincent @ 2026-12-04 17:14 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: Kory Maincent, luca.ceresoli, Thomas Petazzoni, dri-devel,
linux-kernel, devicetree
Enable support for two-lane configuration which is done by setting the
LANSEL_SW_EN and LANSEL_SW bits in the Pad Control register.
Allow panel descriptions to omit the number of lanes, in which case the
number of lanes is read from the data-lanes property of the remote (DSI
host side) endpoint.
Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
---
drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 29 +++++++++++++++++++++++----
1 file changed, 25 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
index 0854c4cf7ebd7..a858830c9f520 100644
--- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
+++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
@@ -2612,6 +2612,16 @@ static void ili9881c_send_cmd_data(struct mipi_dsi_multi_context *mctx, u8 cmd,
mipi_dsi_dcs_write_buffer_multi(mctx, buf, sizeof(buf));
}
+static void ili9881c_set_lanes_cfg(struct mipi_dsi_multi_context *mctx)
+{
+ if (mctx->dsi->lanes != 2)
+ return;
+
+ ili9881c_switch_page(mctx, 1);
+
+ ili9881c_send_cmd_data(mctx, 0xB7, 0x3);
+}
+
static int ili9881c_prepare(struct drm_panel *panel)
{
struct ili9881c *ctx = panel_to_ili9881c(panel);
@@ -2652,6 +2662,8 @@ static int ili9881c_prepare(struct drm_panel *panel)
instr->arg.cmd.data);
}
+ ili9881c_set_lanes_cfg(&mctx);
+
ili9881c_switch_page(&mctx, 0);
if (ctx->address_mode)
@@ -3012,13 +3024,22 @@ static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi)
if (ret)
return ret;
- ret = devm_drm_panel_add(&dsi->dev, &ctx->panel);
- if (ret)
- return ret;
-
dsi->mode_flags = ctx->desc->mode_flags;
dsi->format = MIPI_DSI_FMT_RGB888;
dsi->lanes = ctx->desc->lanes;
+ if (!dsi->lanes) {
+ ret = drm_of_get_data_lanes_count_remote(dsi->dev.of_node, 0, -1, 2, 4);
+ if (ret < 0)
+ dev_info(&dsi->dev, "No lanes number described");
+ else if (ret != 2 && ret != 4)
+ dev_warn(&dsi->dev, "Wrong lanes number");
+ else
+ dsi->lanes = ret;
+ }
+
+ ret = devm_drm_panel_add(&dsi->dev, &ctx->panel);
+ if (ret)
+ return ret;
return devm_mipi_dsi_attach(&dsi->dev, dsi);
}
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v3 3/3] drm/panel: ilitek-ili9881c: Add Saef SFTO340XC LCD panel
2026-12-04 17:14 [PATCH v3 0/3] Add support for Saef SFTO340XC panel Kory Maincent
2026-12-04 17:14 ` [PATCH v3 1/3] dt-bindings: ili9881c: Add Saef SFTO340XC support Kory Maincent
2026-12-04 17:14 ` [PATCH v3 2/3] drm/panel: ilitek-ili9881c: Add support for two-lane configuration Kory Maincent
@ 2026-12-04 17:14 ` Kory Maincent
2026-12-04 17:25 ` sashiko-bot
2 siblings, 1 reply; 8+ messages in thread
From: Kory Maincent @ 2026-12-04 17:14 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: Kory Maincent, luca.ceresoli, Thomas Petazzoni, dri-devel,
linux-kernel, devicetree, Dmitry Baryshkov
Add support for Saef Technology Limited SFTO340XC LCD panel.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
---
drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 232 ++++++++++++++++++++++++++
1 file changed, 232 insertions(+)
diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
index a858830c9f520..b090cb2a49725 100644
--- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
+++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
@@ -45,6 +45,7 @@ struct ili9881c_desc {
const unsigned long mode_flags;
u8 default_address_mode;
unsigned int lanes;
+ const unsigned int msleep_delay;
};
struct ili9881c {
@@ -460,6 +461,207 @@ static const struct ili9881c_instr k101_im2byl02_init[] = {
ILI9881C_COMMAND_INSTR(0xd3, 0x3f), /* VN0 */
};
+static const struct ili9881c_instr sfto340xc_init[] = {
+ ILI9881C_SWITCH_PAGE_INSTR(3),
+ ILI9881C_COMMAND_INSTR(0x01, 0x00),
+ ILI9881C_COMMAND_INSTR(0x02, 0x01),
+ ILI9881C_COMMAND_INSTR(0x03, 0x73),
+ ILI9881C_COMMAND_INSTR(0x04, 0x03),
+ ILI9881C_COMMAND_INSTR(0x05, 0x00),
+ ILI9881C_COMMAND_INSTR(0x06, 0x0A),
+ ILI9881C_COMMAND_INSTR(0x07, 0x05),
+ ILI9881C_COMMAND_INSTR(0x08, 0x00),
+ ILI9881C_COMMAND_INSTR(0x09, 0x40),
+ ILI9881C_COMMAND_INSTR(0x0a, 0x00),
+ ILI9881C_COMMAND_INSTR(0x0B, 0x00),
+ ILI9881C_COMMAND_INSTR(0x0C, 0x00),
+ ILI9881C_COMMAND_INSTR(0x0D, 0x40),
+ ILI9881C_COMMAND_INSTR(0x0E, 0x00),
+ ILI9881C_COMMAND_INSTR(0x0f, 0x3c),
+ ILI9881C_COMMAND_INSTR(0x10, 0x3c),
+ ILI9881C_COMMAND_INSTR(0x11, 0x00),
+ ILI9881C_COMMAND_INSTR(0x12, 0x00),
+ ILI9881C_COMMAND_INSTR(0x13, 0x00),
+ ILI9881C_COMMAND_INSTR(0x14, 0x00),
+ ILI9881C_COMMAND_INSTR(0x15, 0x00),
+ ILI9881C_COMMAND_INSTR(0x16, 0x00),
+ ILI9881C_COMMAND_INSTR(0x17, 0x00),
+ ILI9881C_COMMAND_INSTR(0x18, 0x00),
+ ILI9881C_COMMAND_INSTR(0x19, 0x00),
+ ILI9881C_COMMAND_INSTR(0x1A, 0x00),
+ ILI9881C_COMMAND_INSTR(0x1B, 0x00),
+ ILI9881C_COMMAND_INSTR(0x1C, 0x00),
+ ILI9881C_COMMAND_INSTR(0x1D, 0x00),
+ ILI9881C_COMMAND_INSTR(0x1E, 0xC0),
+ ILI9881C_COMMAND_INSTR(0x1F, 0x80),
+ ILI9881C_COMMAND_INSTR(0x20, 0x06),
+ ILI9881C_COMMAND_INSTR(0x21, 0x01),
+ ILI9881C_COMMAND_INSTR(0x22, 0x00),
+ ILI9881C_COMMAND_INSTR(0x23, 0x00),
+ ILI9881C_COMMAND_INSTR(0x24, 0x00),
+ ILI9881C_COMMAND_INSTR(0x25, 0x00),
+ ILI9881C_COMMAND_INSTR(0x26, 0x00),
+ ILI9881C_COMMAND_INSTR(0x27, 0x00),
+ ILI9881C_COMMAND_INSTR(0x28, 0xB3),
+ ILI9881C_COMMAND_INSTR(0x29, 0x03),
+ ILI9881C_COMMAND_INSTR(0x2A, 0x00),
+ ILI9881C_COMMAND_INSTR(0x2B, 0x00),
+ ILI9881C_COMMAND_INSTR(0x2C, 0x00),
+ ILI9881C_COMMAND_INSTR(0x2D, 0x00),
+ ILI9881C_COMMAND_INSTR(0x2E, 0x00),
+ ILI9881C_COMMAND_INSTR(0x2F, 0x00),
+ ILI9881C_COMMAND_INSTR(0x30, 0x00),
+ ILI9881C_COMMAND_INSTR(0x31, 0x00),
+ ILI9881C_COMMAND_INSTR(0x32, 0x00),
+ ILI9881C_COMMAND_INSTR(0x33, 0x00),
+ ILI9881C_COMMAND_INSTR(0x34, 0x23),
+ ILI9881C_COMMAND_INSTR(0x35, 0x00),
+ ILI9881C_COMMAND_INSTR(0x36, 0x00),
+ ILI9881C_COMMAND_INSTR(0x37, 0x08),
+ ILI9881C_COMMAND_INSTR(0x38, 0x3C),
+ ILI9881C_COMMAND_INSTR(0x39, 0x00),
+ ILI9881C_COMMAND_INSTR(0x3A, 0x00),
+ ILI9881C_COMMAND_INSTR(0x3B, 0x00),
+ ILI9881C_COMMAND_INSTR(0x3C, 0x00),
+ ILI9881C_COMMAND_INSTR(0x3D, 0x00),
+ ILI9881C_COMMAND_INSTR(0x3E, 0x00),
+ ILI9881C_COMMAND_INSTR(0x3F, 0x00),
+ ILI9881C_COMMAND_INSTR(0x40, 0x00),
+ ILI9881C_COMMAND_INSTR(0x41, 0x00),
+ ILI9881C_COMMAND_INSTR(0x42, 0x00),
+ ILI9881C_COMMAND_INSTR(0x43, 0x00),
+ ILI9881C_COMMAND_INSTR(0x44, 0x00),
+ ILI9881C_COMMAND_INSTR(0x50, 0x01),
+ ILI9881C_COMMAND_INSTR(0x51, 0x23),
+ ILI9881C_COMMAND_INSTR(0x52, 0x44),
+ ILI9881C_COMMAND_INSTR(0x53, 0x67),
+ ILI9881C_COMMAND_INSTR(0x54, 0x89),
+ ILI9881C_COMMAND_INSTR(0x55, 0xAB),
+ ILI9881C_COMMAND_INSTR(0x56, 0x01),
+ ILI9881C_COMMAND_INSTR(0x57, 0x23),
+ ILI9881C_COMMAND_INSTR(0x58, 0x45),
+ ILI9881C_COMMAND_INSTR(0x59, 0x67),
+ ILI9881C_COMMAND_INSTR(0x5A, 0x89),
+ ILI9881C_COMMAND_INSTR(0x5B, 0xAB),
+ ILI9881C_COMMAND_INSTR(0x5C, 0xCD),
+ ILI9881C_COMMAND_INSTR(0x5D, 0xEF),
+ ILI9881C_COMMAND_INSTR(0x5E, 0x01),
+ ILI9881C_COMMAND_INSTR(0x5F, 0x00),
+ ILI9881C_COMMAND_INSTR(0x60, 0x00),
+ ILI9881C_COMMAND_INSTR(0x61, 0x01),
+ ILI9881C_COMMAND_INSTR(0x62, 0x01),
+ ILI9881C_COMMAND_INSTR(0x63, 0x08),
+ ILI9881C_COMMAND_INSTR(0x64, 0x0E),
+ ILI9881C_COMMAND_INSTR(0x65, 0x0E),
+ ILI9881C_COMMAND_INSTR(0x66, 0x0F),
+ ILI9881C_COMMAND_INSTR(0x67, 0x0F),
+ ILI9881C_COMMAND_INSTR(0x68, 0x0C),
+ ILI9881C_COMMAND_INSTR(0x69, 0x0C),
+ ILI9881C_COMMAND_INSTR(0x6A, 0x0D),
+ ILI9881C_COMMAND_INSTR(0x6B, 0x0D),
+ ILI9881C_COMMAND_INSTR(0x6C, 0x02),
+ ILI9881C_COMMAND_INSTR(0x6D, 0x02),
+ ILI9881C_COMMAND_INSTR(0x6E, 0x14),
+ ILI9881C_COMMAND_INSTR(0x6F, 0x14),
+ ILI9881C_COMMAND_INSTR(0x70, 0x15),
+ ILI9881C_COMMAND_INSTR(0x71, 0x15),
+ ILI9881C_COMMAND_INSTR(0x72, 0x06),
+ ILI9881C_COMMAND_INSTR(0x73, 0x07),
+ ILI9881C_COMMAND_INSTR(0x74, 0x02),
+ ILI9881C_COMMAND_INSTR(0x75, 0x00),
+ ILI9881C_COMMAND_INSTR(0x76, 0x00),
+ ILI9881C_COMMAND_INSTR(0x77, 0x01),
+ ILI9881C_COMMAND_INSTR(0x78, 0x01),
+ ILI9881C_COMMAND_INSTR(0x79, 0x08),
+ ILI9881C_COMMAND_INSTR(0x7A, 0x0D),
+ ILI9881C_COMMAND_INSTR(0x7B, 0x0D),
+ ILI9881C_COMMAND_INSTR(0x7C, 0x0C),
+ ILI9881C_COMMAND_INSTR(0x7D, 0x0C),
+ ILI9881C_COMMAND_INSTR(0x7E, 0x0F),
+ ILI9881C_COMMAND_INSTR(0x7F, 0x0F),
+ ILI9881C_COMMAND_INSTR(0x80, 0x0E),
+ ILI9881C_COMMAND_INSTR(0x81, 0x0E),
+ ILI9881C_COMMAND_INSTR(0x82, 0x02),
+ ILI9881C_COMMAND_INSTR(0x83, 0x02),
+ ILI9881C_COMMAND_INSTR(0x84, 0x14),
+ ILI9881C_COMMAND_INSTR(0x85, 0x14),
+ ILI9881C_COMMAND_INSTR(0x86, 0x15),
+ ILI9881C_COMMAND_INSTR(0x87, 0x15),
+ ILI9881C_COMMAND_INSTR(0x88, 0x07),
+ ILI9881C_COMMAND_INSTR(0x89, 0x06),
+ ILI9881C_COMMAND_INSTR(0x8A, 0x02),
+ ILI9881C_SWITCH_PAGE_INSTR(4),
+ ILI9881C_COMMAND_INSTR(0x6C, 0x15),
+ ILI9881C_COMMAND_INSTR(0x6E, 0x1a),
+ ILI9881C_COMMAND_INSTR(0x6F, 0x35),
+ ILI9881C_COMMAND_INSTR(0x8D, 0x1f),
+ ILI9881C_COMMAND_INSTR(0x87, 0xBA),
+ ILI9881C_COMMAND_INSTR(0x26, 0x76),
+ ILI9881C_COMMAND_INSTR(0xB2, 0xD1),
+ ILI9881C_COMMAND_INSTR(0x3B, 0x98),
+ ILI9881C_COMMAND_INSTR(0x3A, 0x24),
+ ILI9881C_COMMAND_INSTR(0x35, 0x1F),
+ ILI9881C_COMMAND_INSTR(0xB5, 0x27),
+ ILI9881C_COMMAND_INSTR(0x31, 0x75),
+ ILI9881C_COMMAND_INSTR(0x30, 0x03),
+ ILI9881C_COMMAND_INSTR(0x33, 0x14),
+ ILI9881C_COMMAND_INSTR(0x38, 0x01),
+ ILI9881C_COMMAND_INSTR(0x39, 0x00),
+ ILI9881C_SWITCH_PAGE_INSTR(1),
+ ILI9881C_COMMAND_INSTR(0x22, 0x0a),
+ ILI9881C_COMMAND_INSTR(0x2E, 0x50),
+ ILI9881C_COMMAND_INSTR(0x2F, 0x00),
+ ILI9881C_COMMAND_INSTR(0x31, 0x00),
+ ILI9881C_COMMAND_INSTR(0x53, 0x4a),
+ ILI9881C_COMMAND_INSTR(0x55, 0x65),
+ ILI9881C_COMMAND_INSTR(0x50, 0xbf),
+ ILI9881C_COMMAND_INSTR(0x51, 0xbf),
+ ILI9881C_COMMAND_INSTR(0x60, 0x14),
+ ILI9881C_COMMAND_INSTR(0x61, 0x00),
+ ILI9881C_COMMAND_INSTR(0x62, 0x20),
+ ILI9881C_COMMAND_INSTR(0x63, 0x10),
+ ILI9881C_COMMAND_INSTR(0xA0, 0x04),
+ ILI9881C_COMMAND_INSTR(0xA1, 0x39),
+ ILI9881C_COMMAND_INSTR(0xA2, 0x48),
+ ILI9881C_COMMAND_INSTR(0xA3, 0x13),
+ ILI9881C_COMMAND_INSTR(0xA4, 0x17),
+ ILI9881C_COMMAND_INSTR(0xA5, 0x29),
+ ILI9881C_COMMAND_INSTR(0xA6, 0x1c),
+ ILI9881C_COMMAND_INSTR(0xA7, 0x1d),
+ ILI9881C_COMMAND_INSTR(0xA8, 0xbb),
+ ILI9881C_COMMAND_INSTR(0xA9, 0x16),
+ ILI9881C_COMMAND_INSTR(0xAA, 0x24),
+ ILI9881C_COMMAND_INSTR(0xAB, 0x9e),
+ ILI9881C_COMMAND_INSTR(0xAC, 0x16),
+ ILI9881C_COMMAND_INSTR(0xAD, 0x14),
+ ILI9881C_COMMAND_INSTR(0xAE, 0x48),
+ ILI9881C_COMMAND_INSTR(0xAF, 0x1c),
+ ILI9881C_COMMAND_INSTR(0xB0, 0x22),
+ ILI9881C_COMMAND_INSTR(0xB1, 0x51),
+ ILI9881C_COMMAND_INSTR(0xB2, 0x60),
+ ILI9881C_COMMAND_INSTR(0xB3, 0x32),
+ ILI9881C_COMMAND_INSTR(0xC0, 0x04),
+ ILI9881C_COMMAND_INSTR(0xC1, 0x39),
+ ILI9881C_COMMAND_INSTR(0xC2, 0x48),
+ ILI9881C_COMMAND_INSTR(0xC3, 0x13),
+ ILI9881C_COMMAND_INSTR(0xC4, 0x17),
+ ILI9881C_COMMAND_INSTR(0xC5, 0x29),
+ ILI9881C_COMMAND_INSTR(0xC6, 0x1c),
+ ILI9881C_COMMAND_INSTR(0xC7, 0x1d),
+ ILI9881C_COMMAND_INSTR(0xC8, 0xbb),
+ ILI9881C_COMMAND_INSTR(0xC9, 0x16),
+ ILI9881C_COMMAND_INSTR(0xCA, 0x24),
+ ILI9881C_COMMAND_INSTR(0xCB, 0x9e),
+ ILI9881C_COMMAND_INSTR(0xCC, 0x16),
+ ILI9881C_COMMAND_INSTR(0xCD, 0x14),
+ ILI9881C_COMMAND_INSTR(0xCE, 0x48),
+ ILI9881C_COMMAND_INSTR(0xCF, 0x1c),
+ ILI9881C_COMMAND_INSTR(0xD0, 0x22),
+ ILI9881C_COMMAND_INSTR(0xD1, 0x51),
+ ILI9881C_COMMAND_INSTR(0xD2, 0x60),
+ ILI9881C_COMMAND_INSTR(0xD3, 0x32),
+};
+
static const struct ili9881c_instr kd050hdfia020_init[] = {
ILI9881C_SWITCH_PAGE_INSTR(3),
ILI9881C_COMMAND_INSTR(0x01, 0x00),
@@ -2677,6 +2879,9 @@ static int ili9881c_prepare(struct drm_panel *panel)
if (mctx.accum_err)
goto disable_power;
+ if (ctx->desc->msleep_delay)
+ msleep(ctx->desc->msleep_delay);
+
return 0;
disable_power:
@@ -2736,6 +2941,23 @@ static const struct drm_display_mode k101_im2byl02_default_mode = {
.height_mm = 217,
};
+static const struct drm_display_mode sfto340xc_default_mode = {
+ .clock = 34000,
+
+ .hdisplay = 800,
+ .hsync_start = 800 + 10,
+ .hsync_end = 800 + 10 + 5,
+ .htotal = 800 + 10 + 5 + 10,
+
+ .vdisplay = 800,
+ .vsync_start = 800 + 10,
+ .vsync_end = 800 + 10 + 5,
+ .vtotal = 800 + 10 + 5 + 10,
+
+ .width_mm = 87,
+ .height_mm = 87,
+};
+
static const struct drm_display_mode kd050hdfia020_default_mode = {
.clock = 62000,
@@ -3060,6 +3282,15 @@ static const struct ili9881c_desc k101_im2byl02_desc = {
.lanes = 4,
};
+static const struct ili9881c_desc sfto340xc_desc = {
+ .init = sfto340xc_init,
+ .init_length = ARRAY_SIZE(sfto340xc_init),
+ .mode = &sfto340xc_default_mode,
+ .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
+ MIPI_DSI_MODE_LPM | MIPI_DSI_CLOCK_NON_CONTINUOUS,
+ .msleep_delay = 100,
+};
+
static const struct ili9881c_desc kd050hdfia020_desc = {
.init = kd050hdfia020_init,
.init_length = ARRAY_SIZE(kd050hdfia020_init),
@@ -3160,6 +3391,7 @@ static const struct of_device_id ili9881c_of_match[] = {
{ .compatible = "bestar,bsd1218-a101kl68", .data = &bsd1218_a101kl68_desc },
{ .compatible = "dcltek,dt300249", .data = &dt300249_desc },
{ .compatible = "feixin,k101-im2byl02", .data = &k101_im2byl02_desc },
+ { .compatible = "saef,sfto340xc", .data = &sfto340xc_desc },
{ .compatible = "startek,kd050hdfia020", .data = &kd050hdfia020_desc },
{ .compatible = "tdo,tl050hdv35", .data = &tl050hdv35_desc },
{ .compatible = "wanchanglong,w552946aaa", .data = &w552946aaa_desc },
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v3 3/3] drm/panel: ilitek-ili9881c: Add Saef SFTO340XC LCD panel
2026-12-04 17:14 ` [PATCH v3 3/3] drm/panel: ilitek-ili9881c: Add Saef SFTO340XC LCD panel Kory Maincent
@ 2026-12-04 17:25 ` sashiko-bot
2026-12-04 17:52 ` Kory Maincent
0 siblings, 1 reply; 8+ messages in thread
From: sashiko-bot @ 2026-12-04 17:25 UTC (permalink / raw)
To: Kory Maincent; +Cc: dri-devel, devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] drm/panel: ilitek-ili9881c: sfto340xc_desc allows zero-lane DSI
attach
- [Low] drm/panel: ilitek-ili9881c: ambiguous msleep_delay name and
sparse commit log
--
commit 4b933e45a7a7d06f22ea905fd9c78d336f5a6ba9
Author: Kory Maincent <kory.maincent@bootlin.com>
drm/panel: ilitek-ili9881c: Add Saef SFTO340XC LCD panel
This commit adds support for the Saef Technology Limited SFTO340XC LCD
panel to the Ilitek ILI9881C driver, including a new optional post-display-on
delay field in struct ili9881c_desc.
> diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
> index a858830c9f520..b090cb2a49725 100644
> --- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
> +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
> @@ -45,6 +45,7 @@ struct ili9881c_desc {
> const unsigned long mode_flags;
> u8 default_address_mode;
> unsigned int lanes;
> + const unsigned int msleep_delay;
> };
[Severity: Low]
This isn't a bug, but msleep_delay names the helper rather than the
transition or unit, while ili9881c_prepare() already has several other
delays; something like post_display_on_delay_ms would be clearer.
The commit message also omits this new delay field and does not explain why
the SFTO340XC panel needs a 100 ms delay after MIPI_DCS_SET_DISPLAY_ON.
[ ... ]
> @@ -3060,6 +3282,15 @@ static const struct ili9881c_desc k101_im2byl02_desc = {
> .lanes = 4,
> };
>
> +static const struct ili9881c_desc sfto340xc_desc = {
> + .init = sfto340xc_init,
> + .init_length = ARRAY_SIZE(sfto340xc_init),
> + .mode = &sfto340xc_default_mode,
> + .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
> + MIPI_DSI_MODE_LPM | MIPI_DSI_CLOCK_NON_CONTINUOUS,
> + .msleep_delay = 100,
> +};
[Severity: High]
Can leaving .lanes unset in sfto340xc_desc cause a zero-lane DSI attach?
When a DT node follows the ilitek,ili9881c.yaml binding and omits port or
remote data-lanes, drm_of_get_data_lanes_count_remote() returns an error,
but ili9881c_dsi_probe() only logs a message and still attaches the device
with dsi->lanes == 0:
drivers/gpu/drm/panel/panel-ilitek-ili9881c.c:ili9881c_dsi_probe() {
...
dsi->lanes = ctx->desc->lanes;
if (!dsi->lanes) {
ret = drm_of_get_data_lanes_count_remote(dsi->dev.of_node, 0, -1, 2, 4);
if (ret < 0)
dev_info(&dsi->dev, "No lanes number described");
else if (ret != 2 && ret != 4)
dev_warn(&dsi->dev, "Wrong lanes number");
else
dsi->lanes = ret;
}
...
return devm_mipi_dsi_attach(&dsi->dev, dsi);
}
mipi_dsi_attach() does not reject zero lanes, so DSI hosts such as
vc4_dsi_host_attach() immediately divide by zero (24 / dsi->lanes) during
attach.
Should sfto340xc_desc set .lanes explicitly, or should ili9881c_dsi_probe()
return an error (or fall back to a valid default) when a 2- or 4-lane count
cannot be obtained?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-feature_sfto340xc-v3-0-2417aeda6126@bootlin.com?part=3
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 2/3] drm/panel: ilitek-ili9881c: Add support for two-lane configuration
2026-12-04 17:14 ` [PATCH v3 2/3] drm/panel: ilitek-ili9881c: Add support for two-lane configuration Kory Maincent
@ 2026-12-04 17:28 ` sashiko-bot
2026-12-04 18:05 ` Kory Maincent
0 siblings, 1 reply; 8+ messages in thread
From: sashiko-bot @ 2026-12-04 17:28 UTC (permalink / raw)
To: Kory Maincent; +Cc: dri-devel, devicetree, robh, conor+dt
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] drm/panel: ilitek-ili9881c: ili9881c_dsi_probe() attaches with
0 lanes
- [Low] drm/panel: ilitek-ili9881c: missing newlines in
ili9881c_dsi_probe() logs
--
commit e899140e568f50f7b97bce08c9f86acfc451c3c2
Author: Kory Maincent <kory.maincent@bootlin.com>
drm/panel: ilitek-ili9881c: Add support for two-lane configuration
This commit adds support for two-lane configuration in the ILI9881c panel
driver and reads the lane count from the remote DSI endpoint when the panel
descriptor omits it.
> diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
> index 0854c4cf7ebd7..a858830c9f520 100644
> --- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
> +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
[ ... ]
> @@ -3012,13 +3024,22 @@ static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi)
> if (ret)
> return ret;
>
> - ret = devm_drm_panel_add(&dsi->dev, &ctx->panel);
> - if (ret)
> - return ret;
> -
> dsi->mode_flags = ctx->desc->mode_flags;
> dsi->format = MIPI_DSI_FMT_RGB888;
> dsi->lanes = ctx->desc->lanes;
> + if (!dsi->lanes) {
> + ret = drm_of_get_data_lanes_count_remote(dsi->dev.of_node, 0, -1, 2, 4);
> + if (ret < 0)
> + dev_info(&dsi->dev, "No lanes number described");
> + else if (ret != 2 && ret != 4)
> + dev_warn(&dsi->dev, "Wrong lanes number");
[Severity: Low]
Both dev_info() and dev_warn() strings are missing a trailing '\n', unlike
the other log messages in this driver.
> + else
> + dsi->lanes = ret;
> + }
> +
> + ret = devm_drm_panel_add(&dsi->dev, &ctx->panel);
> + if (ret)
> + return ret;
>
> return devm_mipi_dsi_attach(&dsi->dev, dsi);
> }
[Severity: High]
Can this call devm_mipi_dsi_attach() with dsi->lanes set to 0?
When ctx->desc->lanes is 0 and the remote endpoint omits data-lanes or
specifies an unsupported count such as 3, ili9881c_dsi_probe() logs a
message and falls through without setting dsi->lanes or returning an error.
DSI host drivers assume device->lanes >= 1: vc4_dsi_host_attach() divides
by dsi->lanes directly, causing a divide-by-zero oops during attach, and
dw_mipi_dsi_get_minimum_lbcc() indexes minimum_lbccs[dsi->lanes - 1],
causing an out-of-bounds read.
Also, drm_of_get_data_lanes_count_remote() returns -EINVAL for out-of-range
counts as well as missing properties, so the ret < 0 branch misreports
invalid lane counts as missing. Returning an error on both failure
branches, as jadard_dsi_probe() does, avoids attaching with zero lanes.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-feature_sfto340xc-v3-0-2417aeda6126@bootlin.com?part=2
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 3/3] drm/panel: ilitek-ili9881c: Add Saef SFTO340XC LCD panel
2026-12-04 17:25 ` sashiko-bot
@ 2026-12-04 17:52 ` Kory Maincent
0 siblings, 0 replies; 8+ messages in thread
From: Kory Maincent @ 2026-12-04 17:52 UTC (permalink / raw)
To: sashiko-reviews; +Cc: dri-devel, devicetree, robh, conor+dt
On 12/4/26 18:25, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential
> issues to consider:
> - [High] drm/panel: ilitek-ili9881c: sfto340xc_desc allows zero-lane DSI
> attach
> - [Low] drm/panel: ilitek-ili9881c: ambiguous msleep_delay name and
> sparse commit log
> --
>
> commit 4b933e45a7a7d06f22ea905fd9c78d336f5a6ba9
> Author: Kory Maincent <kory.maincent@bootlin.com>
>
> drm/panel: ilitek-ili9881c: Add Saef SFTO340XC LCD panel
>
> This commit adds support for the Saef Technology Limited SFTO340XC LCD
> panel to the Ilitek ILI9881C driver, including a new optional post-display-on
> delay field in struct ili9881c_desc.
>
>> diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
>> index a858830c9f520..b090cb2a49725 100644
>> --- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
>> +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
>> @@ -45,6 +45,7 @@ struct ili9881c_desc {
>> const unsigned long mode_flags;
>> u8 default_address_mode;
>> unsigned int lanes;
>> + const unsigned int msleep_delay;
>> };
>
> [Severity: Low]
> This isn't a bug, but msleep_delay names the helper rather than the
> transition or unit, while ili9881c_prepare() already has several other
> delays; something like post_display_on_delay_ms would be clearer.
Ok I will change its name.
> The commit message also omits this new delay field and does not explain why
> the SFTO340XC panel needs a 100 ms delay after MIPI_DCS_SET_DISPLAY_ON.
>
> [ ... ]
>
>> @@ -3060,6 +3282,15 @@ static const struct ili9881c_desc k101_im2byl02_desc = {
>> .lanes = 4,
>> };
>>
>> +static const struct ili9881c_desc sfto340xc_desc = {
>> + .init = sfto340xc_init,
>> + .init_length = ARRAY_SIZE(sfto340xc_init),
>> + .mode = &sfto340xc_default_mode,
>> + .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
>> + MIPI_DSI_MODE_LPM | MIPI_DSI_CLOCK_NON_CONTINUOUS,
>> + .msleep_delay = 100,
>> +};
>
> [Severity: High]
> Can leaving .lanes unset in sfto340xc_desc cause a zero-lane DSI attach?
No this would cause to have the default 4 lanes DSI.
> When a DT node follows the ilitek,ili9881c.yaml binding and omits port or
> remote data-lanes, drm_of_get_data_lanes_count_remote() returns an error,
> but ili9881c_dsi_probe() only logs a message and still attaches the device
> with dsi->lanes == 0:
>
> drivers/gpu/drm/panel/panel-ilitek-ili9881c.c:ili9881c_dsi_probe() {
> ...
> dsi->lanes = ctx->desc->lanes;
> if (!dsi->lanes) {
> ret = drm_of_get_data_lanes_count_remote(dsi->dev.of_node, 0, -1, 2, 4);
> if (ret < 0)
> dev_info(&dsi->dev, "No lanes number described");
> else if (ret != 2 && ret != 4)
> dev_warn(&dsi->dev, "Wrong lanes number");
> else
> dsi->lanes = ret;
> }
> ...
> return devm_mipi_dsi_attach(&dsi->dev, dsi);
> }
>
> mipi_dsi_attach() does not reject zero lanes, so DSI hosts such as
> vc4_dsi_host_attach() immediately divide by zero (24 / dsi->lanes) during
> attach.
>
> Should sfto340xc_desc set .lanes explicitly, or should ili9881c_dsi_probe()
> return an error (or fall back to a valid default) when a 2- or 4-lane count
> cannot be obtained?
A possibility would be to do the contrary, if no lanes described use the
number of lanes described in the driver descriptor.
But well what I did is the same behavior as the jadard driver:
https://elixir.bootlin.com/linux/v7.3.4/source/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c#L3200
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 2/3] drm/panel: ilitek-ili9881c: Add support for two-lane configuration
2026-12-04 17:28 ` sashiko-bot
@ 2026-12-04 18:05 ` Kory Maincent
0 siblings, 0 replies; 8+ messages in thread
From: Kory Maincent @ 2026-12-04 18:05 UTC (permalink / raw)
To: sashiko-reviews; +Cc: dri-devel, devicetree, robh, conor+dt
On 12/4/26 18:28, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential
> issues to consider:
> - [High] drm/panel: ilitek-ili9881c: ili9881c_dsi_probe() attaches with
> 0 lanes
> - [Low] drm/panel: ilitek-ili9881c: missing newlines in
> ili9881c_dsi_probe() logs
> --
>
> commit e899140e568f50f7b97bce08c9f86acfc451c3c2
> Author: Kory Maincent <kory.maincent@bootlin.com>
>
> drm/panel: ilitek-ili9881c: Add support for two-lane configuration
>
> This commit adds support for two-lane configuration in the ILI9881c panel
> driver and reads the lane count from the remote DSI endpoint when the panel
> descriptor omits it.
>
>> diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
>> index 0854c4cf7ebd7..a858830c9f520 100644
>> --- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
>> +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
>
> [ ... ]
>
>> @@ -3012,13 +3024,22 @@ static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi)
>> if (ret)
>> return ret;
>>
>> - ret = devm_drm_panel_add(&dsi->dev, &ctx->panel);
>> - if (ret)
>> - return ret;
>> -
>> dsi->mode_flags = ctx->desc->mode_flags;
>> dsi->format = MIPI_DSI_FMT_RGB888;
>> dsi->lanes = ctx->desc->lanes;
>> + if (!dsi->lanes) {
>> + ret = drm_of_get_data_lanes_count_remote(dsi->dev.of_node, 0, -1, 2, 4);
>> + if (ret < 0)
>> + dev_info(&dsi->dev, "No lanes number described");
>> + else if (ret != 2 && ret != 4)
>> + dev_warn(&dsi->dev, "Wrong lanes number");
>
> [Severity: Low]
> Both dev_info() and dev_warn() strings are missing a trailing '\n', unlike
> the other log messages in this driver.
Oops indeed.
>> + else
>> + dsi->lanes = ret;
>> + }
>> +
>> + ret = devm_drm_panel_add(&dsi->dev, &ctx->panel);
>> + if (ret)
>> + return ret;
>>
>> return devm_mipi_dsi_attach(&dsi->dev, dsi);
>> }
>
> [Severity: High]
> Can this call devm_mipi_dsi_attach() with dsi->lanes set to 0?
>
> When ctx->desc->lanes is 0 and the remote endpoint omits data-lanes or
> specifies an unsupported count such as 3, ili9881c_dsi_probe() logs a
> message and falls through without setting dsi->lanes or returning an error.
>
> DSI host drivers assume device->lanes >= 1: vc4_dsi_host_attach() divides
> by dsi->lanes directly, causing a divide-by-zero oops during attach, and
> dw_mipi_dsi_get_minimum_lbcc() indexes minimum_lbccs[dsi->lanes - 1],
> causing an out-of-bounds read.
>
> Also, drm_of_get_data_lanes_count_remote() returns -EINVAL for out-of-range
> counts as well as missing properties, so the ret < 0 branch misreports
> invalid lane counts as missing. Returning an error on both failure
> branches, as jadard_dsi_probe() does, avoids attaching with zero lanes.
I can't do that, because this will broke panel like the kd050hdfia020
which have no lanes number described in the descriptor and maybe no
data-lanes devicetree parameter.
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-12-04 18:05 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 17:14 [PATCH v3 0/3] Add support for Saef SFTO340XC panel Kory Maincent
2026-12-04 17:14 ` [PATCH v3 1/3] dt-bindings: ili9881c: Add Saef SFTO340XC support Kory Maincent
2026-12-04 17:14 ` [PATCH v3 2/3] drm/panel: ilitek-ili9881c: Add support for two-lane configuration Kory Maincent
2026-12-04 17:28 ` sashiko-bot
2026-12-04 18:05 ` Kory Maincent
2026-12-04 17:14 ` [PATCH v3 3/3] drm/panel: ilitek-ili9881c: Add Saef SFTO340XC LCD panel Kory Maincent
2026-12-04 17:25 ` sashiko-bot
2026-12-04 17:52 ` Kory Maincent
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox