linux/drivers/media/platform/nxp/imx-pxp.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * i.MX Pixel Pipeline (PXP) mem-to-mem scaler/CSC/rotator driver
 *
 * Copyright (c) 2018 Pengutronix, Philipp Zabel
 *
 * based on vim2m
 *
 * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
 * Pawel Osciak, <[email protected]>
 * Marek Szyprowski, <[email protected]>
 */
#include <linux/bitfield.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/dma-mapping.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/sched.h>
#include <linux/slab.h>

#include <media/media-device.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/v4l2-event.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-mem2mem.h>
#include <media/videobuf2-dma-contig.h>

#include "imx-pxp.h"

static unsigned int debug;
module_param(debug, uint, 0644);
MODULE_PARM_DESC();

#define MIN_W
#define MIN_H
#define MAX_W
#define MAX_H
#define ALIGN_W
#define ALIGN_H

/* Flags that indicate a format can be used for capture/output */
#define MEM2MEM_CAPTURE
#define MEM2MEM_OUTPUT

#define MEM2MEM_NAME

/* Flags that indicate processing mode */
#define MEM2MEM_HFLIP
#define MEM2MEM_VFLIP

#define PXP_VERSION_MAJOR(version)
#define PXP_VERSION_MINOR(version)

#define dprintk(dev, fmt, arg...)

struct pxp_fmt {};

static struct pxp_fmt formats[] =;

#define NUM_FORMATS

/* Per-queue, driver-specific private data */
struct pxp_q_data {};

enum {};

static const struct regmap_config pxp_regmap_config =;

static struct pxp_fmt *find_format(unsigned int pixelformat)
{}

struct pxp_ctx;

struct pxp_pdata {};

struct pxp_dev {};

struct pxp_ctx {};

static inline struct pxp_ctx *file2ctx(struct file *file)
{}

static struct pxp_q_data *get_q_data(struct pxp_ctx *ctx,
					 enum v4l2_buf_type type)
{}

static inline u32 pxp_read(struct pxp_dev *dev, u32 reg)
{}

static inline void pxp_write(struct pxp_dev *dev, u32 reg, u32 value)
{}

static u32 pxp_v4l2_pix_fmt_to_ps_format(u32 v4l2_pix_fmt)
{}

static u32 pxp_v4l2_pix_fmt_to_out_format(u32 v4l2_pix_fmt)
{}

static bool pxp_v4l2_pix_fmt_is_yuv(u32 v4l2_pix_fmt)
{}

static void pxp_setup_csc(struct pxp_ctx *ctx)
{}

static u32 pxp_imx6ull_data_path_ctrl0(struct pxp_ctx *ctx)
{}

static u32 pxp_imx7d_data_path_ctrl0(struct pxp_ctx *ctx)
{}

static void pxp_set_data_path(struct pxp_ctx *ctx)
{}

static int pxp_start(struct pxp_ctx *ctx, struct vb2_v4l2_buffer *in_vb,
		     struct vb2_v4l2_buffer *out_vb)
{}

static void pxp_job_finish(struct pxp_dev *dev)
{}

/*
 * mem2mem callbacks
 */
static void pxp_device_run(void *priv)
{}

static int pxp_job_ready(void *priv)
{}

static void pxp_job_abort(void *priv)
{}

/*
 * interrupt handler
 */
static irqreturn_t pxp_irq_handler(int irq, void *dev_id)
{}

/*
 * video ioctls
 */
static int pxp_querycap(struct file *file, void *priv,
			   struct v4l2_capability *cap)
{}

static int pxp_enum_fmt(struct v4l2_fmtdesc *f, u32 type)
{}

static int pxp_enum_fmt_vid_cap(struct file *file, void *priv,
				struct v4l2_fmtdesc *f)
{}

static int pxp_enum_fmt_vid_out(struct file *file, void *priv,
				struct v4l2_fmtdesc *f)
{}

static int pxp_g_fmt(struct pxp_ctx *ctx, struct v4l2_format *f)
{}

static int pxp_g_fmt_vid_out(struct file *file, void *priv,
				struct v4l2_format *f)
{}

static int pxp_g_fmt_vid_cap(struct file *file, void *priv,
				struct v4l2_format *f)
{}

static inline u32 pxp_bytesperline(struct pxp_fmt *fmt, u32 width)
{}

static inline u32 pxp_sizeimage(struct pxp_fmt *fmt, u32 width, u32 height)
{}

static int pxp_try_fmt(struct v4l2_format *f, struct pxp_fmt *fmt)
{}

static void
pxp_fixup_colorimetry_cap(struct pxp_ctx *ctx, u32 dst_fourcc,
			  enum v4l2_ycbcr_encoding *ycbcr_enc,
			  enum v4l2_quantization *quantization)
{}

static int pxp_try_fmt_vid_cap(struct file *file, void *priv,
			       struct v4l2_format *f)
{}

static int pxp_try_fmt_vid_out(struct file *file, void *priv,
			       struct v4l2_format *f)
{}

static int pxp_s_fmt(struct pxp_ctx *ctx, struct v4l2_format *f)
{}

static int pxp_s_fmt_vid_cap(struct file *file, void *priv,
			     struct v4l2_format *f)
{}

static int pxp_s_fmt_vid_out(struct file *file, void *priv,
			     struct v4l2_format *f)
{}

static int pxp_enum_framesizes(struct file *file, void *fh,
			       struct v4l2_frmsizeenum *fsize)
{}

static u8 pxp_degrees_to_rot_mode(u32 degrees)
{}

static int pxp_s_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops pxp_ctrl_ops =;

static const struct v4l2_ioctl_ops pxp_ioctl_ops =;

/*
 * Queue operations
 */
static int pxp_queue_setup(struct vb2_queue *vq,
			   unsigned int *nbuffers, unsigned int *nplanes,
			   unsigned int sizes[], struct device *alloc_devs[])
{}

static int pxp_buf_prepare(struct vb2_buffer *vb)
{}

static void pxp_buf_queue(struct vb2_buffer *vb)
{}

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

static void pxp_stop_streaming(struct vb2_queue *q)
{}

static const struct vb2_ops pxp_qops =;

static int queue_init(void *priv, struct vb2_queue *src_vq,
		      struct vb2_queue *dst_vq)
{}

/*
 * File operations
 */
static int pxp_open(struct file *file)
{}

static int pxp_release(struct file *file)
{}

static const struct v4l2_file_operations pxp_fops =;

static const struct video_device pxp_videodev =;

static const struct v4l2_m2m_ops m2m_ops =;

static int pxp_soft_reset(struct pxp_dev *dev)
{}

static int pxp_probe(struct platform_device *pdev)
{}

static void pxp_remove(struct platform_device *pdev)
{}

static const struct pxp_pdata pxp_imx6ull_pdata =;

static const struct pxp_pdata pxp_imx7d_pdata =;

static const struct of_device_id pxp_dt_ids[] =;
MODULE_DEVICE_TABLE(of, pxp_dt_ids);

static struct platform_driver pxp_driver =;

module_platform_driver();

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();