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.
- 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/usb.hlinux/i2c.hlinux/mutex.hlinux/workqueue.hlinux/videodev2.hmedia/v4l2-device.hmedia/v4l2-ctrls.hmedia/i2c/ir-kbd-i2c.h
Detected Declarations
struct hdpvr_optionsstruct hdpvr_devicestruct hdpvr_bufferstruct hdpvr_video_infoenum hdpvr_video_stdenum hdpvr_video_inputenum hdpvr_audio_inputsenum hdpvr_bitrate_modeenum hdpvr_gop_mode
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
- Immediate include surface: `linux/usb.h`, `linux/i2c.h`, `linux/mutex.h`, `linux/workqueue.h`, `linux/videodev2.h`, `media/v4l2-device.h`, `media/v4l2-ctrls.h`, `media/i2c/ir-kbd-i2c.h`.
- Detected declarations: `struct hdpvr_options`, `struct hdpvr_device`, `struct hdpvr_buffer`, `struct hdpvr_video_info`, `enum hdpvr_video_std`, `enum hdpvr_video_input`, `enum hdpvr_audio_inputs`, `enum hdpvr_bitrate_mode`, `enum hdpvr_gop_mode`.
- 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.