linux/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-bytecap.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Driver for STM32 Digital Camera Memory Interface Pixel Processor
 *
 * Copyright (C) STMicroelectronics SA 2023
 * Authors: Hugues Fruchet <[email protected]>
 *          Alain Volmat <[email protected]>
 *          for STMicroelectronics.
 */

#include <linux/iopoll.h>
#include <linux/pm_runtime.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-mc.h>
#include <media/videobuf2-core.h>
#include <media/videobuf2-dma-contig.h>

#include "dcmipp-common.h"

#define DCMIPP_PRSR
#define DCMIPP_CMIER
#define DCMIPP_CMIER_P0FRAMEIE
#define DCMIPP_CMIER_P0VSYNCIE
#define DCMIPP_CMIER_P0OVRIE
#define DCMIPP_CMIER_P0ALL
#define DCMIPP_CMSR1
#define DCMIPP_CMSR2
#define DCMIPP_CMSR2_P0FRAMEF
#define DCMIPP_CMSR2_P0VSYNCF
#define DCMIPP_CMSR2_P0OVRF
#define DCMIPP_CMFCR
#define DCMIPP_P0FSCR
#define DCMIPP_P0FSCR_PIPEN
#define DCMIPP_P0FCTCR
#define DCMIPP_P0FCTCR_CPTREQ
#define DCMIPP_P0DCCNTR
#define DCMIPP_P0DCLMTR
#define DCMIPP_P0DCLMTR_ENABLE
#define DCMIPP_P0DCLMTR_LIMIT_MASK
#define DCMIPP_P0PPM0AR1
#define DCMIPP_P0SR
#define DCMIPP_P0SR_CPTACT

struct dcmipp_bytecap_pix_map {};

#define PIXMAP_MBUS_PFMT(mbus, fmt)

static const struct dcmipp_bytecap_pix_map dcmipp_bytecap_pix_map_list[] =;

static const struct dcmipp_bytecap_pix_map *
dcmipp_bytecap_pix_map_by_pixelformat(u32 pixelformat)
{}

struct dcmipp_buf {};

enum dcmipp_state {};

struct dcmipp_bytecap_device {};

static const struct v4l2_pix_format fmt_default =;

static int dcmipp_bytecap_querycap(struct file *file, void *priv,
				   struct v4l2_capability *cap)
{}

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

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

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

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

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

static const struct v4l2_file_operations dcmipp_bytecap_fops =;

static const struct v4l2_ioctl_ops dcmipp_bytecap_ioctl_ops =;

static int dcmipp_pipeline_s_stream(struct dcmipp_bytecap_device *vcap,
				    int state)
{}

static void dcmipp_start_capture(struct dcmipp_bytecap_device *vcap,
				 struct dcmipp_buf *buf)
{}

static void dcmipp_bytecap_all_buffers_done(struct dcmipp_bytecap_device *vcap,
					    enum vb2_buffer_state state)
{}

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

static void dcmipp_dump_status(struct dcmipp_bytecap_device *vcap)
{}

/*
 * Stop the stream engine. Any remaining buffers in the stream queue are
 * dequeued and passed on to the vb2 framework marked as STATE_ERROR.
 */
static void dcmipp_bytecap_stop_streaming(struct vb2_queue *vq)
{}

static int dcmipp_bytecap_buf_prepare(struct vb2_buffer *vb)
{}

static void dcmipp_bytecap_buf_queue(struct vb2_buffer *vb2_buf)
{}

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

static int dcmipp_bytecap_buf_init(struct vb2_buffer *vb)
{}

static const struct vb2_ops dcmipp_bytecap_qops =;

static void dcmipp_bytecap_release(struct video_device *vdev)
{}

void dcmipp_bytecap_ent_release(struct dcmipp_ent_device *ved)
{}

static void dcmipp_buffer_done(struct dcmipp_bytecap_device *vcap,
			       struct dcmipp_buf *buf,
			       size_t bytesused,
			       int err)
{}

/* irqlock must be held */
static void
dcmipp_bytecap_set_next_frame_or_stop(struct dcmipp_bytecap_device *vcap)
{}

/* irqlock must be held */
static void dcmipp_bytecap_process_frame(struct dcmipp_bytecap_device *vcap,
					 size_t bytesused)
{}

static irqreturn_t dcmipp_bytecap_irq_thread(int irq, void *arg)
{}

static irqreturn_t dcmipp_bytecap_irq_callback(int irq, void *arg)
{}

static int dcmipp_bytecap_link_validate(struct media_link *link)
{}

static const struct media_entity_operations dcmipp_bytecap_entity_ops =;

struct dcmipp_ent_device *dcmipp_bytecap_ent_init(struct device *dev,
						  const char *entity_name,
						  struct v4l2_device *v4l2_dev,
						  void __iomem *regs)
{}