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()
314 cancel_delayed_work_sync(&aux->cec.unregister_work); in drm_dp_cec_attach()
316 mutex_lock(&aux->cec.lock); in drm_dp_cec_attach()
318 /* CEC is not supported, unregister any existing adapter */ in drm_dp_cec_attach()
319 cec_unregister_adapter(aux->cec.adap); in drm_dp_cec_attach()
320 aux->cec.adap = NULL; in drm_dp_cec_attach()
329 if (aux->cec.adap) { in drm_dp_cec_attach()
331 if ((aux->cec.adap->capabilities & CEC_CAP_MONITOR_ALL) == in drm_dp_cec_attach()
333 aux->cec.adap->available_log_addrs == num_las) { in drm_dp_cec_attach()
335 cec_s_phys_addr(aux->cec.adap, source_physical_address, false); in drm_dp_cec_attach()
342 cec_unregister_adapter(aux->cec.adap); in drm_dp_cec_attach()
346 aux->cec.adap = cec_allocate_adapter(&drm_dp_cec_adap_ops, in drm_dp_cec_attach()
349 if (IS_ERR(aux->cec.adap)) { in drm_dp_cec_attach()
350 aux->cec.adap = NULL; in drm_dp_cec_attach()
355 cec_s_conn_info(aux->cec.adap, &conn_info); in drm_dp_cec_attach()
357 if (cec_register_adapter(aux->cec.adap, connector->dev->dev)) { in drm_dp_cec_attach()
358 cec_delete_adapter(aux->cec.adap); in drm_dp_cec_attach()
359 aux->cec.adap = NULL; in drm_dp_cec_attach()
362 * Update the phys addr for the new CEC adapter. When called in drm_dp_cec_attach()
366 cec_s_phys_addr(aux->cec.adap, source_physical_address, false); in drm_dp_cec_attach()
369 mutex_unlock(&aux->cec.lock); in drm_dp_cec_attach()
398 cancel_delayed_work_sync(&aux->cec.unregister_work); in drm_dp_cec_unset_edid()
400 mutex_lock(&aux->cec.lock); in drm_dp_cec_unset_edid()
401 if (!aux->cec.adap) in drm_dp_cec_unset_edid()
404 cec_phys_addr_invalidate(aux->cec.adap); in drm_dp_cec_unset_edid()
406 * We're done if we want to keep the CEC device in drm_dp_cec_unset_edid()
408 * DPCD still indicates the CEC capability (expected for an integrated in drm_dp_cec_unset_edid()
414 * Unregister the CEC adapter after drm_dp_cec_unregister_delay in drm_dp_cec_unset_edid()
418 schedule_delayed_work(&aux->cec.unregister_work, in drm_dp_cec_unset_edid()
422 mutex_unlock(&aux->cec.lock); in drm_dp_cec_unset_edid()
431 * A new connector was registered with associated CEC adapter name and
432 * CEC adapter parent device. After registering the name and parent
434 * CEC and to register a CEC adapter if that is the case.
439 WARN_ON(aux->cec.adap); in drm_dp_cec_register_connector()
442 aux->cec.connector = connector; in drm_dp_cec_register_connector()
443 INIT_DELAYED_WORK(&aux->cec.unregister_work, in drm_dp_cec_register_connector()
449 * drm_dp_cec_unregister_connector() - unregister the CEC adapter, if any
454 if (!aux->cec.adap) in drm_dp_cec_unregister_connector()
456 cancel_delayed_work_sync(&aux->cec.unregister_work); in drm_dp_cec_unregister_connector()
457 cec_unregister_adapter(aux->cec.adap); in drm_dp_cec_unregister_connector()
458 aux->cec.adap = NULL; in drm_dp_cec_unregister_connector()