From d0289ab23da17186989c3467014a63980c906cf8 Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Mon, 21 Oct 2013 19:13:40 +0200 Subject: hdmi: retry edid reads up to 4 times until failing When hotpluging hdmi the read of edid often fails. Add up to 4 retries with a 500ms delay before giving up. --- drivers/video/tegra/dc/hdmi.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/video/tegra') diff --git a/drivers/video/tegra/dc/hdmi.c b/drivers/video/tegra/dc/hdmi.c index 55d9163d4faf..a0aa27fc4114 100644 --- a/drivers/video/tegra/dc/hdmi.c +++ b/drivers/video/tegra/dc/hdmi.c @@ -1413,11 +1413,18 @@ static bool tegra_dc_hdmi_detect(struct tegra_dc *dc) struct tegra_dc_hdmi_data *hdmi = tegra_dc_get_outdata(dc); struct fb_monspecs specs; int err; + int cnt = 0; if (!tegra_dc_hdmi_hpd(dc)) goto fail; err = tegra_edid_get_monspecs(hdmi->edid, &specs); + /* retry, maybe hdmi detect is not debounced or the monitor needs some time */ + while ( (err < 0) && (cnt++ < 4) ) { + dev_err(&dc->ndev->dev, "error reading edid, trying again in 500ms\n"); + msleep(500); + err = tegra_edid_get_monspecs(hdmi->edid, &specs); + } if (err < 0) { if (dc->out->n_modes) tegra_dc_enable(dc); -- cgit v1.2.3