drivers/media/v4l2-core/v4l2-dv-timings.c

Source file repositories/reference/linux-study-clean/drivers/media/v4l2-core/v4l2-dv-timings.c

File Facts

System
Linux kernel
Corpus path
drivers/media/v4l2-core/v4l2-dv-timings.c
Extension
.c
Size
38841 bytes
Lines
1276
Domain
Driver Families
Bucket
drivers/media
Inferred role
Driver Families: operation-table or driver-model contract
Status
pattern 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.

Dependency Surface

Detected Declarations

Annotated Snippet

static const struct file_operations infoframe_##type##_fops = {		\
	.owner   = THIS_MODULE,						\
	.open    = simple_open,						\
	.read    = infoframe_read_##type,				\
}

DEBUGFS_FOPS(avi, V4L2_DEBUGFS_IF_AVI);
DEBUGFS_FOPS(audio, V4L2_DEBUGFS_IF_AUDIO);
DEBUGFS_FOPS(spd, V4L2_DEBUGFS_IF_SPD);
DEBUGFS_FOPS(hdmi, V4L2_DEBUGFS_IF_HDMI);
DEBUGFS_FOPS(drm, V4L2_DEBUGFS_IF_DRM);

struct v4l2_debugfs_if *v4l2_debugfs_if_alloc(struct dentry *root, u32 if_types,
					      void *priv,
					      v4l2_debugfs_if_read_t if_read)
{
	struct v4l2_debugfs_if *infoframes;

	if (IS_ERR_OR_NULL(root) || !if_types || !if_read)
		return NULL;

	infoframes = kzalloc_obj(*infoframes);
	if (!infoframes)
		return NULL;

	infoframes->if_dir = debugfs_create_dir("infoframes", root);
	infoframes->priv = priv;
	infoframes->if_read = if_read;
	if (if_types & V4L2_DEBUGFS_IF_AVI)
		debugfs_create_file("avi", 0400, infoframes->if_dir,
				    infoframes, &infoframe_avi_fops);
	if (if_types & V4L2_DEBUGFS_IF_AUDIO)
		debugfs_create_file("audio", 0400, infoframes->if_dir,
				    infoframes, &infoframe_audio_fops);
	if (if_types & V4L2_DEBUGFS_IF_SPD)
		debugfs_create_file("spd", 0400, infoframes->if_dir,
				    infoframes, &infoframe_spd_fops);
	if (if_types & V4L2_DEBUGFS_IF_HDMI)
		debugfs_create_file("hdmi", 0400, infoframes->if_dir,
				    infoframes, &infoframe_hdmi_fops);
	if (if_types & V4L2_DEBUGFS_IF_DRM)
		debugfs_create_file("hdr_drm", 0400, infoframes->if_dir,
				    infoframes, &infoframe_drm_fops);
	return infoframes;
}
EXPORT_SYMBOL_GPL(v4l2_debugfs_if_alloc);

void v4l2_debugfs_if_free(struct v4l2_debugfs_if *infoframes)
{
	if (infoframes) {
		debugfs_remove_recursive(infoframes->if_dir);
		kfree(infoframes);
	}
}
EXPORT_SYMBOL_GPL(v4l2_debugfs_if_free);

#endif

Annotation

Implementation Notes