linux/drivers/media/usb/dvb-usb/cxusb-analog.c

// SPDX-License-Identifier: GPL-2.0+
//
// DVB USB compliant linux driver for Conexant USB reference design -
// (analog part).
//
// Copyright (C) 2011, 2017, 2018
//	Maciej S. Szmigiero ([email protected])
//
// In case there are new analog / DVB-T hybrid devices released in the market
// using the same general design as Medion MD95700: a CX25840 video decoder
// outputting a BT.656 stream to a USB bridge chip which then forwards it to
// the host in isochronous USB packets this code should be made generic, with
// board specific bits implemented via separate card structures.
//
// This is, however, unlikely as the Medion model was released
// years ago (in 2005).
//
// TODO:
//  * audio support,
//  * finish radio support (requires audio of course),
//  * VBI support,
//  * controls support

#include <linux/bitops.h>
#include <linux/device.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/ktime.h>
#include <linux/vmalloc.h>
#include <media/drv-intf/cx25840.h>
#include <media/tuner.h>
#include <media/v4l2-fh.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-subdev.h>
#include <media/videobuf2-vmalloc.h>

#include "cxusb.h"

static int cxusb_medion_v_queue_setup(struct vb2_queue *q,
				      unsigned int *num_buffers,
				      unsigned int *num_planes,
				      unsigned int sizes[],
				      struct device *alloc_devs[])
{}

static int cxusb_medion_v_buf_init(struct vb2_buffer *vb)
{}

static void cxusb_auxbuf_init(struct dvb_usb_device *dvbdev,
			      struct cxusb_medion_auxbuf *auxbuf,
			      u8 *buf, unsigned int len)
{}

static void cxusb_auxbuf_head_trim(struct dvb_usb_device *dvbdev,
				   struct cxusb_medion_auxbuf *auxbuf,
				   unsigned int pos)
{}

static unsigned int cxusb_auxbuf_paylen(struct cxusb_medion_auxbuf *auxbuf)
{}

static bool cxusb_auxbuf_make_space(struct dvb_usb_device *dvbdev,
				    struct cxusb_medion_auxbuf *auxbuf,
				    unsigned int howmuch)
{}

/* returns false if some data was overwritten */
static bool cxusb_auxbuf_append_urb(struct dvb_usb_device *dvbdev,
				    struct cxusb_medion_auxbuf *auxbuf,
				    struct urb *urb)
{}

static bool cxusb_auxbuf_copy(struct cxusb_medion_auxbuf *auxbuf,
			      unsigned int pos, unsigned char *dest,
			      unsigned int len)
{}

static bool cxusb_medion_cf_refc_fld_chg(struct dvb_usb_device *dvbdev,
					 struct cxusb_bt656_params *bt656,
					 bool firstfield,
					 unsigned int maxlines,
					 unsigned int maxlinesamples,
					 unsigned char buf[4])
{}

static void cxusb_medion_cf_refc_start_sch(struct dvb_usb_device *dvbdev,
					   struct cxusb_bt656_params *bt656,
					   bool firstfield,
					   unsigned char buf[4])
{}

static void cxusb_medion_cf_refc_line_smpl(struct dvb_usb_device *dvbdev,
					   struct cxusb_bt656_params *bt656,
					   bool firstfield,
					   unsigned int maxlinesamples,
					   unsigned char buf[4])
{}

static void cxusb_medion_cf_refc_vbi_smpl(struct dvb_usb_device *dvbdev,
					  struct cxusb_bt656_params *bt656,
					  unsigned char buf[4])
{}

/* returns whether the whole 4-byte code should be skipped in the buffer */
static bool cxusb_medion_cf_ref_code(struct dvb_usb_device *dvbdev,
				     struct cxusb_bt656_params *bt656,
				     bool firstfield,
				     unsigned int maxlines,
				     unsigned int maxlinesamples,
				     unsigned char buf[4])
{}

static bool cxusb_medion_cs_start_sch(struct dvb_usb_device *dvbdev,
				      struct cxusb_medion_auxbuf *auxbuf,
				      struct cxusb_bt656_params *bt656,
				      unsigned int maxlinesamples)
{}

static void cxusb_medion_cs_line_smpl(struct cxusb_bt656_params *bt656,
				      unsigned int maxlinesamples,
				      unsigned char val)
{}

static bool cxusb_medion_copy_samples(struct dvb_usb_device *dvbdev,
				      struct cxusb_medion_auxbuf *auxbuf,
				      struct cxusb_bt656_params *bt656,
				      unsigned int maxlinesamples,
				      unsigned char val)
{}

static bool cxusb_medion_copy_field(struct dvb_usb_device *dvbdev,
				    struct cxusb_medion_auxbuf *auxbuf,
				    struct cxusb_bt656_params *bt656,
				    bool firstfield,
				    unsigned int maxlines,
				    unsigned int maxlinesmpls)
{}

