#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/uaccess.h>
#include <linux/usb.h>
#include <linux/mutex.h>
#include <linux/workqueue.h>
#include <linux/videodev2.h>
#include <linux/v4l2-dv-timings.h>
#include <media/v4l2-dev.h>
#include <media/v4l2-common.h>
#include <media/v4l2-dv-timings.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-event.h>
#include "hdpvr.h"
#define BULK_URB_TIMEOUT …
#define print_buffer_status() …
static const struct v4l2_dv_timings hdpvr_dv_timings[] = …;
#define HDPVR_DEF_DV_TIMINGS_IDX …
struct hdpvr_fh { … };
static uint list_size(struct list_head *list)
{ … }
static void hdpvr_read_bulk_callback(struct urb *urb)
{ … }
int hdpvr_cancel_queue(struct hdpvr_device *dev)
{ … }
static int hdpvr_free_queue(struct list_head *q)
{ … }
int hdpvr_free_buffers(struct hdpvr_device *dev)
{ … }
int hdpvr_alloc_buffers(struct hdpvr_device *dev, uint count)
{ … }
static int hdpvr_submit_buffers(struct hdpvr_device *dev)
{ … }
static struct hdpvr_buffer *hdpvr_get_next_buffer(struct hdpvr_device *dev)
{ … }
static void hdpvr_transmit_buffers(struct work_struct *work)
{ … }
static int hdpvr_start_streaming(struct hdpvr_device *dev)
{ … }
static int hdpvr_stop_streaming(struct hdpvr_device *dev)
{ … }
static int hdpvr_open(struct file *file)
{ … }
static int hdpvr_release(struct file *file)
{ … }
static ssize_t hdpvr_read(struct file *file, char __user *buffer, size_t count,
loff_t *pos)
{ … }
static __poll_t hdpvr_poll(struct file *filp, poll_table *wait)
{ … }
static const struct v4l2_file_operations hdpvr_fops = …;
static int vidioc_querycap(struct file *file, void *priv,
struct v4l2_capability *cap)
{ … }
static int vidioc_s_std(struct file *file, void *_fh,
v4l2_std_id std)
{ … }
static int vidioc_g_std(struct file *file, void *_fh,
v4l2_std_id *std)
{ … }
static int vidioc_querystd(struct file *file, void *_fh, v4l2_std_id *a)
{ … }
static int vidioc_s_dv_timings(struct file *file, void *_fh,
struct v4l2_dv_timings *timings)
{ … }
static int vidioc_g_dv_timings(struct file *file, void *_fh,
struct v4l2_dv_timings *timings)
{ … }
static int vidioc_query_dv_timings(struct file *file, void *_fh,
struct v4l2_dv_timings *timings)
{ … }
static int vidioc_enum_dv_timings(struct file *file, void *_fh,
struct v4l2_enum_dv_timings *timings)
{ … }
static int vidioc_dv_timings_cap(struct file *file, void *_fh,
struct v4l2_dv_timings_cap *cap)
{ … }
static const char *iname[] = …;
static int vidioc_enum_input(struct file *file, void *_fh, struct v4l2_input *i)
{ … }
static int vidioc_s_input(struct file *file, void *_fh,
unsigned int index)
{ … }
static int vidioc_g_input(struct file *file, void *private_data,
unsigned int *index)
{ … }
static const char *audio_iname[] = …;
static int vidioc_enumaudio(struct file *file, void *priv,
struct v4l2_audio *audio)
{ … }
static int vidioc_s_audio(struct file *file, void *private_data,
const struct v4l2_audio *audio)
{ … }
static int vidioc_g_audio(struct file *file, void *private_data,
struct v4l2_audio *audio)
{ … }
static int hdpvr_try_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static int hdpvr_s_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static int vidioc_enum_fmt_vid_cap(struct file *file, void *private_data,
struct v4l2_fmtdesc *f)
{ … }
static int vidioc_g_fmt_vid_cap(struct file *file, void *_fh,
struct v4l2_format *f)
{ … }
static int vidioc_encoder_cmd(struct file *filp, void *priv,
struct v4l2_encoder_cmd *a)
{ … }
static int vidioc_try_encoder_cmd(struct file *filp, void *priv,
struct v4l2_encoder_cmd *a)
{ … }
static const struct v4l2_ioctl_ops hdpvr_ioctl_ops = …;
static void hdpvr_device_release(struct video_device *vdev)
{ … }
static const struct video_device hdpvr_video_template = …;
static const struct v4l2_ctrl_ops hdpvr_ctrl_ops = …;
int hdpvr_register_videodev(struct hdpvr_device *dev, struct device *parent,
int devnum)
{ … }