drivers/media/pci/mgb4/mgb4_io.h

Source file repositories/reference/linux-study-clean/drivers/media/pci/mgb4/mgb4_io.h

File Facts

System
Linux kernel
Corpus path
drivers/media/pci/mgb4/mgb4_io.h
Extension
.h
Size
1464 bytes
Lines
55
Domain
Driver Families
Bucket
drivers/media
Inferred role
Driver Families: implementation source
Status
source 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

struct mgb4_frame_buffer {
	struct vb2_v4l2_buffer vb;
	struct list_head list;
};

static inline struct mgb4_frame_buffer *to_frame_buffer(struct vb2_v4l2_buffer *vbuf)
{
	return container_of(vbuf, struct mgb4_frame_buffer, vb);
}

static inline bool has_yuv_and_timeperframe(struct mgb4_regs *video)
{
	u32 status = mgb4_read_reg(video, 0xD0);

	return (status & (1U << 8));
}

#define has_yuv(video) has_yuv_and_timeperframe(video)
#define has_timeperframe(video) has_yuv_and_timeperframe(video)

static inline u32 pixel_size(struct v4l2_dv_timings *timings)
{
	struct v4l2_bt_timings *bt = &timings->bt;

	u32 height = bt->height + bt->vfrontporch + bt->vsync + bt->vbackporch;
	u32 width = bt->width + bt->hfrontporch + bt->hsync + bt->hbackporch;

	return width * height;
}

#endif

Annotation

Implementation Notes