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.

Dependency Surface

Detected Declarations

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

Implementation Notes