Patch "drm/bridge: tc358768: fix THS_ZEROCNT computation" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drm/bridge: tc358768: fix THS_ZEROCNT computation

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-bridge-tc358768-fix-ths_zerocnt-computation.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit ad16fef912b6163abbf04cd5ea44db500f280800
Author: Francesco Dolcini <francesco.dolcini@xxxxxxxxxxx>
Date:   Thu Apr 27 16:29:31 2023 +0200

    drm/bridge: tc358768: fix THS_ZEROCNT computation
    
    [ Upstream commit 77a089328da791118af9692543a5eedc79eb5fd4 ]
    
    Correct computation of THS_ZEROCNT register.
    
    This register must be set to a value that ensure that
    THS_PREPARE + THS_ZERO > 145ns + 10*UI
    
    with the actual value of (THS_PREPARE + THS_ZERO) being
    
    ((1 to 2) + 1 + (TCLK_ZEROCNT + 1) + (3 to 4)) x ByteClk cycle +
      + HSByteClk x (2 + (1 to 2)) + (PHY delay)
    
    with PHY delay being about
    
    (8 + (5 to 6)) x MIPIBitClk cycle in the BitClk conversion.
    
    Fixes: ff1ca6397b1d ("drm/bridge: Add tc358768 driver")
    Signed-off-by: Francesco Dolcini <francesco.dolcini@xxxxxxxxxxx>
    Reviewed-by: Robert Foss <rfoss@xxxxxxxxxx>
    Signed-off-by: Robert Foss <rfoss@xxxxxxxxxx>
    Link: https://patchwork.freedesktop.org/patch/msgid/20230427142934.55435-7-francesco@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/bridge/tc358768.c b/drivers/gpu/drm/bridge/tc358768.c
index b7372c5b0b819..a35674b6ff244 100644
--- a/drivers/gpu/drm/bridge/tc358768.c
+++ b/drivers/gpu/drm/bridge/tc358768.c
@@ -744,9 +744,10 @@ static void tc358768_bridge_pre_enable(struct drm_bridge *bridge)
 	/* 40ns + 4*UI < THS_PREPARE < 85ns + 6*UI */
 	val = 50 + tc358768_to_ns(4 * ui_nsk);
 	val = tc358768_ns_to_cnt(val, dsibclk_nsk) - 1;
-	/* THS_ZERO > 145ns + 10*UI */
-	val2 = tc358768_ns_to_cnt(145 - tc358768_to_ns(ui_nsk), dsibclk_nsk);
-	val |= (val2 - tc358768_to_ns(phy_delay_nsk)) << 8;
+	/* THS_PREPARE + THS_ZERO > 145ns + 10*UI */
+	raw_val = tc358768_ns_to_cnt(145 - tc358768_to_ns(3 * ui_nsk), dsibclk_nsk) - 10;
+	val2 = clamp(raw_val, 0, 127);
+	val |= val2 << 8;
 	dev_dbg(priv->dev, "THS_HEADERCNT: 0x%x\n", val);
 	tc358768_write(priv, TC358768_THS_HEADERCNT, val);
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux