Lines Matching full:aux

3  * DisplayPort CEC-Tunneling-over-AUX support
22 * have a converter chip that supports CEC-Tunneling-over-AUX (usually the
57 * These functions take care of supporting the CEC-Tunneling-over-AUX
95 struct drm_dp_aux *aux = cec_get_drvdata(adap); in drm_dp_cec_adap_enable() local
99 err = drm_dp_dpcd_writeb(aux, DP_CEC_TUNNELING_CONTROL, val); in drm_dp_cec_adap_enable()
105 struct drm_dp_aux *aux = cec_get_drvdata(adap); in drm_dp_cec_adap_log_addr() local
115 err = drm_dp_dpcd_write(aux, DP_CEC_LOGICAL_ADDRESS_MASK, mask, 2); in drm_dp_cec_adap_log_addr()
122 struct drm_dp_aux *aux = cec_get_drvdata(adap); in drm_dp_cec_adap_transmit() local
126 err = drm_dp_dpcd_write(aux, DP_CEC_TX_MESSAGE_BUFFER, in drm_dp_cec_adap_transmit()
131 err = drm_dp_dpcd_writeb(aux, DP_CEC_TX_MESSAGE_INFO, in drm_dp_cec_adap_transmit()
140 struct drm_dp_aux *aux = cec_get_drvdata(adap); in drm_dp_cec_adap_monitor_all_enable() local
147 err = drm_dp_dpcd_readb(aux, DP_CEC_TUNNELING_CONTROL, &val); in drm_dp_cec_adap_monitor_all_enable()
153 err = drm_dp_dpcd_writeb(aux, DP_CEC_TUNNELING_CONTROL, val); in drm_dp_cec_adap_monitor_all_enable()
161 struct drm_dp_aux *aux = cec_get_drvdata(adap); in drm_dp_cec_adap_status() local
165 if (drm_dp_read_desc(aux, &desc, true)) in drm_dp_cec_adap_status()
190 static int drm_dp_cec_received(struct drm_dp_aux *aux) in drm_dp_cec_received() argument
192 struct cec_adapter *adap = aux->cec.adap; in drm_dp_cec_received()
197 err = drm_dp_dpcd_readb(aux, DP_CEC_RX_MESSAGE_INFO, &rx_msg_info); in drm_dp_cec_received()
205 err = drm_dp_dpcd_read(aux, DP_CEC_RX_MESSAGE_BUFFER, msg.msg, msg.len); in drm_dp_cec_received()
213 static void drm_dp_cec_handle_irq(struct drm_dp_aux *aux) in drm_dp_cec_handle_irq() argument
215 struct cec_adapter *adap = aux->cec.adap; in drm_dp_cec_handle_irq()
218 if (drm_dp_dpcd_readb(aux, DP_CEC_TUNNELING_IRQ_FLAGS, &flags) < 0) in drm_dp_cec_handle_irq()
222 drm_dp_cec_received(aux); in drm_dp_cec_handle_irq()
233 drm_dp_dpcd_writeb(aux, DP_CEC_TUNNELING_IRQ_FLAGS, flags); in drm_dp_cec_handle_irq()
238 * @aux: DisplayPort AUX channel
240 * Should be called when handling an IRQ_HPD request. If CEC-tunneling-over-AUX
243 void drm_dp_cec_irq(struct drm_dp_aux *aux) in drm_dp_cec_irq() argument
249 if (!aux->transfer) in drm_dp_cec_irq()
252 mutex_lock(&aux->cec.lock); in drm_dp_cec_irq()
253 if (!aux->cec.adap) in drm_dp_cec_irq()
256 ret = drm_dp_dpcd_readb(aux, DP_DEVICE_SERVICE_IRQ_VECTOR_ESI1, in drm_dp_cec_irq()
261 drm_dp_cec_handle_irq(aux); in drm_dp_cec_irq()
262 drm_dp_dpcd_writeb(aux, DP_DEVICE_SERVICE_IRQ_VECTOR_ESI1, DP_CEC_IRQ); in drm_dp_cec_irq()
264 mutex_unlock(&aux->cec.lock); in drm_dp_cec_irq()
268 static bool drm_dp_cec_cap(struct drm_dp_aux *aux, u8 *cec_cap) in drm_dp_cec_cap() argument
272 if (drm_dp_dpcd_readb(aux, DP_CEC_TUNNELING_CAPABILITY, &cap) != 1 || in drm_dp_cec_cap()
286 struct drm_dp_aux *aux = container_of(work, struct drm_dp_aux, in drm_dp_cec_unregister_work() local
289 mutex_lock(&aux->cec.lock); in drm_dp_cec_unregister_work()
290 cec_unregister_adapter(aux->cec.adap); in drm_dp_cec_unregister_work()
291 aux->cec.adap = NULL; in drm_dp_cec_unregister_work()
292 mutex_unlock(&aux->cec.lock); in drm_dp_cec_unregister_work()
301 void drm_dp_cec_attach(struct drm_dp_aux *aux, u16 source_physical_address) in drm_dp_cec_attach() argument
303 struct drm_connector *connector = aux->cec.connector; in drm_dp_cec_attach()
311 if (!aux->transfer) in drm_dp_cec_attach()
324 cancel_delayed_work_sync(&aux->cec.unregister_work); in drm_dp_cec_attach()
326 mutex_lock(&aux->cec.lock); in drm_dp_cec_attach()
327 if (!drm_dp_cec_cap(aux, &cap)) { in drm_dp_cec_attach()
329 cec_unregister_adapter(aux->cec.adap); in drm_dp_cec_attach()
330 aux->cec.adap = NULL; in drm_dp_cec_attach()
339 if (aux->cec.adap) { in drm_dp_cec_attach()
340 if (aux->cec.adap->capabilities == cec_caps && in drm_dp_cec_attach()
341 aux->cec.adap->available_log_addrs == num_las) { in drm_dp_cec_attach()
343 cec_s_phys_addr(aux->cec.adap, source_physical_address, false); in drm_dp_cec_attach()
350 cec_unregister_adapter(aux->cec.adap); in drm_dp_cec_attach()
354 aux->cec.adap = cec_allocate_adapter(&drm_dp_cec_adap_ops, in drm_dp_cec_attach()
355 aux, connector->name, cec_caps, in drm_dp_cec_attach()
357 if (IS_ERR(aux->cec.adap)) { in drm_dp_cec_attach()
358 aux->cec.adap = NULL; in drm_dp_cec_attach()
363 cec_s_conn_info(aux->cec.adap, &conn_info); in drm_dp_cec_attach()
365 if (cec_register_adapter(aux->cec.adap, connector->dev->dev)) { in drm_dp_cec_attach()
366 cec_delete_adapter(aux->cec.adap); in drm_dp_cec_attach()
367 aux->cec.adap = NULL; in drm_dp_cec_attach()
374 cec_s_phys_addr(aux->cec.adap, source_physical_address, false); in drm_dp_cec_attach()
377 mutex_unlock(&aux->cec.lock); in drm_dp_cec_attach()
385 void drm_dp_cec_set_edid(struct drm_dp_aux *aux, const struct edid *edid) in drm_dp_cec_set_edid() argument
393 drm_dp_cec_attach(aux, pa); in drm_dp_cec_set_edid()
400 void drm_dp_cec_unset_edid(struct drm_dp_aux *aux) in drm_dp_cec_unset_edid() argument
403 if (!aux->transfer) in drm_dp_cec_unset_edid()
406 cancel_delayed_work_sync(&aux->cec.unregister_work); in drm_dp_cec_unset_edid()
408 mutex_lock(&aux->cec.lock); in drm_dp_cec_unset_edid()
409 if (!aux->cec.adap) in drm_dp_cec_unset_edid()
412 cec_phys_addr_invalidate(aux->cec.adap); in drm_dp_cec_unset_edid()
420 !drm_dp_cec_cap(aux, NULL)) { in drm_dp_cec_unset_edid()
426 schedule_delayed_work(&aux->cec.unregister_work, in drm_dp_cec_unset_edid()
430 mutex_unlock(&aux->cec.lock); in drm_dp_cec_unset_edid()
436 * @aux: DisplayPort AUX channel
444 void drm_dp_cec_register_connector(struct drm_dp_aux *aux, in drm_dp_cec_register_connector() argument
447 WARN_ON(aux->cec.adap); in drm_dp_cec_register_connector()
448 if (WARN_ON(!aux->transfer)) in drm_dp_cec_register_connector()
450 aux->cec.connector = connector; in drm_dp_cec_register_connector()
451 INIT_DELAYED_WORK(&aux->cec.unregister_work, in drm_dp_cec_register_connector()
458 * @aux: DisplayPort AUX channel
460 void drm_dp_cec_unregister_connector(struct drm_dp_aux *aux) in drm_dp_cec_unregister_connector() argument
462 if (!aux->cec.adap) in drm_dp_cec_unregister_connector()
464 cancel_delayed_work_sync(&aux->cec.unregister_work); in drm_dp_cec_unregister_connector()
465 cec_unregister_adapter(aux->cec.adap); in drm_dp_cec_unregister_connector()
466 aux->cec.adap = NULL; in drm_dp_cec_unregister_connector()