#include <linux/clk.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/lockdep.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
#include <media/videobuf2-dma-contig.h>
#include <media/videobuf2-vmalloc.h>
#include <uapi/linux/media/raspberrypi/pisp_be_config.h>
#include "pisp_be_formats.h"
#define PISP_BE_NUM_CONFIG_BUFFERS …
#define PISPBE_NAME …
#define PISP_BE_VERSION_REG …
#define PISP_BE_CONTROL_REG …
#define PISP_BE_CONTROL_COPY_CONFIG …
#define PISP_BE_CONTROL_QUEUE_JOB …
#define PISP_BE_CONTROL_NUM_TILES(n) …
#define PISP_BE_TILE_ADDR_LO_REG …
#define PISP_BE_TILE_ADDR_HI_REG …
#define PISP_BE_STATUS_REG …
#define PISP_BE_STATUS_QUEUED …
#define PISP_BE_BATCH_STATUS_REG …
#define PISP_BE_INTERRUPT_EN_REG …
#define PISP_BE_INTERRUPT_STATUS_REG …
#define PISP_BE_AXI_REG …
#define PISP_BE_CONFIG_BASE_REG …
#define PISP_BE_IO_ADDR_LOW(n) …
#define PISP_BE_IO_ADDR_HIGH(n) …
#define PISP_BE_GLOBAL_BAYER_ENABLE …
#define PISP_BE_GLOBAL_RGB_ENABLE …
#define N_HW_ADDRESSES …
#define N_HW_ENABLES …
#define PISP_BE_VERSION_2712 …
#define PISP_BE_VERSION_MINOR_BITS …
enum pispbe_node_ids { … };
struct pispbe_node_description { … };
static const struct pispbe_node_description node_desc[PISPBE_NUM_NODES] = …;
#define NODE_DESC_IS_OUTPUT(desc) …
#define NODE_IS_META(node) …
#define NODE_IS_OUTPUT(node) …
#define NODE_IS_CAPTURE(node) …
#define NODE_IS_MPLANE(node) …
struct pispbe_node { … };
#define NODE_NAME(node) …
struct pispbe_job { … };
struct pispbe_hw_enables { … };
struct pispbe_job_descriptor { … };
struct pispbe_dev { … };
static u32 pispbe_rd(struct pispbe_dev *pispbe, unsigned int offset)
{ … }
static void pispbe_wr(struct pispbe_dev *pispbe, unsigned int offset, u32 val)
{ … }
static void pispbe_queue_job(struct pispbe_dev *pispbe,
struct pispbe_job_descriptor *job)
{ … }
struct pispbe_buffer { … };
static int pispbe_get_planes_addr(dma_addr_t addr[3], struct pispbe_buffer *buf,
struct pispbe_node *node)
{ … }
static dma_addr_t pispbe_get_addr(struct pispbe_buffer *buf)
{ … }
static void pispbe_xlate_addrs(struct pispbe_dev *pispbe,
struct pispbe_job_descriptor *job,
struct pispbe_buffer *buf[PISPBE_NUM_NODES])
{ … }
static int pispbe_prepare_job(struct pispbe_dev *pispbe,
struct pispbe_job_descriptor *job)
{ … }
static void pispbe_schedule(struct pispbe_dev *pispbe, bool clear_hw_busy)
{ … }
static void pispbe_isr_jobdone(struct pispbe_dev *pispbe,
struct pispbe_job *job)
{ … }
static irqreturn_t pispbe_isr(int irq, void *dev)
{ … }
static int pisp_be_validate_config(struct pispbe_dev *pispbe,
struct pisp_be_tiles_config *config)
{ … }
static int pispbe_node_queue_setup(struct vb2_queue *q, unsigned int *nbuffers,
unsigned int *nplanes, unsigned int sizes[],
struct device *alloc_devs[])
{ … }
static int pispbe_node_buffer_prepare(struct vb2_buffer *vb)
{ … }
static void pispbe_node_buffer_queue(struct vb2_buffer *buf)
{ … }
static int pispbe_node_start_streaming(struct vb2_queue *q, unsigned int count)
{ … }
static void pispbe_node_stop_streaming(struct vb2_queue *q)
{ … }
static const struct vb2_ops pispbe_node_queue_ops = …;
static const struct v4l2_file_operations pispbe_fops = …;
static int pispbe_node_querycap(struct file *file, void *priv,
struct v4l2_capability *cap)
{ … }
static int pispbe_node_g_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int pispbe_node_g_fmt_vid_out(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int pispbe_node_g_fmt_meta_out(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static const struct pisp_be_format *pispbe_find_fmt(unsigned int fourcc)
{ … }
static void pispbe_set_plane_params(struct v4l2_format *f,
const struct pisp_be_format *fmt)
{ … }
static void pispbe_try_format(struct v4l2_format *f, struct pispbe_node *node)
{ … }
static int pispbe_node_try_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int pispbe_node_try_fmt_vid_out(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int pispbe_node_try_fmt_meta_out(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int pispbe_node_s_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int pispbe_node_s_fmt_vid_out(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int pispbe_node_s_fmt_meta_out(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int pispbe_node_enum_fmt(struct file *file, void *priv,
struct v4l2_fmtdesc *f)
{ … }
static int pispbe_enum_framesizes(struct file *file, void *priv,
struct v4l2_frmsizeenum *fsize)
{ … }
static const struct v4l2_ioctl_ops pispbe_node_ioctl_ops = …;
static const struct video_device pispbe_videodev = …;
static void pispbe_node_def_fmt(struct pispbe_node *node)
{ … }
static int pispbe_init_node(struct pispbe_dev *pispbe, unsigned int id)
{ … }
static const struct v4l2_subdev_pad_ops pispbe_pad_ops = …;
static const struct v4l2_subdev_ops pispbe_sd_ops = …;
static int pispbe_init_subdev(struct pispbe_dev *pispbe)
{ … }
static int pispbe_init_devices(struct pispbe_dev *pispbe)
{ … }
static void pispbe_destroy_devices(struct pispbe_dev *pispbe)
{ … }
static int pispbe_runtime_suspend(struct device *dev)
{ … }
static int pispbe_runtime_resume(struct device *dev)
{ … }
static int pispbe_hw_init(struct pispbe_dev *pispbe)
{ … }
static int pispbe_probe(struct platform_device *pdev)
{ … }
static void pispbe_remove(struct platform_device *pdev)
{ … }
static const struct dev_pm_ops pispbe_pm_ops = …;
static const struct of_device_id pispbe_of_match[] = …;
MODULE_DEVICE_TABLE(of, pispbe_of_match);
static struct platform_driver pispbe_pdrv = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;