include/media/cec.h
Source file repositories/reference/linux-study-clean/include/media/cec.h
File Facts
- System
- Linux kernel
- Corpus path
include/media/cec.h- Extension
.h- Size
- 18307 bytes
- Lines
- 598
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: implementation source
- Status
- source implementation candidate
Why This File Exists
Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- 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
linux/poll.hlinux/fs.hlinux/device.hlinux/cdev.hlinux/kthread.hlinux/timer.hlinux/cec-funcs.hmedia/rc-core.h
Detected Declarations
struct cec_devnodestruct cec_adapterstruct cec_datastruct cec_pinstruct cec_notifierstruct cec_datastruct cec_msg_entrystruct cec_event_entrystruct cec_fhstruct cec_adap_opsstruct cec_adapterstruct edidstruct drm_connectorfunction cec_get_devicefunction cec_put_devicefunction cec_has_log_addrfunction cec_is_sinkfunction cec_is_registeredfunction cec_transmit_donefunction cec_transmit_attempt_donefunction cec_received_msgfunction cec_register_adapterfunction cec_unregister_adapterfunction cec_s_conn_infofunction cec_phys_addr_invalidatefunction cec_get_edid_spa_location
Annotated Snippet
struct cec_devnode {
/* sysfs */
struct device dev;
struct cdev cdev;
/* device info */
int minor;
/* serialize open/release and registration */
struct mutex lock;
bool registered;
bool unregistered;
/* protect access to fhs */
struct mutex lock_fhs;
struct list_head fhs;
};
struct cec_adapter;
struct cec_data;
struct cec_pin;
struct cec_notifier;
struct cec_data {
struct list_head list;
struct list_head xfer_list;
struct cec_adapter *adap;
struct cec_msg msg;
u8 match_len;
u8 match_reply[5];
struct cec_fh *fh;
struct delayed_work work;
struct completion c;
u8 attempts;
bool blocking;
bool completed;
};
struct cec_msg_entry {
struct list_head list;
struct cec_msg msg;
};
struct cec_event_entry {
struct list_head list;
struct cec_event ev;
};
#define CEC_NUM_CORE_EVENTS 2
#define CEC_NUM_EVENTS CEC_EVENT_PIN_5V_HIGH
struct cec_fh {
struct list_head list;
struct list_head xfer_list;
struct cec_adapter *adap;
u8 mode_initiator;
u8 mode_follower;
/* Events */
wait_queue_head_t wait;
struct mutex lock;
struct list_head events[CEC_NUM_EVENTS]; /* queued events */
u16 queued_events[CEC_NUM_EVENTS];
unsigned int total_queued_events;
struct cec_event_entry core_events[CEC_NUM_CORE_EVENTS];
struct list_head msgs; /* queued messages */
unsigned int queued_msgs;
};
#define CEC_SIGNAL_FREE_TIME_RETRY 3
#define CEC_SIGNAL_FREE_TIME_NEW_INITIATOR 5
#define CEC_SIGNAL_FREE_TIME_NEXT_XFER 7
/* The nominal data bit period is 2.4 ms */
#define CEC_FREE_TIME_TO_USEC(ft) ((ft) * 2400)
struct cec_adap_ops {
/* Low-level callbacks, called with adap->lock held */
int (*adap_enable)(struct cec_adapter *adap, bool enable);
int (*adap_monitor_all_enable)(struct cec_adapter *adap, bool enable);
int (*adap_monitor_pin_enable)(struct cec_adapter *adap, bool enable);
int (*adap_log_addr)(struct cec_adapter *adap, u8 logical_addr);
void (*adap_unconfigured)(struct cec_adapter *adap);
int (*adap_transmit)(struct cec_adapter *adap, u8 attempts,
u32 signal_free_time, struct cec_msg *msg);
void (*adap_nb_transmit_canceled)(struct cec_adapter *adap,
const struct cec_msg *msg);
void (*adap_status)(struct cec_adapter *adap, struct seq_file *file);
void (*adap_free)(struct cec_adapter *adap);
/* Error injection callbacks, called without adap->lock held */
int (*error_inj_show)(struct cec_adapter *adap, struct seq_file *sf);
Annotation
- Immediate include surface: `linux/poll.h`, `linux/fs.h`, `linux/device.h`, `linux/cdev.h`, `linux/kthread.h`, `linux/timer.h`, `linux/cec-funcs.h`, `media/rc-core.h`.
- Detected declarations: `struct cec_devnode`, `struct cec_adapter`, `struct cec_data`, `struct cec_pin`, `struct cec_notifier`, `struct cec_data`, `struct cec_msg_entry`, `struct cec_event_entry`, `struct cec_fh`, `struct cec_adap_ops`.
- Atlas domain: Repository Root And Misc / include.
- Implementation status: source 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.