Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <qijian.guo@nxp.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://patch.msgid.link/20260115024004.660986-2-marek.vasut+renesas@mailbox.org
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>

authored by

Marek Vasut and committed by
Luca Ceresoli
fca11428 2befa640

+6 -1
+6 -1
drivers/gpu/drm/bridge/waveshare-dsi.c
··· 66 66 dsi->mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | 67 67 MIPI_DSI_CLOCK_NON_CONTINUOUS; 68 68 dsi->format = MIPI_DSI_FMT_RGB888; 69 - dsi->lanes = 2; 69 + dsi->lanes = drm_of_get_data_lanes_count_ep(dev->of_node, 0, 0, 1, 4); 70 + if (dsi->lanes < 0) { 71 + dev_warn(dev, "Invalid or missing DSI lane count %d, falling back to 2 lanes\n", 72 + dsi->lanes); 73 + dsi->lanes = 2; /* Old DT backward compatibility */ 74 + } 70 75 71 76 ret = devm_mipi_dsi_attach(dev, dsi); 72 77 if (ret < 0)