From bcd7deb01b72d7b4417422768af9346f2e21a614 Mon Sep 17 00:00:00 2001 From: Douglas Anderson Date: Tue, 27 Oct 2015 16:27:29 -0700 Subject: [PATCH] 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: I9089755b75118499bec37bdb96d1635f66252e65 Signed-off-by: Douglas Anderson Reviewed-on: https://chromium-review.googlesource.com/309316 Reviewed-by: David Hendricks Reviewed-by: Yakir Yang Reviewed-by: Julius Werner Commit-Queue: Julius Werner Tested-by: Julius Werner --- src/soc/rockchip/rk3288/hdmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/soc/rockchip/rk3288/hdmi.c b/src/soc/rockchip/rk3288/hdmi.c index d9a8378c95..388a9cfa41 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) writel(block >> 1, &hdmi_regs->i2cm_segptr); while (trytime--) { + edid_read_err = 0; + for (n = 0; n < HDMI_EDID_BLOCK_SIZE/8; n++) { writel(shift + 8 * n, &hdmi_regs->i2cmess); @@ -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;