drivers/media/pci/tw5864/tw5864.h
Source file repositories/reference/linux-study-clean/drivers/media/pci/tw5864/tw5864.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/pci/tw5864/tw5864.h- Extension
.h- Size
- 5225 bytes
- Lines
- 198
- 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.
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/pci.hlinux/videodev2.hlinux/notifier.hlinux/delay.hlinux/mutex.hlinux/io.hlinux/interrupt.hlinux/workqueue.hmedia/v4l2-common.hmedia/v4l2-ioctl.hmedia/v4l2-ctrls.hmedia/v4l2-device.hmedia/videobuf2-dma-sg.htw5864-reg.h
Detected Declarations
struct tw5864_devstruct tw5864_bufstruct tw5864_dma_bufstruct tw5864_inputstruct tw5864_h264_framestruct tw5864_devenum resolutionenum tw5864_vid_std
Annotated Snippet
struct tw5864_buf {
struct vb2_v4l2_buffer vb;
struct list_head list;
unsigned int size;
};
struct tw5864_dma_buf {
void *addr;
dma_addr_t dma_addr;
};
enum tw5864_vid_std {
STD_NTSC = 0, /* NTSC (M) */
STD_PAL = 1, /* PAL (B, D, G, H, I) */
STD_SECAM = 2, /* SECAM */
STD_NTSC443 = 3, /* NTSC4.43 */
STD_PAL_M = 4, /* PAL (M) */
STD_PAL_CN = 5, /* PAL (CN) */
STD_PAL_60 = 6, /* PAL 60 */
STD_INVALID = 7,
STD_AUTO = 7,
};
struct tw5864_input {
int nr; /* input number */
struct tw5864_dev *root;
struct mutex lock; /* used for vidq and vdev */
spinlock_t slock; /* used for sync between ISR, bh_work & V4L2 API */
struct video_device vdev;
struct v4l2_ctrl_handler hdl;
struct vb2_queue vidq;
struct list_head active;
enum resolution resolution;
unsigned int width, height;
unsigned int frame_seqno;
unsigned int frame_gop_seqno;
unsigned int h264_idr_pic_id;
int enabled;
enum tw5864_vid_std std;
v4l2_std_id v4l2_std;
int tail_nb_bits;
u8 tail;
u8 *buf_cur_ptr;
int buf_cur_space_left;
u32 reg_interlacing;
u32 reg_vlc;
u32 reg_dsp_codec;
u32 reg_dsp;
u32 reg_emu;
u32 reg_dsp_qp;
u32 reg_dsp_ref_mvp_lambda;
u32 reg_dsp_i4x4_weight;
u32 buf_id;
struct tw5864_buf *vb;
struct v4l2_ctrl *md_threshold_grid_ctrl;
u16 md_threshold_grid_values[12 * 16];
int qp;
int gop;
/*
* In (1/MAX_FPS) units.
* For max FPS (default), set to 1.
* For 1 FPS, set to e.g. 32.
*/
int frame_interval;
unsigned long new_frame_deadline;
};
struct tw5864_h264_frame {
struct tw5864_dma_buf vlc;
struct tw5864_dma_buf mv;
int vlc_len;
u32 checksum;
struct tw5864_input *input;
u64 timestamp;
unsigned int seqno;
unsigned int gop_seqno;
};
/* global device status */
struct tw5864_dev {
spinlock_t slock; /* used for sync between ISR, bh_work & V4L2 API */
struct v4l2_device v4l2_dev;
struct tw5864_input inputs[TW5864_INPUTS];
#define H264_BUF_CNT 4
struct tw5864_h264_frame h264_buf[H264_BUF_CNT];
Annotation
- Immediate include surface: `linux/pci.h`, `linux/videodev2.h`, `linux/notifier.h`, `linux/delay.h`, `linux/mutex.h`, `linux/io.h`, `linux/interrupt.h`, `linux/workqueue.h`.
- Detected declarations: `struct tw5864_dev`, `struct tw5864_buf`, `struct tw5864_dma_buf`, `struct tw5864_input`, `struct tw5864_h264_frame`, `struct tw5864_dev`, `enum resolution`, `enum tw5864_vid_std`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
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.