linux/drivers/media/pci/zoran/zoran_driver.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Zoran zr36057/zr36067 PCI controller driver, for the
 * Pinnacle/Miro DC10/DC10+/DC30/DC30+, Iomega Buz, Linux
 * Media Labs LML33/LML33R10.
 *
 * Copyright (C) 2000 Serguei Miridonov <[email protected]>
 *
 * Changes for BUZ by Wolfgang Scherr <[email protected]>
 *
 * Changes for DC10/DC30 by Laurent Pinchart <[email protected]>
 *
 * Changes for LML33R10 by Maxim Yevtyushkin <[email protected]>
 *
 * Changes for videodev2/v4l2 by Ronald Bultje <[email protected]>
 *
 * Based on
 *
 * Miro DC10 driver
 * Copyright (C) 1999 Wolfgang Scherr <[email protected]>
 *
 * Iomega Buz driver version 1.0
 * Copyright (C) 1999 Rainer Johanni <[email protected]>
 *
 * buz.0.0.3
 * Copyright (C) 1998 Dave Perks <[email protected]>
 *
 * bttv - Bt848 frame grabber driver
 * Copyright (C) 1996,97,98 Ralph  Metzler ([email protected])
 *                        & Marcus Metzler ([email protected])
 */

#include <linux/init.h>
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/pci.h>
#include <linux/wait.h>

#include <linux/interrupt.h>
#include <linux/i2c.h>
#include <linux/i2c-algo-bit.h>

#include <linux/spinlock.h>

#include <linux/videodev2.h>
#include <media/v4l2-common.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-event.h>
#include "videocodec.h"

#include <linux/io.h>
#include <linux/uaccess.h>

#include <linux/mutex.h>
#include "zoran.h"
#include "zoran_device.h"
#include "zoran_card.h"

const struct zoran_format zoran_formats[] =;

#define NUM_FORMATS

	/*
	 * small helper function for calculating buffersizes for v4l2
	 * we calculate the nearest higher power-of-two, which
	 * will be the recommended buffersize
	 */
static __u32 zoran_v4l2_calc_bufsize(struct zoran_jpg_settings *settings)
{}

/*
 *   V4L Buffer grabbing
 */
static int zoran_v4l_set_format(struct zoran *zr, int width, int height,
				const struct zoran_format *format)
{}

static int zoran_set_norm(struct zoran *zr, v4l2_std_id norm)
{}

static int zoran_set_input(struct zoran *zr, int input)
{}

/*
 *   ioctl routine
 */

static int zoran_querycap(struct file *file, void *__fh, struct v4l2_capability *cap)
{}

static int zoran_enum_fmt(struct zoran *zr, struct v4l2_fmtdesc *fmt, int flag)
{}

static int zoran_enum_fmt_vid_cap(struct file *file, void *__fh,
				  struct v4l2_fmtdesc *f)
{}

static int zoran_g_fmt_vid_out(struct file *file, void *__fh,
			       struct v4l2_format *fmt)
{}

static int zoran_g_fmt_vid_cap(struct file *file, void *__fh,
			       struct v4l2_format *fmt)
{}

static int zoran_try_fmt_vid_out(struct file *file, void *__fh,
				 struct v4l2_format *fmt)
{}

static int zoran_try_fmt_vid_cap(struct file *file, void *__fh,
				 struct v4l2_format *fmt)
{}

static int zoran_s_fmt_vid_out(struct file *file, void *__fh,
			       struct v4l2_format *fmt)
{}

static int zoran_s_fmt_vid_cap(struct file *file, void *__fh,
			       struct v4l2_format *fmt)
{}

static int zoran_g_std(struct file *file, void *__fh, v4l2_std_id *std)
{}

static int zoran_s_std(struct file *file, void *__fh, v4l2_std_id std)
{}

static int zoran_enum_input(struct file *file, void *__fh,
			    struct v4l2_input *inp)
{}

static int zoran_g_input(struct file *file, void *__fh, unsigned int *input)
{}

static int zoran_s_input(struct file *file, void *__fh, unsigned int input)
{}

/* cropping (sub-frame capture) */
static int zoran_g_selection(struct file *file, void *__fh, struct v4l2_selection *sel)
{}

static int zoran_s_selection(struct file *file, void *__fh, struct v4l2_selection *sel)
{}

/*
 * Output is disabled temporarily
 * Zoran is picky about jpeg data it accepts. At least it seems to unsupport COM and APPn.
 * So until a way to filter data will be done, disable output.
 */
static const struct v4l2_ioctl_ops zoran_ioctl_ops =;

static const struct v4l2_file_operations zoran_fops =;

const struct video_device zoran_template =;

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

static void zr_vb2_queue(struct vb2_buffer *vb)
{}

static int zr_vb2_prepare(struct vb2_buffer *vb)
{}

int zr_set_buf(struct zoran *zr)
{}

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

static void zr_vb2_stop_streaming(struct vb2_queue *vq)
{}

static const struct vb2_ops zr_video_qops =;

int zoran_queue_init(struct zoran *zr, struct vb2_queue *vq, int dir)
{}

void zoran_queue_exit(struct zoran *zr)
{}