linux/drivers/media/usb/cx231xx/cx231xx-video.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
   cx231xx-video.c - driver for Conexant Cx23100/101/102
		     USB video capture devices

   Copyright (C) 2008 <srinivasa.deevi at conexant dot com>
	Based on em28xx driver
	Based on cx23885 driver
	Based on cx88 driver

 */

#include "cx231xx.h"
#include <linux/init.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/bitmap.h>
#include <linux/i2c.h>
#include <linux/mm.h>
#include <linux/mutex.h>
#include <linux/slab.h>

#include <media/v4l2-common.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-event.h>
#include <media/drv-intf/msp3400.h>
#include <media/tuner.h>

#include <media/dvb_frontend.h>

#include "cx231xx-vbi.h"

#define CX231XX_VERSION

#define DRIVER_AUTHOR
#define DRIVER_DESC

#define cx231xx_videodbg(fmt, arg...)

static unsigned int isoc_debug;
module_param(isoc_debug, int, 0644);
MODULE_PARM_DESC();

#define cx231xx_isocdbg(fmt, arg...)

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_VERSION();

static unsigned int card[]     =;
static unsigned int video_nr[] =;
static unsigned int vbi_nr[]   =;
static unsigned int radio_nr[] =;

module_param_array();
module_param_array();
module_param_array();
module_param_array();

MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();

static unsigned int video_debug;
module_param(video_debug, int, 0644);
MODULE_PARM_DESC();

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


static int cx231xx_enable_analog_tuner(struct cx231xx *dev)
{}

/* ------------------------------------------------------------------
	Video buffer and parser functions
   ------------------------------------------------------------------*/

/*
 * Announces that a buffer were filled and request the next
 */
static inline void buffer_filled(struct cx231xx *dev,
				 struct cx231xx_dmaqueue *dma_q,
				 struct cx231xx_buffer *buf)
{}

static inline void print_err_status(struct cx231xx *dev, int packet, int status)
{}

/*
 * generic routine to get the next available buffer
 */
static inline void get_next_buf(struct cx231xx_dmaqueue *dma_q,
				struct cx231xx_buffer **buf)
{}

/*
 * Controls the isoc copy of each urb packet
 */
static inline int cx231xx_isoc_copy(struct cx231xx *dev, struct urb *urb)
{}

static inline int cx231xx_bulk_copy(struct cx231xx *dev, struct urb *urb)
{}


u8 cx231xx_find_boundary_SAV_EAV(u8 *p_buffer, u8 *partial_buf,
				 u32 *p_bytes_used)
{}

u8 cx231xx_find_next_SAV_EAV(u8 *p_buffer, u32 buffer_size, u32 *p_bytes_used)
{}

u32 cx231xx_get_video_line(struct cx231xx *dev,
			   struct cx231xx_dmaqueue *dma_q, u8 sav_eav,
			   u8 *p_buffer, u32 buffer_size)
{}

u32 cx231xx_copy_video_line(struct cx231xx *dev,
			    struct cx231xx_dmaqueue *dma_q, u8 *p_line,
			    u32 length, int field_number)
{}

void cx231xx_reset_video_buffer(struct cx231xx *dev,
				struct cx231xx_dmaqueue *dma_q)
{}

int cx231xx_do_copy(struct cx231xx *dev, struct cx231xx_dmaqueue *dma_q,
		    u8 *p_buffer, u32 bytes_to_copy)
{}

void cx231xx_swab(u16 *from, u16 *to, u16 len)
{}

u8 cx231xx_is_buffer_done(struct cx231xx *dev, struct cx231xx_dmaqueue *dma_q)
{}

/* ------------------------------------------------------------------
	Videobuf 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 void return_all_buffers(struct cx231xx *dev,
			       enum vb2_buffer_state state)
{}

static int start_streaming(struct vb2_queue *vq, unsigned int count)
{}

static void stop_streaming(struct vb2_queue *vq)
{}

static const struct vb2_ops cx231xx_video_qops =;

/*********************  v4l2 interface  **************************************/

void video_mux(struct cx231xx *dev, int index)
{}

/* ------------------------------------------------------------------
	IOCTL vidioc handling
   ------------------------------------------------------------------*/

static int vidioc_g_fmt_vid_cap(struct file *file, void *priv,
				struct v4l2_format *f)
{}

static struct cx231xx_fmt *format_by_fourcc(unsigned int fourcc)
{}

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_g_std(struct file *file, void *priv, v4l2_std_id *id)
{}

static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id norm)
{}

static const char *iname[] =;

void cx231xx_v4l2_create_entities(struct cx231xx *dev)
{}

int cx231xx_enum_input(struct file *file, void *priv,
			     struct v4l2_input *i)
{}

int cx231xx_g_input(struct file *file, void *priv, unsigned int *i)
{}

int cx231xx_s_input(struct file *file, void *priv, unsigned int i)
{}

int cx231xx_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
{}

int cx231xx_s_tuner(struct file *file, void *priv, const struct v4l2_tuner *t)
{}

int cx231xx_g_frequency(struct file *file, void *priv,
			      struct v4l2_frequency *f)
{}

int cx231xx_s_frequency(struct file *file, void *priv,
			      const struct v4l2_frequency *f)
{}

#ifdef CONFIG_VIDEO_ADV_DEBUG

int cx231xx_g_chip_info(struct file *file, void *fh,
			struct v4l2_dbg_chip_info *chip)
{}

int cx231xx_g_register(struct file *file, void *priv,
			     struct v4l2_dbg_register *reg)
{}

int cx231xx_s_register(struct file *file, void *priv,
			     const struct v4l2_dbg_register *reg)
{}
#endif

static int vidioc_g_pixelaspect(struct file *file, void *priv,
				int type, struct v4l2_fract *f)
{}

static int vidioc_g_selection(struct file *file, void *priv,
			      struct v4l2_selection *s)
{}

int cx231xx_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)
{}

/* RAW VBI ioctls */

static int vidioc_g_fmt_vbi_cap(struct file *file, void *priv,
				struct v4l2_format *f)
{}

static int vidioc_try_fmt_vbi_cap(struct file *file, void *priv,
				  struct v4l2_format *f)
{}

static int vidioc_s_fmt_vbi_cap(struct file *file, void *priv,
				  struct v4l2_format *f)
{}

/* ----------------------------------------------------------- */
/* RADIO ESPECIFIC IOCTLS                                      */
/* ----------------------------------------------------------- */

static int radio_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
{}
static int radio_s_tuner(struct file *file, void *priv, const struct v4l2_tuner *t)
{}

/*
 * cx231xx_v4l2_open()
 * inits the device and starts isoc transfer
 */
static int cx231xx_v4l2_open(struct file *filp)
{}

/*
 * cx231xx_realease_resources()
 * unregisters the v4l2,i2c and usb devices
 * called when the device gets disconnected or at module unload
*/
void cx231xx_release_analog_resources(struct cx231xx *dev)
{}

/*
 * cx231xx_close()
 * stops streaming and deallocates all resources allocated by the v4l2
 * calls and ioctls
 */
static int cx231xx_close(struct file *filp)
{}

static int cx231xx_v4l2_close(struct file *filp)
{}

static const struct v4l2_file_operations cx231xx_v4l_fops =;

static const struct v4l2_ioctl_ops video_ioctl_ops =;

static struct video_device cx231xx_vbi_template;

static const struct video_device cx231xx_video_template =;

static const struct v4l2_file_operations radio_fops =;

static const struct v4l2_ioctl_ops radio_ioctl_ops =;

static struct video_device cx231xx_radio_template =;

/******************************** usb interface ******************************/

static void cx231xx_vdev_init(struct cx231xx *dev,
		struct video_device *vfd,
		const struct video_device *template,
		const char *type_name)
{}

int cx231xx_register_analog_devices(struct cx231xx *dev)
{}