#include <linux/module.h>
#include <linux/fs.h>
#include <linux/timer.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/clk.h>
#include <linux/interrupt.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <media/v4l2-mem2mem.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-event.h>
#include <media/videobuf2-v4l2.h>
#include <media/videobuf2-dma-contig.h>
#include "dma2d.h"
#include "dma2d-regs.h"
#define fh2ctx(__fh) …
static const struct dma2d_fmt formats[] = …;
#define NUM_FORMATS …
static const struct dma2d_frame def_frame = …;
static struct dma2d_fmt *find_fmt(int pixelformat)
{ … }
static struct dma2d_frame *get_frame(struct dma2d_ctx *ctx,
enum v4l2_buf_type type)
{ … }
static int dma2d_queue_setup(struct vb2_queue *vq,
unsigned int *nbuffers, unsigned int *nplanes,
unsigned int sizes[], struct device *alloc_devs[])
{ … }
static int dma2d_buf_out_validate(struct vb2_buffer *vb)
{ … }
static int dma2d_buf_prepare(struct vb2_buffer *vb)
{ … }
static void dma2d_buf_queue(struct vb2_buffer *vb)
{ … }
static int dma2d_start_streaming(struct vb2_queue *q, unsigned int count)
{ … }
static void dma2d_stop_streaming(struct vb2_queue *q)
{ … }
static const struct vb2_ops dma2d_qops = …;
static int queue_init(void *priv, struct vb2_queue *src_vq,
struct vb2_queue *dst_vq)
{ … }
static int dma2d_s_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static const struct v4l2_ctrl_ops dma2d_ctrl_ops = …;
static int dma2d_setup_ctrls(struct dma2d_ctx *ctx)
{ … }
static int dma2d_open(struct file *file)
{ … }
static int dma2d_release(struct file *file)
{ … }
static int vidioc_querycap(struct file *file, void *priv,
struct v4l2_capability *cap)
{ … }
static int vidioc_enum_fmt(struct file *file, void *prv, struct v4l2_fmtdesc *f)
{ … }
static int vidioc_g_fmt(struct file *file, void *prv, struct v4l2_format *f)
{ … }
static int vidioc_try_fmt(struct file *file, void *prv, struct v4l2_format *f)
{ … }
static int vidioc_s_fmt(struct file *file, void *prv, struct v4l2_format *f)
{ … }
static void device_run(void *prv)
{ … }
static irqreturn_t dma2d_isr(int irq, void *prv)
{ … }
static const struct v4l2_file_operations dma2d_fops = …;
static const struct v4l2_ioctl_ops dma2d_ioctl_ops = …;
static const struct video_device dma2d_videodev = …;
static const struct v4l2_m2m_ops dma2d_m2m_ops = …;
static const struct of_device_id stm32_dma2d_match[];
static int dma2d_probe(struct platform_device *pdev)
{ … }
static void dma2d_remove(struct platform_device *pdev)
{ … }
static const struct of_device_id stm32_dma2d_match[] = …;
MODULE_DEVICE_TABLE(of, stm32_dma2d_match);
static struct platform_driver dma2d_pdrv = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;