From 77b8a97e6d3904c326c98c8c606f8f701de5447c Mon Sep 17 00:00:00 2001 From: Guochun Huang Date: Tue, 9 Apr 2024 10:54:16 +0800 Subject: [PATCH] drm/rockchip: analogix_dp: fix Condition of CDR fail In DP spec 1.3, Condition of CR fail are outlined in section 3.5.1.2.2.1, figure 3-20: 1. Maximum Voltage Swing reached 2. Same Voltage five times The following conditions have been optimized: 1. Training of CDR still failed while maximum voltage swing has been applied and configured 2.Removed the redundant judgment for the maximum pre-emphasis level reached Change-Id: I829437e0294663a6cb1f31feb91e1d6a468ed681 Signed-off-by: Guochun Huang --- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index 5c4e21cb8144..e84eecba9c25 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -548,9 +548,15 @@ static int analogix_dp_process_clock_recovery(struct analogix_dp_device *dp) pre_emphasis) dp->link_train.cr_loop[lane]++; + /* + * In DP spec 1.3, Condition of CR fail are + * outlined in section 3.5.1.2.2.1, figure 3-20: + * + * 1. Maximum Voltage Swing reached + * 2. Same Voltage five times + */ if (dp->link_train.cr_loop[lane] == MAX_CR_LOOP || - voltage_swing == VOLTAGE_LEVEL_3 || - pre_emphasis == PRE_EMPHASIS_LEVEL_3) { + DPCD_VOLTAGE_SWING_GET(training_lane) == VOLTAGE_LEVEL_3) { dev_err(dp->dev, "CR Max reached (%d,%d,%d)\n", dp->link_train.cr_loop[lane], voltage_swing, pre_emphasis);