#include <linux/module.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/dmaengine.h>
#include <linux/platform_device.h>
#include <media/v4l2-mem2mem.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
#include <media/videobuf2-dma-contig.h>
#define MEM2MEM_TEST_MODULE_NAME …
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_VERSION(…) …;
static bool debug;
module_param(debug, bool, 0644);
#define MEM2MEM_CAPTURE …
#define MEM2MEM_OUTPUT …
#define MEM2MEM_NAME …
#define dprintk(dev, fmt, arg...) …
struct deinterlace_fmt { … };
static struct deinterlace_fmt formats[] = …;
#define NUM_FORMATS …
struct deinterlace_q_data { … };
enum { … };
enum { … };
static struct deinterlace_q_data q_data[2];
static struct deinterlace_q_data *get_q_data(enum v4l2_buf_type type)
{ … }
static struct deinterlace_fmt *find_format(struct v4l2_format *f)
{ … }
struct deinterlace_dev { … };
struct deinterlace_ctx { … };
static int deinterlace_job_ready(void *priv)
{ … }
static void deinterlace_job_abort(void *priv)
{ … }
static void dma_callback(void *data)
{ … }
static void deinterlace_issue_dma(struct deinterlace_ctx *ctx, int op,
int do_callback)
{ … }
static void deinterlace_device_run(void *priv)
{ … }
static int vidioc_querycap(struct file *file, void *priv,
struct v4l2_capability *cap)
{ … }
static int enum_fmt(struct v4l2_fmtdesc *f, u32 type)
{ … }
static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_fmtdesc *f)
{ … }
static int vidioc_enum_fmt_vid_out(struct file *file, void *priv,
struct v4l2_fmtdesc *f)
{ … }
static int vidioc_g_fmt(struct deinterlace_ctx *ctx, struct v4l2_format *f)
{ … }
static int vidioc_g_fmt_vid_out(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int vidioc_g_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int vidioc_try_fmt(struct v4l2_format *f, struct deinterlace_fmt *fmt)
{ … }
static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int vidioc_try_fmt_vid_out(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int vidioc_s_fmt(struct deinterlace_ctx *ctx, struct v4l2_format *f)
{ … }
static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int vidioc_s_fmt_vid_out(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int vidioc_streamon(struct file *file, void *priv,
enum v4l2_buf_type type)
{ … }
static const struct v4l2_ioctl_ops deinterlace_ioctl_ops = …;
static int deinterlace_queue_setup(struct vb2_queue *vq,
unsigned int *nbuffers, unsigned int *nplanes,
unsigned int sizes[], struct device *alloc_devs[])
{ … }
static int deinterlace_buf_prepare(struct vb2_buffer *vb)
{ … }
static void deinterlace_buf_queue(struct vb2_buffer *vb)
{ … }
static const struct vb2_ops deinterlace_qops = …;
static int queue_init(void *priv, struct vb2_queue *src_vq,
struct vb2_queue *dst_vq)
{ … }
static int deinterlace_open(struct file *file)
{ … }
static int deinterlace_release(struct file *file)
{ … }
static const struct v4l2_file_operations deinterlace_fops = …;
static const struct video_device deinterlace_videodev = …;
static const struct v4l2_m2m_ops m2m_ops = …;
static int deinterlace_probe(struct platform_device *pdev)
{ … }
static void deinterlace_remove(struct platform_device *pdev)
{ … }
static struct platform_driver deinterlace_pdrv = …;
module_platform_driver(…) …;