mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
drm/bridge: analogix_dp: Check link status in loader_protect()
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com> Change-Id: I8816a0527eb7a1c1d3a2d7b7480057b888e375e0
This commit is contained in:
@@ -2099,6 +2099,7 @@ static void analogix_dp_link_train_restore(struct analogix_dp_device *dp)
|
||||
|
||||
int analogix_dp_loader_protect(struct analogix_dp_device *dp)
|
||||
{
|
||||
u8 link_status[DP_LINK_STATUS_SIZE];
|
||||
int ret;
|
||||
|
||||
ret = analogix_dp_phy_power_on(dp);
|
||||
@@ -2119,6 +2120,18 @@ int analogix_dp_loader_protect(struct analogix_dp_device *dp)
|
||||
goto err_disable;
|
||||
}
|
||||
|
||||
ret = drm_dp_dpcd_read_link_status(&dp->aux, link_status);
|
||||
if (ret < 0) {
|
||||
dev_err(dp->dev, "Failed to read link status\n");
|
||||
goto err_disable;
|
||||
}
|
||||
|
||||
if (!drm_dp_channel_eq_ok(link_status, dp->link_train.lane_count)) {
|
||||
dev_err(dp->dev, "Channel EQ or CR not ok\n");
|
||||
ret = -EINVAL;
|
||||
goto err_disable;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
err_disable:
|
||||
|
||||
Reference in New Issue
Block a user