drivers/gpu/drm/display/drm_hdmi_cec_notifier_helper.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/display/drm_hdmi_cec_notifier_helper.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/display/drm_hdmi_cec_notifier_helper.c- Extension
.c- Size
- 1810 bytes
- Lines
- 66
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
drm/drm_bridge.hdrm/drm_connector.hdrm/drm_managed.hdrm/display/drm_hdmi_cec_helper.hlinux/export.hlinux/mutex.hmedia/cec.hmedia/cec-notifier.h
Detected Declarations
function Copyrightfunction drm_connector_hdmi_cec_notifier_phys_addr_setfunction drm_connector_hdmi_cec_notifier_unregisterfunction drmm_connector_hdmi_cec_notifier_registerexport drmm_connector_hdmi_cec_notifier_register
Annotated Snippet
// SPDX-License-Identifier: MIT
/*
* Copyright (c) 2024 Linaro Ltd
*/
#include <drm/drm_bridge.h>
#include <drm/drm_connector.h>
#include <drm/drm_managed.h>
#include <drm/display/drm_hdmi_cec_helper.h>
#include <linux/export.h>
#include <linux/mutex.h>
#include <media/cec.h>
#include <media/cec-notifier.h>
static void drm_connector_hdmi_cec_notifier_phys_addr_invalidate(struct drm_connector *connector)
{
cec_notifier_phys_addr_invalidate(connector->cec.data);
}
static void drm_connector_hdmi_cec_notifier_phys_addr_set(struct drm_connector *connector,
u16 addr)
{
cec_notifier_set_phys_addr(connector->cec.data, addr);
}
static void drm_connector_hdmi_cec_notifier_unregister(struct drm_device *dev, void *res)
{
struct drm_connector *connector = res;
cec_notifier_conn_unregister(connector->cec.data);
connector->cec.data = NULL;
}
static const struct drm_connector_cec_funcs drm_connector_cec_notifier_funcs = {
.phys_addr_invalidate = drm_connector_hdmi_cec_notifier_phys_addr_invalidate,
.phys_addr_set = drm_connector_hdmi_cec_notifier_phys_addr_set,
};
int drmm_connector_hdmi_cec_notifier_register(struct drm_connector *connector,
const char *port_name,
struct device *dev)
{
struct cec_connector_info conn_info;
struct cec_notifier *notifier;
cec_fill_conn_info_from_drm(&conn_info, connector);
notifier = cec_notifier_conn_register(dev, port_name, &conn_info);
if (!notifier)
return -ENOMEM;
mutex_lock(&connector->cec.mutex);
connector->cec.data = notifier;
connector->cec.funcs = &drm_connector_cec_notifier_funcs;
mutex_unlock(&connector->cec.mutex);
return drmm_add_action_or_reset(connector->dev,
drm_connector_hdmi_cec_notifier_unregister,
connector);
}
EXPORT_SYMBOL(drmm_connector_hdmi_cec_notifier_register);
Annotation
- Immediate include surface: `drm/drm_bridge.h`, `drm/drm_connector.h`, `drm/drm_managed.h`, `drm/display/drm_hdmi_cec_helper.h`, `linux/export.h`, `linux/mutex.h`, `media/cec.h`, `media/cec-notifier.h`.
- Detected declarations: `function Copyright`, `function drm_connector_hdmi_cec_notifier_phys_addr_set`, `function drm_connector_hdmi_cec_notifier_unregister`, `function drmm_connector_hdmi_cec_notifier_register`, `export drmm_connector_hdmi_cec_notifier_register`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.