Skip to content
Snippets Groups Projects
Commit 86363456 authored by Leonard Crestez's avatar Leonard Crestez
Browse files

MLK-18297 drm/bridge: it6263: Sleep between status reads in connector detect


There are some issues with the HDMI connection on it6263 being slow to
come up. There is a hack there which reads the register multiple times
but it doesn't seem to be sufficient. This is particularly a problem
when inside a xen guest.

Improve this workaround by reading the status multiple times every few
5-10ms and returning connector_status_connected if any of those reads
sees HPDETECT.

Signed-off-by: default avatarLeonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: default avatarPeng Fan <peng.fan@nxp.com>
(cherry picked from commit 699ccad2)
parent 74a1c340
No related branches found
No related tags found
No related merge requests found
/*
* Copyright 2017 NXP
* Copyright 2017-2018 NXP
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
......@@ -391,12 +391,16 @@ it6263_connector_detect(struct drm_connector *connector, bool force)
* FIXME: We read status tens of times to workaround
* cable detection failure issue at boot time on some
* platforms.
* Spin on this for up to one second.
*/
for (i = 0; i < 90; i++)
for (i = 0; i < 100; i++) {
regmap_read(it6263->hdmi_regmap, HDMI_REG_SYS_STATUS, &status);
if (status & HPDETECT)
return connector_status_connected;
usleep_range(5000, 10000);
}
return (status & HPDETECT) ? connector_status_connected :
connector_status_disconnected;
return connector_status_disconnected;
}
static const struct drm_connector_funcs it6263_connector_funcs = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment