linux/drivers/media/usb/stk1160/stk1160-v4l.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * STK1160 driver
 *
 * Copyright (C) 2012 Ezequiel Garcia
 * <elezegarcia--a.t--gmail.com>
 *
 * Based on Easycap driver by R.M. Thomas
 *	Copyright (C) 2010 R.M. Thomas
 *	<rmthomas--a.t--sciolus.org>
 */

#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 {};

/* supported video standards */
static struct stk1160_fmt format[] =;

/*
 * Helper to find the next divisor that results in modulo being zero.
 * This is required to guarantee valid decimation unit counts.
 */
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)
{}

/*
 * Set a new alternate setting.
 * Returns true is dev->max_pkt_size has changed, false otherwise.
 */
static bool stk1160_set_alternate(struct stk1160 *dev)
{}

static int stk1160_start_streaming(struct stk1160 *dev)
{}

/* Must be called with v4l_lock hold */
static void stk1160_stop_hw(struct stk1160 *dev)
{}

static int stk1160_stop_streaming(struct stk1160 *dev)
{}

static const struct v4l2_file_operations stk1160_fops =;

/*
 * vidioc ioctls
 */
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 =;

/********************************************************************/

/*
 * Videobuf2 operations
 */
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)
{}

/* abort streaming and wait for last buffer */
static void stop_streaming(struct vb2_queue *vq)
{}

static const struct vb2_ops stk1160_video_qops =;

static const struct video_device v4l_template =;

/********************************************************************/

/* Must be called with both v4l_lock and vb_queue_lock hold */
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)
{}