Skip to content

Commit 70445de

Browse files
Kuogee HsiehAbhinav Kumar
authored andcommitted
drm/msm/dp: cleared DP_DOWNSPREAD_CTRL register before start link training
DOWNSPREAD_CTRL (0x107) shall be cleared to 0 upon power-on reset or an upstream device disconnect. This patch will enforce this rule by always cleared DOWNSPREAD_CTRL register to 0 before start link training. At rare case that DP MSA timing parameters may be mis-interpreted by the sink which causes audio sampling rate be calculated wrongly and cause audio did not work at sink if DOWNSPREAD_CTRL register is not cleared to 0. Changes in v2: 1) fix spelling at commit text 2) merge ssc variable into encoding[0] Changes in v3: -- correct spelling of DOWNSPREAD_CTRL -- replace err with len of ssize_t Changes in v4: -- split into 2 patches Signed-off-by: Kuogee Hsieh <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Fixes: c943b49 ("drm/msm/dp: add displayPort driver support") Patchwork: https://patchwork.freedesktop.org/patch/502532/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Abhinav Kumar <[email protected]>
1 parent 152d394 commit 70445de

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

drivers/gpu/drm/msm/dp/dp_ctrl.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,8 +1243,7 @@ static int dp_ctrl_link_train(struct dp_ctrl_private *ctrl,
12431243
{
12441244
int ret = 0;
12451245
const u8 *dpcd = ctrl->panel->dpcd;
1246-
u8 encoding = DP_SET_ANSI_8B10B;
1247-
u8 ssc;
1246+
u8 encoding[] = { 0, DP_SET_ANSI_8B10B };
12481247
u8 assr;
12491248
struct dp_link_info link_info = {0};
12501249

@@ -1256,13 +1255,11 @@ static int dp_ctrl_link_train(struct dp_ctrl_private *ctrl,
12561255

12571256
dp_aux_link_configure(ctrl->aux, &link_info);
12581257

1259-
if (drm_dp_max_downspread(dpcd)) {
1260-
ssc = DP_SPREAD_AMP_0_5;
1261-
drm_dp_dpcd_write(ctrl->aux, DP_DOWNSPREAD_CTRL, &ssc, 1);
1262-
}
1258+
if (drm_dp_max_downspread(dpcd))
1259+
encoding[0] |= DP_SPREAD_AMP_0_5;
12631260

1264-
drm_dp_dpcd_write(ctrl->aux, DP_MAIN_LINK_CHANNEL_CODING_SET,
1265-
&encoding, 1);
1261+
/* config DOWNSPREAD_CTRL and MAIN_LINK_CHANNEL_CODING_SET */
1262+
drm_dp_dpcd_write(ctrl->aux, DP_DOWNSPREAD_CTRL, encoding, 2);
12661263

12671264
if (drm_dp_alternate_scrambler_reset_cap(dpcd)) {
12681265
assr = DP_ALTERNATE_SCRAMBLER_RESET_ENABLE;

0 commit comments

Comments
 (0)