diff options
author | Andrey Gusakov <andrey.gusakov@cogentembedded.com> | 2017-07-05 20:18:09 +0300 |
---|---|---|
committer | Lucas Stach <l.stach@pengutronix.de> | 2017-07-06 14:43:16 +0200 |
commit | dd6ba39b3f86d06eec94878301656c0bd4fbf23e (patch) | |
tree | b94b3ece73ad532179fc4e023813369e57378ad8 /drivers/video | |
parent | a76585f062599d5d240687cbc1f6c439aac64715 (diff) | |
download | barebox-dd6ba39b3f86d06eec94878301656c0bd4fbf23e.tar.gz barebox-dd6ba39b3f86d06eec94878301656c0bd4fbf23e.tar.xz |
video: tc358767: support newer DPCD revisions and higher data rates
Do not fail on newer DPCD revision. Assume it backwards compatible.
Try to fall back to supported data rate in case display reports too
high data rate.
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/tc358767.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/video/tc358767.c b/drivers/video/tc358767.c index d652c14421..c2222d9162 100644 --- a/drivers/video/tc358767.c +++ b/drivers/video/tc358767.c @@ -674,13 +674,25 @@ static int tc_get_display_props(struct tc_data *tc) ret = tc_aux_read(tc, 0x000, tmp, 8); if (ret) goto err_dpcd_read; - /* check rev 1.0 or 1.1 */ - if ((tmp[1] != 0x06) && (tmp[1] != 0x0a)) - goto err_dpcd_inval; tc->assr = !(tc->rev & 0x02); + + /* check DPCD rev */ + if (tmp[0] < 0x10) { + dev_err(tc->dev, "Too low DPCD revision 0x%02x\n", tmp[0]); + goto err_dpcd_inval; + } + if ((tmp[0] != 0x10) && (tmp[0] != 0x11)) + dev_warn(tc->dev, "Unknown DPCD revision 0x%02x\n", tmp[0]); tc->link.rev = tmp[0]; - tc->link.rate = tmp[1]; + + /* check rate */ + if ((tmp[1] == 0x06) || (tmp[1] == 0x0a)) { + tc->link.rate = tmp[1]; + } else { + dev_warn(tc->dev, "Unknown link rate 0x%02x, falling to 2.7Gbps\n", tmp[1]); + tc->link.rate = 0x0a; + } tc->link.lanes = tmp[2] & 0x0f; if (tc->link.lanes > 2) { dev_dbg(tc->dev, "Display supports %d lanes, host only 2 max. " |