drivers/media/usb/em28xx/em28xx.h
Source file repositories/reference/linux-study-clean/drivers/media/usb/em28xx/em28xx.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/usb/em28xx/em28xx.h- Extension
.h- Size
- 25822 bytes
- Lines
- 870
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/bitfield.hlinux/workqueue.hlinux/i2c.hlinux/mutex.hlinux/kref.hlinux/videodev2.hmedia/videobuf2-v4l2.hmedia/videobuf2-vmalloc.hmedia/v4l2-device.hmedia/v4l2-ctrls.hmedia/v4l2-fh.hmedia/i2c/ir-kbd-i2c.hmedia/rc-core.hxc2028.hxc5000.hem28xx-reg.h
Detected Declarations
struct em28xxstruct em28xx_usb_bufsstruct em28xx_usb_ctlstruct em28xx_fmtstruct em28xx_bufferstruct em28xx_dmaqueuestruct em28xx_audio_modestruct em28xx_reg_seqstruct em28xx_inputstruct em28xx_ledstruct em28xx_buttonstruct em28xx_boardstruct em28xx_eepromstruct em28xx_v4l2struct em28xx_audiostruct em28xx_i2c_busstruct em28xxstruct em28xx_opsenum em28xx_modeenum enum28xx_itypeenum em28xx_ac97_modeenum em28xx_int_audio_typeenum em28xx_usb_audio_typeenum em28xx_amuxenum em28xx_aoutenum em28xx_decoderenum em28xx_sensorenum em28xx_adecoderenum em28xx_led_roleenum em28xx_button_roleenum em2828x_media_padsenum em28xx_i2c_algo_typefunction ac97_return_record_select
Annotated Snippet
struct em28xx_usb_bufs {
int max_pkt_size;
int num_packets;
int num_bufs;
struct urb **urb;
char **buf;
};
/**
* struct em28xx_usb_ctl - Contains URB-related buffer data
*
* @analog_bufs: isoc/bulk transfer buffers for analog mode
* @digital_bufs: isoc/bulk transfer buffers for digital mode
* @vid_buf: Stores already requested video buffers
* @vbi_buf: Stores already requested VBI buffers
* @urb_data_copy: copy data from URB
*/
struct em28xx_usb_ctl {
struct em28xx_usb_bufs analog_bufs;
struct em28xx_usb_bufs digital_bufs;
struct em28xx_buffer *vid_buf;
struct em28xx_buffer *vbi_buf;
int (*urb_data_copy)(struct em28xx *dev, struct urb *urb);
};
/**
* struct em28xx_fmt - Struct to enumberate video formats
*
* @fourcc: v4l2 format id
* @depth: mean number of bits to represent a pixel
* @reg: em28xx register value to set it
*/
struct em28xx_fmt {
u32 fourcc;
int depth;
int reg;
};
/**
* struct em28xx_buffer- buffer for storing one video frame
*
* @vb: common v4l buffer stuff
* @list: List to associate it with the other buffers
* @mem: pointer to the buffer, as returned by vb2_plane_vaddr()
* @length: length of the buffer, as returned by vb2_plane_size()
* @top_field: If non-zero, indicate that the buffer is the top field
* @pos: Indicate the next position of the buffer to be filled.
* @vb_buf: pointer to vmalloc memory address in vb
*
* .. note::
*
* in interlaced mode, @pos is reset to zero at the start of each new
* field (not frame !)
*/
struct em28xx_buffer {
struct vb2_v4l2_buffer vb; /* must be first */
struct list_head list;
void *mem;
unsigned int length;
int top_field;
unsigned int pos;
char *vb_buf;
};
struct em28xx_dmaqueue {
struct list_head active;
wait_queue_head_t wq;
};
/* inputs */
#define MAX_EM28XX_INPUT 4
enum enum28xx_itype {
EM28XX_VMUX_COMPOSITE = 1,
EM28XX_VMUX_SVIDEO,
EM28XX_VMUX_TELEVISION,
EM28XX_RADIO,
};
enum em28xx_ac97_mode {
EM28XX_NO_AC97 = 0,
EM28XX_AC97_EM202,
EM28XX_AC97_SIGMATEL,
EM28XX_AC97_OTHER,
};
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/workqueue.h`, `linux/i2c.h`, `linux/mutex.h`, `linux/kref.h`, `linux/videodev2.h`, `media/videobuf2-v4l2.h`, `media/videobuf2-vmalloc.h`.
- Detected declarations: `struct em28xx`, `struct em28xx_usb_bufs`, `struct em28xx_usb_ctl`, `struct em28xx_fmt`, `struct em28xx_buffer`, `struct em28xx_dmaqueue`, `struct em28xx_audio_mode`, `struct em28xx_reg_seq`, `struct em28xx_input`, `struct em28xx_led`.
- 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.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.