From: Marek Vasut Date: Thu, 15 Jan 2026 02:39:43 +0000 (+0100) Subject: drm/bridge: waveshare-dsi: Add support for 1..4 DSI data lanes X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fca11428425e92bf21d4a7f5865708c5e64430e4;p=thirdparty%2Fkernel%2Flinux.git drm/bridge: waveshare-dsi: Add support for 1..4 DSI data lanes Parse the data lane count out of DT. Limit the supported data lanes to 1..4 which is the maximum available DSI pairs on the connector of any known panels which may use this bridge. Internally, this bridge is an ChipOne ICN6211 which loads its register configuration from a dedicated storage and its I2C does not seem to be accessible. The ICN6211 also supports up to 4 DSI lanes, so this is a hard limit. To avoid any breakage on old DTs where the parsing of data lanes from DT may fail, fall back to the original hard-coded value of 2 lanes and warn user. The lane configuration is preconfigured in the bridge for each of the WaveShare panels. The 13.3" DSI panel works with 4-lane configuration, others seem to use 2-lane configuration. This is a hardware property, so the actual count should come from DT. Reviewed-by: Joseph Guo Signed-off-by: Marek Vasut Reviewed-by: Luca Ceresoli Link: https://patch.msgid.link/20260115024004.660986-2-marek.vasut+renesas@mailbox.org Signed-off-by: Luca Ceresoli --- diff --git a/drivers/gpu/drm/bridge/waveshare-dsi.c b/drivers/gpu/drm/bridge/waveshare-dsi.c index 9254446f54958..0497c7ecbc7a5 100644 --- a/drivers/gpu/drm/bridge/waveshare-dsi.c +++ b/drivers/gpu/drm/bridge/waveshare-dsi.c @@ -66,7 +66,12 @@ static int ws_bridge_attach_dsi(struct ws_bridge *ws) dsi->mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS; dsi->format = MIPI_DSI_FMT_RGB888; - dsi->lanes = 2; + dsi->lanes = drm_of_get_data_lanes_count_ep(dev->of_node, 0, 0, 1, 4); + if (dsi->lanes < 0) { + dev_warn(dev, "Invalid or missing DSI lane count %d, falling back to 2 lanes\n", + dsi->lanes); + dsi->lanes = 2; /* Old DT backward compatibility */ + } ret = devm_mipi_dsi_attach(dev, dsi); if (ret < 0)