diff options
author | Max Krummenacher <max.krummenacher@toradex.com> | 2013-10-21 19:13:40 +0200 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2013-10-21 19:13:40 +0200 |
commit | d0289ab23da17186989c3467014a63980c906cf8 (patch) | |
tree | 8ea05bb03f790ee321a8d3d0765aefb57b29b49e | |
parent | eab5523713e33e7e94548bb73087df68b703bac1 (diff) |
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.
-rw-r--r-- | drivers/video/tegra/dc/hdmi.c | 7 |
1 files changed, 7 insertions, 0 deletions
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); |