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

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Auvitek AU0828 USB Bridge (Analog video support)
 *
 * Copyright (C) 2009 Devin Heitmueller <[email protected]>
 * Copyright (C) 2005-2008 Auvitek International, Ltd.
 */

/* Developer Notes:
 *
 * The hardware scaler supported is unimplemented
 * AC97 audio support is unimplemented (only i2s audio mode)
 *
 */

#include "au0828.h"
#include "au8522.h"

#include <linux/module.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/device.h>
#include <media/v4l2-common.h>
#include <media/v4l2-mc.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-event.h>
#include <media/tuner.h>
#include "au0828-reg.h"

static DEFINE_MUTEX(au0828_sysfs_lock);

/* ------------------------------------------------------------------
	Videobuf operations
   ------------------------------------------------------------------*/

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

#define au0828_isocdbg(fmt, arg...)

static inline void i2c_gate_ctrl(struct au0828_dev *dev, int val)
{}

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

static int check_dev(struct au0828_dev *dev)
{}

/*
 * IRQ callback, called by URB callback
 */
static void au0828_irq_callback(struct urb *urb)
{}

/*
 * Stop and Deallocate URBs
 */
static void au0828_uninit_isoc(struct au0828_dev *dev)
{}

/*
 * Allocate URBs and start IRQ
 */
static int au0828_init_isoc(struct au0828_dev *dev, int max_packets,
			    int num_bufs, int max_pkt_size,
			    int (*isoc_copy) (struct au0828_dev *dev, struct urb *urb))
{}

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

/*
 * Identify the buffer header type and properly handles
 */
static void au0828_copy_video(struct au0828_dev *dev,
			      struct au0828_dmaqueue  *dma_q,
			      struct au0828_buffer *buf,
			      unsigned char *p,
			      unsigned char *outp, unsigned long len)
{}

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

static void au0828_copy_vbi(struct au0828_dev *dev,
			      struct au0828_dmaqueue  *dma_q,
			      struct au0828_buffer *buf,
			      unsigned char *p,
			      unsigned char *outp, unsigned long len)
{}


/*
 * generic routine to get the next available VBI buffer
 */
static inline void vbi_get_next_buf(struct au0828_dmaqueue *dma_q,
				    struct au0828_buffer **buf)
{}

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

void au0828_usb_v4l2_media_release(struct au0828_dev *dev)
{}

static void au0828_usb_v4l2_release(struct v4l2_device *v4l2_dev)
{}

int au0828_v4l2_device_register(struct usb_interface *interface,
				struct au0828_dev *dev)
{}

static int queue_setup(struct vb2_queue *vq,
		       unsigned int *nbuffers, unsigned int *nplanes,
		       unsigned int sizes[], struct device *alloc_devs[])
{}

static int
buffer_prepare(struct vb2_buffer *vb)
{}

static void
buffer_queue(struct vb2_buffer *vb)
{}

static int au0828_i2s_init(struct au0828_dev *dev)
{}

/*
 * Auvitek au0828 analog stream enable
 */
static int au0828_analog_stream_enable(struct au0828_dev *d)
{}

static int au0828_analog_stream_disable(struct au0828_dev *d)
{}

static void au0828_analog_stream_reset(struct au0828_dev *dev)
{}

/*
 * Some operations needs to stop current streaming
 */
static int au0828_stream_interrupt(struct au0828_dev *dev)
{}

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

static void au0828_stop_streaming(struct vb2_queue *vq)
{}

void au0828_stop_vbi_streaming(struct vb2_queue *vq)
{}

static const struct vb2_ops au0828_video_qops =;

/* ------------------------------------------------------------------
   V4L2 interface
   ------------------------------------------------------------------*/
/*
 * au0828_analog_unregister
 * unregister v4l2 devices
 */
int au0828_analog_unregister(struct au0828_dev *dev)
{}

/* This function ensures that video frames continue to be delivered even if
   the ITU-656 input isn't receiving any data (thereby preventing applications
   such as tvtime from hanging) */
static void au0828_vid_buffer_timeout(struct timer_list *t)
{}

static void au0828_vbi_buffer_timeout(struct timer_list *t)
{}

static int au0828_v4l2_open(struct file *filp)
{}

static int au0828_v4l2_close(struct file *filp)
{}

/* Must be called with dev->lock held */
static void au0828_init_tuner(struct au0828_dev *dev)
{}

static int au0828_set_format(struct au0828_dev *dev, unsigned int cmd,
			     struct v4l2_format *format)
{}

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 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_s_std(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_enum_input(struct file *file, void *priv,
				struct v4l2_input *input)
{}

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

static void au0828_s_input(struct au0828_dev *dev, int index)
{}

static int vidioc_s_input(struct file *file, void *priv, unsigned int index)
{}

static int vidioc_enumaudio(struct file *file, void *priv, struct v4l2_audio *a)
{}

static int vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *a)
{}

static int vidioc_s_audio(struct file *file, void *priv, const struct v4l2_audio *a)
{}

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

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

static int vidioc_g_frequency(struct file *file, void *priv,
				struct v4l2_frequency *freq)
{}

static int vidioc_s_frequency(struct file *file, void *priv,
				const struct v4l2_frequency *freq)
{}


/* RAW VBI ioctls */

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

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

#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 int vidioc_log_status(struct file *file, void *fh)
{}

void au0828_v4l2_suspend(struct au0828_dev *dev)
{}

void au0828_v4l2_resume(struct au0828_dev *dev)
{}

static const struct v4l2_file_operations au0828_v4l_fops =;

static const struct v4l2_ioctl_ops video_ioctl_ops =;

static const struct video_device au0828_video_template =;

static int au0828_vb2_setup(struct au0828_dev *dev)
{}

static void au0828_analog_create_entities(struct au0828_dev *dev)
{}

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

int au0828_analog_register(struct au0828_dev *dev,
			   struct usb_interface *interface)
{}