#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);
static void camif_cfg_video_path(struct camif_vp *vp)
{ … }
static void camif_prepare_dma_offset(struct camif_vp *vp)
{ … }
static int s3c_camif_hw_init(struct camif_dev *camif, struct camif_vp *vp)
{ … }
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)
{ … }
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 = …;
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)
{ … }
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 = …;
static int s3c_camif_video_s_ctrl(struct v4l2_ctrl *ctrl)
{ … }
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)
{ … }
static const u32 camif_mbus_formats[] = …;
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)
{ … }