drm/bridge: tc358768: fix TCLK_ZEROCNT computation
authorFrancesco Dolcini <francesco.dolcini@toradex.com>
Thu, 27 Apr 2023 14:29:29 +0000 (16:29 +0200)
committerRobert Foss <rfoss@kernel.org>
Fri, 5 May 2023 18:11:35 +0000 (20:11 +0200)
commitf9cf811374f42fca31ac34aaf59ee2ae72b89879
treebe2d1377984842990c3fb7a6d5ee7fe1ae9a7cdc
parentffd2e4bbea626d565b9817312b0fcfb382fecb88
drm/bridge: tc358768: fix TCLK_ZEROCNT computation

Correct computation of TCLK_ZEROCNT register.

This register must be set to a value that ensure that
(TCLK-PREPARECNT + TCLK-ZERO) > 300ns

with the actual value of (TCLK-PREPARECNT + TCLK-ZERO) being

(1 to 2) + (TCLK_ZEROCNT + 1)) x HSByteClkCycle + (PHY output delay)

with PHY output delay being about

(2 to 3) x MIPIBitClk cycle in the BitClk conversion.

Fixes: ff1ca6397b1d ("drm/bridge: Add tc358768 driver")
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Robert Foss <rfoss@kernel.org>
Signed-off-by: Robert Foss <rfoss@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230427142934.55435-5-francesco@dolcini.it
drivers/gpu/drm/bridge/tc358768.c