Unverified Commit 3666aad8 authored by Francesco Dolcini's avatar Francesco Dolcini Committed by Robert Foss
Browse files

drm/bridge: tc358768: fix TXTAGOCNT computation



Correct computation of TXTAGOCNT register.

This register must be set to a value that ensure that the
TTA-GO period = (4 x TLPX)

with the actual value of TTA-GO being

4 x (TXTAGOCNT + 1) x (HSByteClk cycle)

Fixes: ff1ca639 ("drm/bridge: Add tc358768 driver")
Signed-off-by: default avatarFrancesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: default avatarRobert Foss <rfoss@kernel.org>
Signed-off-by: default avatarRobert Foss <rfoss@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230427142934.55435-8-francesco@dolcini.it
parent 77a08932
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -796,7 +796,7 @@ static void tc358768_bridge_pre_enable(struct drm_bridge *bridge)

	/* TXTAGOCNT[26:16] RXTASURECNT[10:0] */
	val = tc358768_to_ns((lptxcnt + 1) * dsibclk_nsk * 4);
	val = tc358768_ns_to_cnt(val, dsibclk_nsk) - 1;
	val = tc358768_ns_to_cnt(val, dsibclk_nsk) / 4 - 1;
	val2 = tc358768_ns_to_cnt(tc358768_to_ns((lptxcnt + 1) * dsibclk_nsk),
				  dsibclk_nsk) - 2;
	val = val << 16 | val2;