static bool cxusb_medion_v_process_auxbuf(struct cxusb_medion_dev *cxdev,
					  bool reset)
{}

static bool cxusb_medion_v_complete_handle_urb(struct cxusb_medion_dev *cxdev,
					       bool *auxbuf_reset)
{}

static void cxusb_medion_v_complete_work(struct work_struct *work)
{}

static void cxusb_medion_v_complete(struct urb *u)
{}

static void cxusb_medion_urbs_free(struct cxusb_medion_dev *cxdev)
{}

static void cxusb_medion_return_buffers(struct cxusb_medion_dev *cxdev,
					bool requeue)
{}

static int cxusb_medion_v_ss_auxbuf_alloc(struct cxusb_medion_dev *cxdev,
					  int *npackets)
{}

static u32 cxusb_medion_norm2field_order(v4l2_std_id norm)
{}

static u32 cxusb_medion_field_order(struct cxusb_medion_dev *cxdev)
{}

static int cxusb_medion_v_start_streaming(struct vb2_queue *q,
					  unsigned int count)
{}

static void cxusb_medion_v_stop_streaming(struct vb2_queue *q)
{}

static void cxusub_medion_v_buf_queue(struct vb2_buffer *vb)
{}

static const struct vb2_ops cxdev_video_qops =;

static const __u32 videocaps =;
static const __u32 radiocaps =;

static int cxusb_medion_v_querycap(struct file *file, void *fh,
				   struct v4l2_capability *cap)
{}

static int cxusb_medion_v_enum_fmt_vid_cap(struct file *file, void *fh,
					   struct v4l2_fmtdesc *f)
{}

static int cxusb_medion_g_fmt_vid_cap(struct file *file, void *fh,
				      struct v4l2_format *f)
{}

static int cxusb_medion_try_s_fmt_vid_cap(struct file *file,
					  struct v4l2_format *f,
					  bool isset)
{}

static int cxusb_medion_try_fmt_vid_cap(struct file *file, void *fh,
					struct v4l2_format *f)
{}

static int cxusb_medion_s_fmt_vid_cap(struct file *file, void *fh,
				      struct v4l2_format *f)
{}

static const struct {} cxusb_medion_inputs[] =;

#define CXUSB_INPUT_CNT

static int cxusb_medion_enum_input(struct file *file, void *fh,
				   struct v4l2_input *inp)
{}

static int cxusb_medion_g_input(struct file *file, void *fh,
				unsigned int *i)
{}

static int cxusb_medion_set_norm(struct cxusb_medion_dev *cxdev,
				 v4l2_std_id norm)
{}

static int cxusb_medion_s_input(struct file *file, void *fh,
				unsigned int i)
{}

static int cxusb_medion_g_tuner(struct file *file, void *fh,
				struct v4l2_tuner *tuner)
{}

static int cxusb_medion_s_tuner(struct file *file, void *fh,
				const struct v4l2_tuner *tuner)
{}

static int cxusb_medion_g_frequency(struct file *file, void *fh,
				    struct v4l2_frequency *freq)
{}

static int cxusb_medion_s_frequency(struct file *file, void *fh,
				    const struct v4l2_frequency *freq)
{}

static int cxusb_medion_g_std(struct file *file, void *fh,
			      v4l2_std_id *norm)
{}

static int cxusb_medion_s_std(struct file *file, void *fh,
			      v4l2_std_id norm)
{}

static int cxusb_medion_querystd(struct file *file, void *fh,
				 v4l2_std_id *norm)
{}

static int cxusb_medion_log_status(struct file *file, void *fh)
{}

static const struct v4l2_ioctl_ops cxusb_video_ioctl =;

static const struct v4l2_ioctl_ops cxusb_radio_ioctl =;

/*
 * in principle, this should be const, but s_io_pin_config is declared
 * to take non-const, and gcc complains
 */
static struct v4l2_subdev_io_pin_config cxusub_medion_pin_config[] =;

int cxusb_medion_analog_init(struct dvb_usb_device *dvbdev)
{}

static int cxusb_videoradio_open(struct file *f)
{}

static int cxusb_videoradio_release(struct file *f)
{}

static const struct v4l2_file_operations cxusb_video_fops =;

static const struct v4l2_file_operations cxusb_radio_fops =;

static void cxusb_medion_v4l2_release(struct v4l2_device *v4l2_dev)
{}

static void cxusb_medion_videodev_release(struct video_device *vdev)
{}

static int cxusb_medion_register_analog_video(struct dvb_usb_device *dvbdev)
{}

static int cxusb_medion_register_analog_radio(struct dvb_usb_device *dvbdev)
{}

static int cxusb_medion_register_analog_subdevs(struct dvb_usb_device *dvbdev)
{}

int cxusb_medion_register_analog(struct dvb_usb_device *dvbdev)
{}

void cxusb_medion_unregister_analog(struct dvb_usb_device *dvbdev)
{}