Lines Matching full:cec
3 * DisplayPort CEC-Tunneling-over-AUX support
12 #include <media/cec.h>
22 * have a converter chip that supports CEC-Tunneling-over-AUX (usually the
23 * Parade PS176), but they do not wire up the CEC pin, thus making CEC
25 * support for CEC tunneling. Those adapters that I have tested using
26 * this chipset all have the CEC line connected.
30 * any of the other CEC devices. Quite literally the CEC wire is cut
35 * and no incentive to correctly wire up the CEC pin.
38 * finally fix their adapters and test the CEC functionality.
42 * https://hverkuil.home.xs4all.nl/cec-status.txt
47 * Note that the current implementation does not support CEC over an MST hub.
49 * standard to transport CEC interrupts over an MST device. It might be
55 * DOC: dp cec helpers
57 * These functions take care of supporting the CEC-Tunneling-over-AUX
62 * When the EDID is unset because the HPD went low, then the CEC DPCD registers
65 * short period for one reason or another, and that would cause the CEC adapter
68 * This module parameter sets a delay in seconds before the CEC adapter is
70 * the CEC adapter be unregistered.
72 * If it is set to a value >= NEVER_UNREG_DELAY, then the CEC adapter will never
75 * If it is set to 0, then the CEC adapter will be unregistered immediately as
79 * the CEC adapter.
81 * Note that for integrated HDMI branch devices that support CEC the DPCD
83 * by the HPD. In that case the CEC adapter will never be unregistered during
85 * have hardware with an integrated HDMI branch device that supports CEC.
91 "CEC unregister delay in seconds, 0: no delay, >= 1000: never unregister");
192 struct cec_adapter *adap = aux->cec.adap; in drm_dp_cec_received()
215 struct cec_adapter *adap = aux->cec.adap; in drm_dp_cec_handle_irq()
237 * drm_dp_cec_irq() - handle CEC interrupt, if any
240 * Should be called when handling an IRQ_HPD request. If CEC-tunneling-over-AUX
252 mutex_lock(&aux->cec.lock); in drm_dp_cec_irq()
253 if (!aux->cec.adap) in drm_dp_cec_irq()
264 mutex_unlock(&aux->cec.lock); in drm_dp_cec_irq()
282 * seconds. This unregisters the CEC adapter.
287 cec.unregister_work.work); in drm_dp_cec_unregister_work()
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()
296 * A new EDID is set. If there is no CEC adapter, then create one. If
297 * there was a CEC adapter, then check if the CEC adapter properties
298 * were unchanged and just update the CEC physical address. Otherwise
299 * unregister the old CEC adapter and create a new one.
303 struct drm_connector *connector = aux->cec.connector; 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()
328 /* CEC is not supported, unregister any existing adapter */ 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()
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()
370 * Update the phys addr for the new CEC adapter. When called 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()
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()
414 * We're done if we want to keep the CEC device in drm_dp_cec_unset_edid()
416 * DPCD still indicates the CEC capability (expected for an integrated in drm_dp_cec_unset_edid()
422 * Unregister the CEC adapter after drm_dp_cec_unregister_delay 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()
439 * A new connector was registered with associated CEC adapter name and
440 * CEC adapter parent device. After registering the name and parent
442 * CEC and to register a CEC adapter if that is the case.
447 WARN_ON(aux->cec.adap); 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()
457 * drm_dp_cec_unregister_connector() - unregister the CEC adapter, if any
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()