#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/bug.h>
#include <linux/interrupt.h>
#include <linux/device.h>
#include <linux/pm_runtime.h>
#include <linux/list.h>
#include <linux/slab.h>
#include <linux/videodev2.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-mem2mem.h>
#include <media/v4l2-rect.h>
#include <media/videobuf2-v4l2.h>
#include <media/videobuf2-dma-contig.h>
#include "common.h"
#include "fimc-core.h"
#include "fimc-reg.h"
#include "media-dev.h"
static int fimc_capture_hw_init(struct fimc_dev *fimc)
{ … }
static int fimc_capture_state_cleanup(struct fimc_dev *fimc, bool suspend)
{ … }
static int fimc_stop_capture(struct fimc_dev *fimc, bool suspend)
{ … }
static int fimc_capture_config_update(struct fimc_ctx *ctx)
{ … }
void fimc_capture_irq_handler(struct fimc_dev *fimc, int deq_buf)
{ … }
static int start_streaming(struct vb2_queue *q, unsigned int count)
{ … }
static void stop_streaming(struct vb2_queue *q)
{ … }
int fimc_capture_suspend(struct fimc_dev *fimc)
{ … }
static void buffer_queue(struct vb2_buffer *vb);
int fimc_capture_resume(struct fimc_dev *fimc)
{ … }
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 fimc_capture_qops = …;
static int fimc_capture_set_default_format(struct fimc_dev *fimc);
static int fimc_capture_open(struct file *file)
{ … }
static int fimc_capture_release(struct file *file)
{ … }
static const struct v4l2_file_operations fimc_capture_fops = …;
static const struct fimc_fmt *fimc_capture_try_format(struct fimc_ctx *ctx,
u32 *width, u32 *height,
u32 *code, u32 *fourcc, int pad)
{ … }
static void fimc_capture_try_selection(struct fimc_ctx *ctx,
struct v4l2_rect *r,
int target)
{ … }
static int fimc_cap_querycap(struct file *file, void *priv,
struct v4l2_capability *cap)
{ … }
static int fimc_cap_enum_fmt(struct file *file, void *priv,
struct v4l2_fmtdesc *f)
{ … }
static struct media_entity *fimc_pipeline_get_head(struct media_entity *me)
{ … }
static int fimc_pipeline_try_format(struct fimc_ctx *ctx,
struct v4l2_mbus_framefmt *tfmt,
const struct fimc_fmt **fmt_id,
bool set)
{ … }
static int fimc_get_sensor_frame_desc(struct v4l2_subdev *sensor,
struct v4l2_plane_pix_format *plane_fmt,
unsigned int num_planes, bool try)
{ … }
static int fimc_cap_g_fmt_mplane(struct file *file, void *fh,
struct v4l2_format *f)
{ … }
static int __video_try_or_set_format(struct fimc_dev *fimc,
struct v4l2_format *f, bool try,
const struct fimc_fmt **inp_fmt,
const struct fimc_fmt **out_fmt)
{ … }
static int fimc_cap_try_fmt_mplane(struct file *file, void *fh,
struct v4l2_format *f)
{ … }
static void fimc_capture_mark_jpeg_xfer(struct fimc_ctx *ctx,
enum fimc_color_fmt color)
{ … }
static int __fimc_capture_set_format(struct fimc_dev *fimc,
struct v4l2_format *f)
{ … }
static int fimc_cap_s_fmt_mplane(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int fimc_cap_enum_input(struct file *file, void *priv,
struct v4l2_input *i)
{ … }
static int fimc_cap_s_input(struct file *file, void *priv, unsigned int i)
{ … }
static int fimc_cap_g_input(struct file *file, void *priv, unsigned int *i)
{ … }
static int fimc_pipeline_validate(struct fimc_dev *fimc)
{ … }
static int fimc_cap_streamon(struct file *file, void *priv,
enum v4l2_buf_type type)
{ … }
static int fimc_cap_streamoff(struct file *file, void *priv,
enum v4l2_buf_type type)
{ … }
static int fimc_cap_reqbufs(struct file *file, void *priv,
struct v4l2_requestbuffers *reqbufs)
{ … }
static int fimc_cap_g_selection(struct file *file, void *fh,
struct v4l2_selection *s)
{ … }
static int fimc_cap_s_selection(struct file *file, void *fh,
struct v4l2_selection *s)
{ … }
static const struct v4l2_ioctl_ops fimc_capture_ioctl_ops = …;
static int fimc_link_setup(struct media_entity *entity,
const struct media_pad *local,
const struct media_pad *remote, u32 flags)
{ … }
static const struct media_entity_operations fimc_sd_media_ops = …;
void fimc_sensor_notify(struct v4l2_subdev *sd, unsigned int notification,
void *arg)
{ … }
static int fimc_subdev_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code)
{ … }
static int fimc_subdev_get_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt)
{ … }
static int fimc_subdev_set_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt)
{ … }
static int fimc_subdev_get_selection(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_selection *sel)
{ … }
static int fimc_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 fimc_subdev_pad_ops = …;
static const struct v4l2_subdev_ops fimc_subdev_ops = …;
static int fimc_capture_set_default_format(struct fimc_dev *fimc)
{ … }
static int fimc_register_capture_device(struct fimc_dev *fimc,
struct v4l2_device *v4l2_dev)
{ … }
static int fimc_capture_subdev_registered(struct v4l2_subdev *sd)
{ … }
static void fimc_capture_subdev_unregistered(struct v4l2_subdev *sd)
{ … }
static const struct v4l2_subdev_internal_ops fimc_capture_sd_internal_ops = …;
int fimc_initialize_capture_subdev(struct fimc_dev *fimc)
{ … }
void fimc_unregister_capture_subdev(struct fimc_dev *fimc)
{ … }