Skip to content

Commit 4f0d4a8

Browse files
yangliankun1Chun-Kuang Hu
authored andcommitted
drm/mediatek: dp: Add sdp path reset
When using type-c to type-c to connect to the monitor, the sound plays normally. If you unplug the type-c and connect the type-c to hdmi dongle to the monitor, there will be noise. By capturing the audio data, it is found that the data position is messy, and there is no error in the data. Through experiments, it can be restored by resetting the SDP path when unplugging it. Signed-off-by: Liankun Yang <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Reviewed-by: CK Hu <[email protected]> Link: https://patchwork.kernel.org/project/dri-devel/patch/[email protected]/ Signed-off-by: Chun-Kuang Hu <[email protected]>
1 parent 40384c8 commit 4f0d4a8

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

drivers/gpu/drm/mediatek/mtk_dp.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,6 +1135,18 @@ static void mtk_dp_digital_sw_reset(struct mtk_dp *mtk_dp)
11351135
0, DP_TX_TRANSMITTER_4P_RESET_SW_DP_TRANS_P0);
11361136
}
11371137

1138+
static void mtk_dp_sdp_path_reset(struct mtk_dp *mtk_dp)
1139+
{
1140+
mtk_dp_update_bits(mtk_dp, MTK_DP_ENC0_P0_3004,
1141+
SDP_RESET_SW_DP_ENC0_P0,
1142+
SDP_RESET_SW_DP_ENC0_P0);
1143+
1144+
/* Wait for sdp path reset to complete */
1145+
usleep_range(1000, 5000);
1146+
mtk_dp_update_bits(mtk_dp, MTK_DP_ENC0_P0_3004,
1147+
0, SDP_RESET_SW_DP_ENC0_P0);
1148+
}
1149+
11381150
static void mtk_dp_set_lanes(struct mtk_dp *mtk_dp, int lanes)
11391151
{
11401152
mtk_dp_update_bits(mtk_dp, MTK_DP_TRANS_P0_35F0,
@@ -2397,6 +2409,9 @@ static void mtk_dp_bridge_atomic_disable(struct drm_bridge *bridge,
23972409
DP_PWR_STATE_BANDGAP_TPLL,
23982410
DP_PWR_STATE_MASK);
23992411

2412+
/* SDP path reset sw*/
2413+
mtk_dp_sdp_path_reset(mtk_dp);
2414+
24002415
/* Ensure the sink is muted */
24012416
msleep(20);
24022417
}

drivers/gpu/drm/mediatek/mtk_dp_reg.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
#define MTK_DP_ENC0_P0_3004 0x3004
8787
#define VIDEO_M_CODE_SEL_DP_ENC0_P0_MASK BIT(8)
8888
#define DP_TX_ENCODER_4P_RESET_SW_DP_ENC0_P0 BIT(9)
89+
#define SDP_RESET_SW_DP_ENC0_P0 BIT(13)
8990
#define MTK_DP_ENC0_P0_3010 0x3010
9091
#define HTOTAL_SW_DP_ENC0_P0_MASK GENMASK(15, 0)
9192
#define MTK_DP_ENC0_P0_3014 0x3014

0 commit comments

Comments
 (0)