linux/drivers/media/platform/qcom/camss/camss-video.c

// SPDX-License-Identifier: GPL-2.0
/*
 * camss-video.c
 *
 * Qualcomm MSM Camera Subsystem - V4L2 device node
 *
 * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
 * Copyright (C) 2015-2018 Linaro Ltd.
 */
#include <linux/slab.h>
#include <media/media-entity.h>
#include <media/v4l2-dev.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-mc.h>
#include <media/videobuf2-dma-sg.h>

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

#define CAMSS_FRAME_MIN_WIDTH
#define CAMSS_FRAME_MAX_WIDTH
#define CAMSS_FRAME_MIN_HEIGHT
#define CAMSS_FRAME_MAX_HEIGHT_RDI
#define CAMSS_FRAME_MAX_HEIGHT_PIX

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

/*
 * video_mbus_to_pix_mp - Convert v4l2_mbus_framefmt to v4l2_pix_format_mplane
 * @mbus: v4l2_mbus_framefmt format (input)
 * @pix: v4l2_pix_format_mplane format (output)
 * @f: a pointer to formats array element to be used for the conversion
 * @alignment: bytesperline alignment value
 *
 * Fill the output pix structure with information from the input mbus format.
 *
 * Return 0 on success or a negative error code otherwise
 */
static int video_mbus_to_pix_mp(const struct v4l2_mbus_framefmt *mbus,
				struct v4l2_pix_format_mplane *pix,
				const struct camss_format_info *f,
				unsigned int alignment)
{}

static struct v4l2_subdev *video_remote_subdev(struct camss_video *video,
					       u32 *pad)
{}

static int video_get_subdev_format(struct camss_video *video,
				   struct v4l2_format *format)
{}

/* -----------------------------------------------------------------------------
 * 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_check_format(struct camss_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 msm_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_try_fmt(struct camss_video *video, struct v4l2_format *f)
{}

static int video_try_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_enum_input(struct file *file, void *fh,
			    struct v4l2_input *input)
{}

static int video_g_input(struct file *file, void *fh, unsigned int *input)
{}

static int video_s_input(struct file *file, void *fh, unsigned int input)
{}

static const struct v4l2_ioctl_ops msm_vid_ioctl_ops =;

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

static int video_open(struct file *file)
{}

static int video_release(struct file *file)
{}

static const struct v4l2_file_operations msm_vid_fops =;

/* -----------------------------------------------------------------------------
 * CAMSS video core
 */

static void msm_video_release(struct video_device *vdev)
{}

/*
 * msm_video_init_format - Helper function to initialize format
 * @video: struct camss_video
 *
 * Initialize pad format with default value.
 *
 * Return 0 on success or a negative error code otherwise
 */
static int msm_video_init_format(struct camss_video *video)
{}

/*
 * msm_video_register - Register a video device node
 * @video: struct camss_video
 * @v4l2_dev: V4L2 device
 * @name: name to be used for the video device node
 *
 * Initialize and register a video device node to a V4L2 device. Also
 * initialize the vb2 queue.
 *
 * Return 0 on success or a negative error code otherwise
 */

int msm_video_register(struct camss_video *video, struct v4l2_device *v4l2_dev,
		       const char *name)
{}

void msm_video_unregister(struct camss_video *video)
{}