From 6db10452b4ad5d99d160fd6f6c52c4c9a6c30635 Mon Sep 17 00:00:00 2001 From: Douglas Anderson Date: Tue, 27 Oct 2015 16:27:29 -0700 Subject: rockchip/rk3288: If we fail to read the EDID 5 times in a row, it's an error Previously if we tried to read the HDMI EDID several times and failed each time then we're return from hdmi_read_edid() with no error. Then we'd interpret whatever happened to be in memory at the time as an EDID--not so great. Let's actually look at the error. BRANCH=none BUG=chrome-os-partner:46256 TEST=Monitor that can't read EDID not shows that in the log Change-Id: I6e64b13ae3f8c61bf1baaa1cfc8b24987bd75cf3 Signed-off-by: Patrick Georgi Original-Commit-Id: 44bda7311f9ee677235e4dc8db669226518b3895 Original-Change-Id: I9089755b75118499bec37bdb96d1635f66252e65 Original-Signed-off-by: Douglas Anderson Original-Reviewed-on: https://chromium-review.googlesource.com/309298 Original-Commit-Ready: David Hendricks Original-Tested-by: David Hendricks Original-Reviewed-by: David Hendricks Reviewed-on: http://review.coreboot.org/12231 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- src/soc/rockchip/rk3288/hdmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/soc/rockchip/rk3288') diff --git a/src/soc/rockchip/rk3288/hdmi.c b/src/soc/rockchip/rk3288/hdmi.c index a5203997d8..104d80fe0c 100644 --- a/src/soc/rockchip/rk3288/hdmi.c +++ b/src/soc/rockchip/rk3288/hdmi.c @@ -738,6 +738,8 @@ static int hdmi_read_edid(int block, u8 *buff) write32(&hdmi_regs->i2cm_segptr, block >> 1); while (trytime--) { + edid_read_err = 0; + for (n = 0; n < HDMI_EDID_BLOCK_SIZE/8; n++) { write32(&hdmi_regs->i2cmess, shift + 8 * n); @@ -764,8 +766,6 @@ static int hdmi_read_edid(int block, u8 *buff) if (!edid_read_err) break; - - edid_read_err = 0; } return edid_read_err; -- cgit v1.2.3