/** * drm_dp_cec_irq() - handle CEC interrupt, if any * @aux: DisplayPort AUX channel * * Should be called when handling an IRQ_HPD request. If CEC-tunneling-over-AUX * is present, then it will check for a CEC_IRQ and handle it accordingly. */ void drm_dp_cec_irq(struct drm_dp_aux *aux) { u8 cec_irq; int ret; mutex_lock(&aux->cec.lock); if (!aux->cec.adap) goto unlock; ret = drm_dp_dpcd_readb(aux, DP_DEVICE_SERVICE_IRQ_VECTOR_ESI1, &cec_irq); if (ret < 0 || !(cec_irq & DP_CEC_IRQ)) goto unlock; drm_dp_cec_handle_irq(aux); drm_dp_dpcd_writeb(aux, DP_DEVICE_SERVICE_IRQ_VECTOR_ESI1, DP_CEC_IRQ); unlock: mutex_unlock(&aux->cec.lock); }
/** * drm_dp_cec_irq() - handle CEC interrupt, if any * @aux: DisplayPort AUX channel * * Should be called when handling an IRQ_HPD request. If CEC-tunneling-over-AUX * is present, then it will check for a CEC_IRQ and handle it accordingly. */ void drm_dp_cec_irq(struct drm_dp_aux *aux) { u8 cec_irq; int ret; /* No transfer function was set, so not a DP connector */ if (!aux->transfer) return; mutex_lock(&aux->cec.lock); if (!aux->cec.adap) goto unlock; ret = drm_dp_dpcd_readb(aux, DP_DEVICE_SERVICE_IRQ_VECTOR_ESI1, &cec_irq); if (ret < 0 || !(cec_irq & DP_CEC_IRQ)) goto unlock; drm_dp_cec_handle_irq(aux); drm_dp_dpcd_writeb(aux, DP_DEVICE_SERVICE_IRQ_VECTOR_ESI1, DP_CEC_IRQ); unlock: mutex_unlock(&aux->cec.lock); }