]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/bridge: analogix_dp: Reuse &link_train.training_lane[] to set DPCD DP_TRAINING_LA...
authorDamon Ding <damon.ding@rock-chips.com>
Tue, 11 Nov 2025 02:21:03 +0000 (10:21 +0800)
committerLuca Ceresoli <luca.ceresoli@bootlin.com>
Wed, 25 Mar 2026 11:57:55 +0000 (12:57 +0100)
In analogix_dp_link_start(), &link_train.training_lane[] is used to
set phy PE/VS configurations, and buf[] is initialized with the same
values to set DPCD DP_TRAINING_LANEx_SET.

It makes sense to reuse &link_train.training_lane[] to set DPCD
DP_TRAINING_LANEx_SET, which can remove the redundant assignments
and make codes more concise.

Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://patch.msgid.link/20251111022103.1350183-1-damon.ding@rock-chips.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c

index 1dd194bf49cd8f94a2b48f1f32baa262e5e5dbf9..b37fb3c3c1dd1ac70525181736a928f20324619d 100644 (file)
@@ -281,12 +281,8 @@ static int analogix_dp_link_start(struct analogix_dp_device *dp)
        if (retval < 0)
                return retval;
 
-       for (lane = 0; lane < lane_count; lane++)
-               buf[lane] = DP_TRAIN_PRE_EMPH_LEVEL_0 |
-                           DP_TRAIN_VOLTAGE_SWING_LEVEL_0;
-
-       retval = drm_dp_dpcd_write(&dp->aux, DP_TRAINING_LANE0_SET, buf,
-                                  lane_count);
+       retval = drm_dp_dpcd_write(&dp->aux, DP_TRAINING_LANE0_SET,
+                                  dp->link_train.training_lane, lane_count);
        if (retval < 0)
                return retval;