#include <linux/module.h>
#include <linux/usb.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/videodev2.h>
#include <media/v4l2-device.h>
#include <media/v4l2-common.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-fh.h>
#include <media/v4l2-event.h>
#include <media/videobuf2-vmalloc.h>
#include <media/i2c/saa7115.h>
#include "stk1160.h"
#include "stk1160-reg.h"
static bool keep_buffers;
module_param(keep_buffers, bool, 0644);
MODULE_PARM_DESC(…) …;
enum stk1160_decimate_mode { … };
struct stk1160_decimate_ctrl { … };
static struct stk1160_fmt format[] = …;
static unsigned int
div_round_integer(unsigned int x, unsigned int y)
{ … }
static void stk1160_set_std(struct stk1160 *dev)
{ … }
static void stk1160_set_fmt(struct stk1160 *dev,
struct stk1160_decimate_ctrl *ctrl)
{ … }
static bool stk1160_set_alternate(struct stk1160 *dev)
{ … }
static int stk1160_start_streaming(struct stk1160 *dev)
{ … }
static void stk1160_stop_hw(struct stk1160 *dev)
{ … }
static int stk1160_stop_streaming(struct stk1160 *dev)
{ … }
static const struct v4l2_file_operations stk1160_fops = …;
static int vidioc_querycap(struct file *file,
void *priv, struct v4l2_capability *cap)
{ … }
static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_fmtdesc *f)
{ … }
static int vidioc_g_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int stk1160_try_fmt(struct stk1160 *dev, struct v4l2_format *f,
struct stk1160_decimate_ctrl *ctrl)
{ … }
static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int vidioc_querystd(struct file *file, void *priv, v4l2_std_id *norm)
{ … }
static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *norm)
{ … }
static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id norm)
{ … }
static int vidioc_enum_input(struct file *file, void *priv,
struct v4l2_input *i)
{ … }
static int vidioc_g_input(struct file *file, void *priv, unsigned int *i)
{ … }
static int vidioc_s_input(struct file *file, void *priv, unsigned int i)
{ … }
#ifdef CONFIG_VIDEO_ADV_DEBUG
static int vidioc_g_register(struct file *file, void *priv,
struct v4l2_dbg_register *reg)
{ … }
static int vidioc_s_register(struct file *file, void *priv,
const struct v4l2_dbg_register *reg)
{ … }
#endif
static const struct v4l2_ioctl_ops stk1160_ioctl_ops = …;
static int queue_setup(struct vb2_queue *vq,
unsigned int *nbuffers, unsigned int *nplanes,
unsigned int sizes[], struct device *alloc_devs[])
{ … }
static void buffer_queue(struct vb2_buffer *vb)
{ … }
static int start_streaming(struct vb2_queue *vq, unsigned int count)
{ … }
static void stop_streaming(struct vb2_queue *vq)
{ … }
static const struct vb2_ops stk1160_video_qops = …;
static const struct video_device v4l_template = …;
void stk1160_clear_queue(struct stk1160 *dev, enum vb2_buffer_state vb2_state)
{ … }
int stk1160_vb2_setup(struct stk1160 *dev)
{ … }
int stk1160_video_register(struct stk1160 *dev)
{ … }