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

drm/rcar-du: dsi: Fix 1/2/3 lane support

Remove fixed PPI lane count setup. The R-Car DSI host is capable
of operating in 1..4 DSI lane mode. Remove the hard-coded 4-lane
configuration from PPI register settings and instead configure
the PPI lane count according to lane count information already
obtained by this driver instance.

Configure TXSETR register to match PPI lane count. The R-Car V4H
Reference Manual R19UH0186EJ0121 Rev.1.21 section 67.2.2.3 Tx Set
Register (TXSETR), field LANECNT description indicates that the
TXSETR register LANECNT bitfield lane count must be configured
such, that it matches lane count configuration in PPISETR register
DLEN bitfield. Make sure the LANECNT and DLEN bitfields are
configured to match.

Fixes: 155358310f01 ("drm: rcar-du: Add R-Car DSI driver")
Cc: stable@vger.kernel.org
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Link: https://lore.kernel.org/r/20250813210840.97621-1-marek.vasut+renesas@mailbox.org
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

authored by

Marek Vasut and committed by
Tomi Valkeinen
d83f1d19 1c936e85

+8 -5
+4 -1
drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c
··· 576 576 udelay(10); 577 577 rcar_mipi_dsi_clr(dsi, CLOCKSET1, CLOCKSET1_UPDATEPLL); 578 578 579 - ppisetr = PPISETR_DLEN_3 | PPISETR_CLEN; 579 + rcar_mipi_dsi_clr(dsi, TXSETR, TXSETR_LANECNT_MASK); 580 + rcar_mipi_dsi_set(dsi, TXSETR, dsi->lanes - 1); 581 + 582 + ppisetr = ((BIT(dsi->lanes) - 1) & PPISETR_DLEN_MASK) | PPISETR_CLEN; 580 583 rcar_mipi_dsi_write(dsi, PPISETR, ppisetr); 581 584 582 585 rcar_mipi_dsi_set(dsi, PHYSETUP, PHYSETUP_SHUTDOWNZ);
+4 -4
drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi_regs.h
··· 12 12 #define LINKSR_LPBUSY (1 << 1) 13 13 #define LINKSR_HSBUSY (1 << 0) 14 14 15 + #define TXSETR 0x100 16 + #define TXSETR_LANECNT_MASK (0x3 << 0) 17 + 15 18 /* 16 19 * Video Mode Register 17 20 */ ··· 83 80 * PHY-Protocol Interface (PPI) Registers 84 81 */ 85 82 #define PPISETR 0x700 86 - #define PPISETR_DLEN_0 (0x1 << 0) 87 - #define PPISETR_DLEN_1 (0x3 << 0) 88 - #define PPISETR_DLEN_2 (0x7 << 0) 89 - #define PPISETR_DLEN_3 (0xf << 0) 83 + #define PPISETR_DLEN_MASK (0xf << 0) 90 84 #define PPISETR_CLEN (1 << 8) 91 85 92 86 #define PPICLCR 0x710