linux/drivers/staging/media/starfive/camss/stf-video.c

// SPDX-License-Identifier: GPL-2.0
/*
 * stf_video.c
 *
 * StarFive Camera Subsystem - V4L2 device node
 *
 * Copyright (C) 2021-2023 StarFive Technology Co., Ltd.
 */

#include <linux/pm_runtime.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-event.h>
#include <media/v4l2-mc.h>
#include <media/videobuf2-dma-contig.h>

#include "stf-camss.h"
#include "stf-video.h"

/* -----------------------------------------------------------------------------
 * Helper functions
 */

static inline struct stfcamss_buffer *
to_stfcamss_buffer(struct vb2_v4l2_buffer *vbuf)
{}

static const struct stfcamss_format_info *
video_g_fi_by_index(struct stfcamss_video *video, int index)
{}

static const struct stfcamss_format_info *
video_g_fi_by_mcode(struct stfcamss_video *video, u32 mcode)
{}

static const struct stfcamss_format_info *
video_g_fi_by_pfmt(struct stfcamss_video *video, u32 pixelformat)
{}

static int __video_try_fmt(struct stfcamss_video *video, struct v4l2_format *f)
{}

static int stf_video_init_format(struct stfcamss_video *video)
{}

/* -----------------------------------------------------------------------------
 * Video queue operations
 */

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

static int video_buf_init(struct vb2_buffer *vb)
{}

static int video_buf_prepare(struct vb2_buffer *vb)
{}

static void video_buf_queue(struct vb2_buffer *vb)
{}

static int video_get_subdev_format(struct stfcamss_video *video,
				   struct v4l2_subdev_format *fmt)
{}

static int stf_video_check_format(struct stfcamss_video *video)
{}

static int video_start_streaming(struct vb2_queue *q, unsigned int count)
{}

static void video_stop_streaming(struct vb2_queue *q)
{}

static const struct vb2_ops stf_video_vb2_q_ops =;

/* -----------------------------------------------------------------------------
 * V4L2 ioctls
 */

static int video_querycap(struct file *file, void *fh,
			  struct v4l2_capability *cap)
{}

static int video_enum_fmt(struct file *file, void *fh, struct v4l2_fmtdesc *f)
{}

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

static int video_g_fmt(struct file *file, void *fh, struct v4l2_format *f)
{}

static int video_s_fmt(struct file *file, void *fh, struct v4l2_format *f)
{}

static int video_try_fmt(struct file *file, void *fh, struct v4l2_format *f)
{}

static const struct v4l2_ioctl_ops stf_vid_ioctl_ops =;

/* -----------------------------------------------------------------------------
 * V4L2 file operations
 */

static const struct v4l2_file_operations stf_vid_fops =;

/* -----------------------------------------------------------------------------
 * STFCAMSS video core
 */

static int stf_link_validate(struct media_link *link)
{}

static const struct media_entity_operations stf_media_ops =;

static void stf_video_release(struct video_device *vdev)
{}

int stf_video_register(struct stfcamss_video *video,
		       struct v4l2_device *v4l2_dev, const char *name)
{}

void stf_video_unregister(struct stfcamss_video *video)
{}