#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <media/v4l2-event.h>
#include <media/v4l2-ioctl.h>
#include "ipu3.h"
#include "ipu3-dmamap.h"
#define IPU3_RUNNING_MODE_VIDEO …
#define IPU3_RUNNING_MODE_STILL …
static int imgu_subdev_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
{ … }
static int imgu_subdev_s_stream(struct v4l2_subdev *sd, int enable)
{ … }
static int imgu_subdev_get_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt)
{ … }
static int imgu_subdev_set_fmt(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_format *fmt)
{ … }
static struct v4l2_rect *
imgu_subdev_get_crop(struct imgu_v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state, unsigned int pad,
enum v4l2_subdev_format_whence which)
{ … }
static struct v4l2_rect *
imgu_subdev_get_compose(struct imgu_v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state, unsigned int pad,
enum v4l2_subdev_format_whence which)
{ … }
static int imgu_subdev_get_selection(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_selection *sel)
{ … }
static int imgu_subdev_set_selection(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_selection *sel)
{ … }
static int imgu_link_setup(struct media_entity *entity,
const struct media_pad *local,
const struct media_pad *remote, u32 flags)
{ … }
static int imgu_vb2_buf_init(struct vb2_buffer *vb)
{ … }
static void imgu_vb2_buf_cleanup(struct vb2_buffer *vb)
{ … }
static void imgu_vb2_buf_queue(struct vb2_buffer *vb)
{ … }
static int imgu_vb2_queue_setup(struct vb2_queue *vq,
unsigned int *num_buffers,
unsigned int *num_planes,
unsigned int sizes[],
struct device *alloc_devs[])
{ … }
static bool imgu_all_nodes_streaming(struct imgu_device *imgu,
struct imgu_video_device *except)
{ … }
static void imgu_return_all_buffers(struct imgu_device *imgu,
struct imgu_video_device *node,
enum vb2_buffer_state state)
{ … }
static int imgu_vb2_start_streaming(struct vb2_queue *vq, unsigned int count)
{ … }
static void imgu_vb2_stop_streaming(struct vb2_queue *vq)
{ … }
#define VID_CAPTURE …
#define VID_OUTPUT …
#define DEF_VID_CAPTURE …
#define DEF_VID_OUTPUT …
struct imgu_fmt { … };
static const struct imgu_fmt formats[] = …;
static const struct imgu_fmt *find_format(struct v4l2_format *f, u32 type)
{ … }
static int imgu_vidioc_querycap(struct file *file, void *fh,
struct v4l2_capability *cap)
{ … }
static int enum_fmts(struct v4l2_fmtdesc *f, u32 type)
{ … }
static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_fmtdesc *f)
{ … }
static int vidioc_enum_fmt_vid_out(struct file *file, void *priv,
struct v4l2_fmtdesc *f)
{ … }
static int imgu_vidioc_g_fmt(struct file *file, void *fh,
struct v4l2_format *f)
{ … }
static int imgu_fmt(struct imgu_device *imgu, unsigned int pipe, int node,
struct v4l2_format *f, bool try)
{ … }
static int imgu_try_fmt(struct file *file, void *fh, struct v4l2_format *f)
{ … }
static int imgu_vidioc_try_fmt(struct file *file, void *fh,
struct v4l2_format *f)
{ … }
static int imgu_vidioc_s_fmt(struct file *file, void *fh, struct v4l2_format *f)
{ … }
struct imgu_meta_fmt { … };
static const struct imgu_meta_fmt meta_fmts[] = …;
static int imgu_meta_enum_format(struct file *file, void *fh,
struct v4l2_fmtdesc *fmt)
{ … }
static int imgu_vidioc_g_meta_fmt(struct file *file, void *fh,
struct v4l2_format *f)
{ … }
static const struct v4l2_subdev_internal_ops imgu_subdev_internal_ops = …;
static const struct v4l2_subdev_core_ops imgu_subdev_core_ops = …;
static const struct v4l2_subdev_video_ops imgu_subdev_video_ops = …;
static const struct v4l2_subdev_pad_ops imgu_subdev_pad_ops = …;
static const struct v4l2_subdev_ops imgu_subdev_ops = …;
static const struct media_entity_operations imgu_media_ops = …;
static const struct vb2_ops imgu_vb2_ops = …;
static const struct v4l2_file_operations imgu_v4l2_fops = …;
static const struct v4l2_ioctl_ops imgu_v4l2_ioctl_ops = …;
static const struct v4l2_ioctl_ops imgu_v4l2_meta_ioctl_ops = …;
static int imgu_sd_s_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static const struct v4l2_ctrl_ops imgu_subdev_ctrl_ops = …;
static const char * const imgu_ctrl_mode_strings[] = …;
static const struct v4l2_ctrl_config imgu_subdev_ctrl_mode = …;
static void imgu_node_to_v4l2(u32 node, struct video_device *vdev,
struct v4l2_format *f)
{ … }
static int imgu_v4l2_subdev_register(struct imgu_device *imgu,
struct imgu_v4l2_subdev *imgu_sd,
unsigned int pipe)
{ … }
static int imgu_v4l2_node_setup(struct imgu_device *imgu, unsigned int pipe,
int node_num)
{ … }
static void imgu_v4l2_nodes_cleanup_pipe(struct imgu_device *imgu,
unsigned int pipe, int node)
{ … }
static int imgu_v4l2_nodes_setup_pipe(struct imgu_device *imgu, int pipe)
{ … }
static void imgu_v4l2_subdev_cleanup(struct imgu_device *imgu, unsigned int i)
{ … }
static void imgu_v4l2_cleanup_pipes(struct imgu_device *imgu, unsigned int pipe)
{ … }
static int imgu_v4l2_register_pipes(struct imgu_device *imgu)
{ … }
int imgu_v4l2_register(struct imgu_device *imgu)
{ … }
int imgu_v4l2_unregister(struct imgu_device *imgu)
{ … }
void imgu_v4l2_buffer_done(struct vb2_buffer *vb,
enum vb2_buffer_state state)
{ … }