[PATCH v3 2/3] drm/panel: ilitek-ili9881c: Add support for two-lane configuration
From: Kory Maincent
Date: Fri Dec 04 2026 - 12:15:25 EST
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@xxxxxxxxxxx>
---
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