linux/drivers/media/platform/samsung/s3c-camif/camif-capture.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * s3c24xx/s3c64xx SoC series Camera Interface (CAMIF) driver
 *
 * Copyright (C) 2012 Sylwester Nawrocki <[email protected]>
 * Copyright (C) 2012 Tomasz Figa <[email protected]>
 *
 * Based on drivers/media/platform/s5p-fimc,
 * Copyright (C) 2010 - 2012 Samsung Electronics Co., Ltd.
*/
#define pr_fmt(fmt)

#include <linux/bug.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/errno.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/ratelimit.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/videodev2.h>

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

#include "camif-core.h"
#include "camif-regs.h"

static int debug;
module_param(debug, int, 0644);

/* Locking: called with vp->camif->slock spinlock held */
static void camif_cfg_video_path(struct camif_vp *vp)
{}

static void camif_prepare_dma_offset(struct camif_vp *vp)
{}

/* Locking: called with camif->slock spinlock held */
static int s3c_camif_hw_init(struct camif_dev *camif, struct camif_vp *vp)
{}

/*
 * Initialize the video path, only up from the scaler stage. The camera
 * input interface set up is skipped. This is useful to enable one of the
 * video paths when the other is already running.
 * Locking: called with camif->slock spinlock held.
 */
static int s3c_camif_hw_vp_init(struct camif_dev *camif, struct camif_vp *vp)
{}

static int sensor_set_power(struct camif_dev *camif, int on)
{}

static int sensor_set_streaming(struct camif_dev *camif, int on)
{}

/*
 * Reinitialize the driver so it is ready to start streaming again.
 * Return any buffers to vb2, perform CAMIF software reset and
 * turn off streaming at the data pipeline (sensor) if required.
 */
static int camif_reinitialize(struct camif_vp *vp)
{}

static bool s3c_vp_active(struct camif_vp *vp)
{}

static bool camif_is_streaming(struct camif_dev *camif)
{}

static int camif_stop_capture(struct camif_vp *vp)
{}

static int camif_prepare_addr(struct camif_vp *vp, struct vb2_buffer *vb,
			      struct camif_addr *paddr)
{}

irqreturn_t s3c_camif_irq_handler(int irq, void *priv)
{}

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

static void stop_streaming(struct vb2_queue *vq)
{}

static int queue_setup(struct vb2_queue *vq,
		       unsigned int *num_buffers, unsigned int *num_planes,
		       unsigned int sizes[], struct device *alloc_devs[])
{}

static int buffer_prepare(struct vb2_buffer *vb)
{}

static void buffer_queue(struct vb2_buffer *vb)
{}

static const struct vb2_ops s3c_camif_qops =;

static int s3c_camif_open(struct file *file)
{}

static int s3c_camif_close(struct file *file)
{}

static __poll_t s3c_camif_poll(struct file *file,
				   struct poll_table_struct *wait)
{}

static int s3c_camif_mmap(struct file *file, struct vm_area_struct *vma)
{}

static const struct v4l2_file_operations s3c_camif_fops =;

/*
 * Video node IOCTLs
 */

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

static int s3c_camif_vidioc_enum_input(struct file *file, void *priv,
				       struct v4l2_input *input)
{}

static int s3c_camif_vidioc_s_input(struct file *file, void *priv,
				    unsigned int i)
{}

static int s3c_camif_vidioc_g_input(struct file *file, void *priv,
				    unsigned int *i)
{}

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

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

static int __camif_video_try_format(struct camif_vp *vp,
				    struct v4l2_pix_format *pix,
				    const struct camif_fmt **ffmt)
{}

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

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

/* Only check pixel formats at the sensor and the camif subdev pads */
static int camif_pipeline_validate(struct camif_dev *camif)
{}

static int s3c_camif_streamon(struct file *file, void *priv,
			      enum v4l2_buf_type type)
{}

static int s3c_camif_streamoff(struct file *file, void *priv,
			       enum v4l2_buf_type type)
{}

static int s3c_camif_reqbufs(struct file *file, void *priv,
			     struct v4l2_requestbuffers *rb)
{}

static int s3c_camif_querybuf(struct file *file, void *priv,
			      struct v4l2_buffer *buf)
{}

static int s3c_camif_qbuf(struct file *file, void *priv,
			  struct v4l2_buffer *buf)
{}

static int s3c_camif_dqbuf(struct file *file, void *priv,
			   struct v4l2_buffer *buf)
{}

static int s3c_camif_create_bufs(struct file *file, void *priv,
				 struct v4l2_create_buffers *create)
{}

static int s3c_camif_prepare_buf(struct file *file, void *priv,
				 struct v4l2_buffer *b)
{}

static int s3c_camif_g_selection(struct file *file, void *priv,
				 struct v4l2_selection *sel)
{}

static void __camif_try_compose(struct camif_dev *camif, struct camif_vp *vp,
				struct v4l2_rect *r)
{}

static int s3c_camif_s_selection(struct file *file, void *priv,
				 struct v4l2_selection *sel)
{}

static const struct v4l2_ioctl_ops s3c_camif_ioctl_ops =;

/*
 * Video node controls
 */
static int s3c_camif_video_s_ctrl(struct v4l2_ctrl *ctrl)
{}

/* Codec and preview video node control ops */
static const struct v4l2_ctrl_ops s3c_camif_video_ctrl_ops =;

int s3c_camif_register_video_node(struct camif_dev *camif, int idx)
{}

void s3c_camif_unregister_video_node(struct camif_dev *camif, int idx)
{}

/* Media bus pixel formats supported at the camif input */
static const u32 camif_mbus_formats[] =;

/*
 *  Camera input interface subdev operations
 */

static int s3c_camif_subdev_enum_mbus_code(struct v4l2_subdev *sd,
					struct v4l2_subdev_state *sd_state,
					struct v4l2_subdev_mbus_code_enum *code)
{}

static int s3c_camif_subdev_get_fmt(struct v4l2_subdev *sd,
				    struct v4l2_subdev_state *sd_state,
				    struct v4l2_subdev_format *fmt)
{}

static void __camif_subdev_try_format(struct camif_dev *camif,
				struct v4l2_mbus_framefmt *mf, int pad)
{}

static int s3c_camif_subdev_set_fmt(struct v4l2_subdev *sd,
				    struct v4l2_subdev_state *sd_state,
				    struct v4l2_subdev_format *fmt)
{}

static int s3c_camif_subdev_get_selection(struct v4l2_subdev *sd,
					  struct v4l2_subdev_state *sd_state,
					  struct v4l2_subdev_selection *sel)
{}

static void __camif_try_crop(struct camif_dev *camif, struct v4l2_rect *r)
{}

static int s3c_camif_subdev_set_selection(struct v4l2_subdev *sd,
					  struct v4l2_subdev_state *sd_state,
					  struct v4l2_subdev_selection *sel)
{}

static const struct v4l2_subdev_pad_ops s3c_camif_subdev_pad_ops =;

static const struct v4l2_subdev_ops s3c_camif_subdev_ops =;

static int s3c_camif_subdev_s_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops s3c_camif_subdev_ctrl_ops =;

static const char * const s3c_camif_test_pattern_menu[] =;

int s3c_camif_create_subdev(struct camif_dev *camif)
{}

void s3c_camif_unregister_subdev(struct camif_dev *camif)
{}

int s3c_camif_set_defaults(struct camif_dev *camif)
{}