aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Gusakov <andrey.gusakov@cogentembedded.com>2017-11-07 11:56:24 -0500
committerAndrzej Hajda <a.hajda@samsung.com>2017-11-30 01:56:18 -0500
commit4dbd6c03fbf88299c573d676838896c6e06aade2 (patch)
tree886f5cdb1003b80e7f00ffe977c47eaead8f06d1
parent9217c1abbc145a77d65c476cf2004a3df02104c7 (diff)
drm/bridge: tc358767: fix 1-lane behavior
Use drm_dp_channel_eq_ok helper Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Link: https://patchwork.freedesktop.org/patch/msgid/1510073785-16108-7-git-send-email-andrey.gusakov@cogentembedded.com
-rw-r--r--drivers/gpu/drm/bridge/tc358767.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
index 24f495bf0567..8636e7eeb731 100644
--- a/drivers/gpu/drm/bridge/tc358767.c
+++ b/drivers/gpu/drm/bridge/tc358767.c
@@ -819,8 +819,6 @@ static int tc_main_link_setup(struct tc_data *tc)
819 unsigned int rate; 819 unsigned int rate;
820 u32 dp_phy_ctrl; 820 u32 dp_phy_ctrl;
821 int timeout; 821 int timeout;
822 bool aligned;
823 bool ready;
824 u32 value; 822 u32 value;
825 int ret; 823 int ret;
826 u8 tmp[8]; 824 u8 tmp[8];
@@ -965,16 +963,15 @@ static int tc_main_link_setup(struct tc_data *tc)
965 ret = drm_dp_dpcd_read_link_status(aux, tmp + 2); 963 ret = drm_dp_dpcd_read_link_status(aux, tmp + 2);
966 if (ret < 0) 964 if (ret < 0)
967 goto err_dpcd_read; 965 goto err_dpcd_read;
968 ready = (tmp[2] == ((DP_CHANNEL_EQ_BITS << 4) | /* Lane1 */ 966 } while ((--timeout) &&
969 DP_CHANNEL_EQ_BITS)); /* Lane0 */ 967 !(drm_dp_channel_eq_ok(tmp + 2, tc->link.base.num_lanes)));
970 aligned = tmp[4] & DP_INTERLANE_ALIGN_DONE;
971 } while ((--timeout) && !(ready && aligned));
972 968
973 if (timeout == 0) { 969 if (timeout == 0) {
974 /* Read DPCD 0x200-0x201 */ 970 /* Read DPCD 0x200-0x201 */
975 ret = drm_dp_dpcd_read(aux, DP_SINK_COUNT, tmp, 2); 971 ret = drm_dp_dpcd_read(aux, DP_SINK_COUNT, tmp, 2);
976 if (ret < 0) 972 if (ret < 0)
977 goto err_dpcd_read; 973 goto err_dpcd_read;
974 dev_err(dev, "channel(s) EQ not ok\n");
978 dev_info(dev, "0x0200 SINK_COUNT: 0x%02x\n", tmp[0]); 975 dev_info(dev, "0x0200 SINK_COUNT: 0x%02x\n", tmp[0]);
979 dev_info(dev, "0x0201 DEVICE_SERVICE_IRQ_VECTOR: 0x%02x\n", 976 dev_info(dev, "0x0201 DEVICE_SERVICE_IRQ_VECTOR: 0x%02x\n",
980 tmp[1]); 977 tmp[1]);
@@ -985,10 +982,6 @@ static int tc_main_link_setup(struct tc_data *tc)
985 dev_info(dev, "0x0206 ADJUST_REQUEST_LANE0_1: 0x%02x\n", 982 dev_info(dev, "0x0206 ADJUST_REQUEST_LANE0_1: 0x%02x\n",
986 tmp[6]); 983 tmp[6]);
987 984
988 if (!ready)
989 dev_err(dev, "Lane0/1 not ready\n");
990 if (!aligned)
991 dev_err(dev, "Lane0/1 not aligned\n");
992 return -EAGAIN; 985 return -EAGAIN;
993 } 986 }
994 987