drivers/media/usb/usbtv/usbtv.h
Source file repositories/reference/linux-study-clean/drivers/media/usb/usbtv/usbtv.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/usb/usbtv/usbtv.h- Extension
.h- Size
- 4216 bytes
- Lines
- 139
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/slab.hlinux/usb.hmedia/v4l2-device.hmedia/v4l2-ctrls.hmedia/videobuf2-v4l2.hmedia/videobuf2-vmalloc.h
Detected Declarations
struct usbtv_norm_paramsstruct usbtv_bufstruct usbtv
Annotated Snippet
struct usbtv_norm_params {
v4l2_std_id norm;
int cap_width, cap_height;
};
/* A single videobuf2 frame buffer. */
struct usbtv_buf {
struct vb2_v4l2_buffer vb;
struct list_head list;
};
/* Per-device structure. */
struct usbtv {
struct device *dev;
struct usb_device *udev;
/* video */
struct v4l2_device v4l2_dev;
struct v4l2_ctrl_handler ctrl;
struct video_device vdev;
struct vb2_queue vb2q;
struct mutex v4l2_lock;
struct mutex vb2q_lock;
/* List of videobuf2 buffers protected by a lock. */
spinlock_t buflock;
struct list_head bufs;
/* Number of currently processed frame, useful find
* out when a new one begins. */
u32 frame_id;
int chunks_done;
enum {
USBTV_COMPOSITE_INPUT,
USBTV_SVIDEO_INPUT,
} input;
v4l2_std_id norm;
int width, height;
int n_chunks;
int iso_size;
int last_odd;
unsigned int sequence;
struct urb *isoc_urbs[USBTV_ISOC_TRANSFERS];
/* audio */
struct snd_card *snd;
struct snd_pcm_substream *snd_substream;
atomic_t snd_stream;
struct work_struct snd_trigger;
struct urb *snd_bulk_urb;
size_t snd_buffer_pos;
size_t snd_period_pos;
};
int usbtv_set_regs(struct usbtv *usbtv, const u16 regs[][2], int size);
int usbtv_video_init(struct usbtv *usbtv);
void usbtv_video_free(struct usbtv *usbtv);
int usbtv_audio_init(struct usbtv *usbtv);
void usbtv_audio_free(struct usbtv *usbtv);
void usbtv_audio_suspend(struct usbtv *usbtv);
void usbtv_audio_resume(struct usbtv *usbtv);
Annotation
- Immediate include surface: `linux/module.h`, `linux/slab.h`, `linux/usb.h`, `media/v4l2-device.h`, `media/v4l2-ctrls.h`, `media/videobuf2-v4l2.h`, `media/videobuf2-vmalloc.h`.
- Detected declarations: `struct usbtv_norm_params`, `struct usbtv_buf`, `struct usbtv`.
- Atlas domain: Driver Families / drivers/media.
- 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.