Skip to content

Commit 503c577

Browse files
committed
vc4: cec: Restore cec physical address on reconnect
Currently we call cec_phys_addr_invalidate on a hotplug deassert. That may be due to a TV power cycling, or an AVR being switched on (and switching edid). This makes CEC unusable. Set it back up again on the hotplug assert. Signed-off-by: Dom Cobley <popcornmix@gmail.com>
1 parent 1a9b21a commit 503c577

1 file changed

Lines changed: 17 additions & 8 deletions

File tree

‎drivers/gpu/drm/vc4/vc4_hdmi.c‎

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,20 +114,29 @@ static enum drm_connector_status
114114
vc4_hdmi_connector_detect(struct drm_connector *connector, bool force)
115115
{
116116
struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector);
117+
bool connected = false;
117118

118119
if (vc4_hdmi->hpd_gpio) {
119120
if (gpio_get_value_cansleep(vc4_hdmi->hpd_gpio) ^
120121
vc4_hdmi->hpd_active_low)
121-
return connector_status_connected;
122-
cec_phys_addr_invalidate(vc4_hdmi->cec_adap);
123-
return connector_status_disconnected;
124-
}
125-
126-
if (drm_probe_ddc(vc4_hdmi->ddc))
127-
return connector_status_connected;
128-
122+
connected = true;
123+
} else if (drm_probe_ddc(vc4_hdmi->ddc))
124+
connected = true;
129125
if (HDMI_READ(HDMI_HOTPLUG) & VC4_HDMI_HOTPLUG_CONNECTED)
126+
connected = true;
127+
if (connected) {
128+
if (connector->status != connector_status_connected) {
129+
struct edid *edid = drm_get_edid(connector, vc4_hdmi->ddc);
130+
131+
if (edid) {
132+
cec_s_phys_addr_from_edid(vc4_hdmi->cec_adap, edid);
133+
vc4_hdmi->encoder.hdmi_monitor = drm_detect_hdmi_monitor(edid);
134+
drm_connector_update_edid_property(connector, edid);
135+
kfree(edid);
136+
}
137+
}
130138
return connector_status_connected;
139+
}
131140
cec_phys_addr_invalidate(vc4_hdmi->cec_adap);
132141
return connector_status_disconnected;
133142
}

0 commit comments

Comments
 (0)