diff options
author | Andrey Gusakov <andrey.gusakov@cogentembedded.com> | 2017-07-05 20:18:04 +0300 |
---|---|---|
committer | Lucas Stach <l.stach@pengutronix.de> | 2017-07-06 14:43:15 +0200 |
commit | 2aa4c949b4ee18789c05f96c9f8853c623969b57 (patch) | |
tree | 095ebd60c88054c6638c9af6868342c6688c4ecd /drivers/video | |
parent | f4563213084baa6c5271a9967b4c3b2bd6b2d49d (diff) | |
download | barebox-2aa4c949b4ee18789c05f96c9f8853c623969b57.tar.gz barebox-2aa4c949b4ee18789c05f96c9f8853c623969b57.tar.xz |
video: tc358767: fix EDID read for DP displays
Desktop displays do not always support E-DDC. So do not fall on
EDID segment index write operation.
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 | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/video/tc358767.c b/drivers/video/tc358767.c index ab2e86ec43..f9df383fc2 100644 --- a/drivers/video/tc358767.c +++ b/drivers/video/tc358767.c @@ -1108,13 +1108,16 @@ static int tc_read_edid(struct tc_data *tc) unsigned char start = 0; unsigned char segment = 0; - struct i2c_msg msgs[] = { + struct i2c_msg msg_segment[] = { { .addr = DDC_SEGMENT_ADDR, .flags = 0, .len = 1, .buf = &segment, - }, { + } + }; + struct i2c_msg msgs[] = { + { .addr = DDC_ADDR, .flags = 0, .len = 1, @@ -1126,13 +1129,21 @@ static int tc_read_edid(struct tc_data *tc) }; tc->edid = xmalloc(EDID_LENGTH); + /* + * Some displays supports E-EDID some not + * Just reset segment address to 0x0 + * This transfer can fail on non E-DCC displays + * Ignore error + */ + i2c_transfer(&tc->adapter, msg_segment, 1); + do { block = min(DDC_BLOCK_READ, EDID_LENGTH - i); - msgs[2].buf = tc->edid + i; - msgs[2].len = block; + msgs[1].buf = tc->edid + i; + msgs[1].len = block; - ret = i2c_transfer(&tc->adapter, msgs, 3); + ret = i2c_transfer(&tc->adapter, msgs, 2); if (ret < 0) goto err; |