drivers/media/usb/hdpvr/hdpvr.h

Source file repositories/reference/linux-study-clean/drivers/media/usb/hdpvr/hdpvr.h

File Facts

System
Linux kernel
Corpus path
drivers/media/usb/hdpvr/hdpvr.h
Extension
.h
Size
7670 bytes
Lines
325
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 hdpvr_options {
	u8	video_std;
	u8	video_input;
	u8	audio_input;
	u8	bitrate;	/* in 100kbps */
	u8	peak_bitrate;	/* in 100kbps */
	u8	bitrate_mode;
	u8	gop_mode;
	enum v4l2_mpeg_audio_encoding	audio_codec;
	u8	brightness;
	u8	contrast;
	u8	hue;
	u8	saturation;
	u8	sharpness;
};

/* Structure to hold all of our device specific stuff */
struct hdpvr_device {
	/* the v4l device for this device */
	struct video_device	video_dev;
	/* the control handler for this device */
	struct v4l2_ctrl_handler hdl;
	/* the usb device for this device */
	struct usb_device	*udev;
	/* v4l2-device unused */
	struct v4l2_device	v4l2_dev;
	struct { /* video mode/bitrate control cluster */
		struct v4l2_ctrl *video_mode;
		struct v4l2_ctrl *video_bitrate;
		struct v4l2_ctrl *video_bitrate_peak;
	};
	/* v4l2 format */
	uint width, height;

	/* the max packet size of the bulk endpoint */
	size_t			bulk_in_size;
	/* the address of the bulk in endpoint */
	__u8			bulk_in_endpointAddr;

	/* holds the current device status */
	__u8			status;

	/* holds the current set options */
	struct hdpvr_options	options;
	v4l2_std_id		cur_std;
	struct v4l2_dv_timings	cur_dv_timings;

	uint			flags;

	/* synchronize I/O */
	struct mutex		io_mutex;
	/* available buffers */
	struct list_head	free_buff_list;
	/* in progress buffers */
	struct list_head	rec_buff_list;
	/* waitqueue for buffers */
	wait_queue_head_t	wait_buffer;
	/* waitqueue for data */
	wait_queue_head_t	wait_data;
	/**/
	struct work_struct	worker;
	/* current stream owner */
	struct v4l2_fh		*owner;

	/* I2C adapter */
	struct i2c_adapter	i2c_adapter;
	/* I2C lock */
	struct mutex		i2c_mutex;
	/* I2C message buffer space */
	char			i2c_buf[HDPVR_I2C_MAX_SIZE];

	/* For passing data to ir-kbd-i2c */
	struct IR_i2c_init_data	ir_i2c_init_data;

	/* usb control transfer buffer and lock */
	struct mutex		usbc_mutex;
	u8			*usbc_buf;
	u8			fw_ver;
};

static inline struct hdpvr_device *to_hdpvr_dev(struct v4l2_device *v4l2_dev)
{
	return container_of(v4l2_dev, struct hdpvr_device, v4l2_dev);
}


/* buffer one bulk urb of data */
struct hdpvr_buffer {
	struct list_head	buff_list;

Annotation

Implementation Notes