/* * The EDID disappeared (likely because of the HPD going down). */ void drm_dp_cec_unset_edid(struct drm_dp_aux *aux) { /* No transfer function was set, so not a DP connector */ if (!aux->transfer) return; cancel_delayed_work_sync(&aux->cec.unregister_work); mutex_lock(&aux->cec.lock); if (!aux->cec.adap) goto unlock; cec_phys_addr_invalidate(aux->cec.adap); /* * We're done if we want to keep the CEC device * (drm_dp_cec_unregister_delay is >= NEVER_UNREG_DELAY) or if the * DPCD still indicates the CEC capability (expected for an integrated * HDMI branch device). */ if (drm_dp_cec_unregister_delay < NEVER_UNREG_DELAY && !drm_dp_cec_cap(aux, NULL)) { /* * Unregister the CEC adapter after drm_dp_cec_unregister_delay * seconds. This to debounce short HPD off-and-on cycles from * displays. */ schedule_delayed_work(&aux->cec.unregister_work, drm_dp_cec_unregister_delay * HZ); } unlock: mutex_unlock(&aux->cec.lock); }
static enum drm_connector_status sun4i_hdmi_connector_detect(struct drm_connector *connector, bool force) { struct sun4i_hdmi *hdmi = drm_connector_to_sun4i_hdmi(connector); unsigned long reg; if (readl_poll_timeout(hdmi->base + SUN4I_HDMI_HPD_REG, reg, reg & SUN4I_HDMI_HPD_HIGH, 0, 500000)) { cec_phys_addr_invalidate(hdmi->cec_adap); return connector_status_disconnected; } return connector_status_connected; }