linux/drivers/media/platform/st/sti/hva/hva-v4l2.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (C) STMicroelectronics SA 2015
 * Authors: Yannick Fertre <[email protected]>
 *          Hugues Fruchet <[email protected]>
 */

#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <media/v4l2-event.h>
#include <media/v4l2-ioctl.h>
#include <media/videobuf2-dma-contig.h>

#include "hva.h"
#include "hva-hw.h"

#define MIN_FRAMES
#define MIN_STREAMS

#define HVA_MIN_WIDTH
#define HVA_MAX_WIDTH
#define HVA_MIN_HEIGHT
#define HVA_MAX_HEIGHT

/* HVA requires a 16x16 pixels alignment for frames */
#define HVA_WIDTH_ALIGNMENT
#define HVA_HEIGHT_ALIGNMENT

#define HVA_DEFAULT_WIDTH
#define HVA_DEFAULT_HEIGHT
#define HVA_DEFAULT_FRAME_NUM
#define HVA_DEFAULT_FRAME_DEN

#define to_type_str(type)

#define fh_to_ctx(f)

/* registry of available encoders */
static const struct hva_enc *hva_encoders[] =;

static inline int frame_size(u32 w, u32 h, u32 fmt)
{}

static inline int frame_stride(u32 w, u32 fmt)
{}

static inline int frame_alignment(u32 fmt)
{}

static inline int estimated_stream_size(u32 w, u32 h)
{}

static void set_default_params(struct hva_ctx *ctx)
{}

static const struct hva_enc *hva_find_encoder(struct hva_ctx *ctx,
					      u32 pixelformat,
					      u32 streamformat)
{}

static void register_format(u32 format, u32 formats[], u32 *nb_of_formats)
{}

static void register_formats(struct hva_dev *hva)
{}

static void register_encoders(struct hva_dev *hva)
{}

static int hva_open_encoder(struct hva_ctx *ctx, u32 streamformat,
			    u32 pixelformat, struct hva_enc **penc)
{}

static void hva_dbg_summary(struct hva_ctx *ctx)
{}

/*
 * V4L2 ioctl operations
 */

static int hva_querycap(struct file *file, void *priv,
			struct v4l2_capability *cap)
{}

static int hva_enum_fmt_stream(struct file *file, void *priv,
			       struct v4l2_fmtdesc *f)
{}

static int hva_enum_fmt_frame(struct file *file, void *priv,
			      struct v4l2_fmtdesc *f)
{}

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

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

static int hva_try_fmt_stream(struct file *file, void *priv,
			      struct v4l2_format *f)
{}

static int hva_try_fmt_frame(struct file *file, void *priv,
			     struct v4l2_format *f)
{}

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

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

static int hva_g_parm(struct file *file, void *fh, struct v4l2_streamparm *sp)
{}

static int hva_s_parm(struct file *file, void *fh, struct v4l2_streamparm *sp)
{}

static int hva_qbuf(struct file *file, void *priv, struct v4l2_buffer *buf)
{}

/* V4L2 ioctl ops */
static const struct v4l2_ioctl_ops hva_ioctl_ops =;

/*
 * V4L2 control operations
 */

static int hva_s_ctrl(struct v4l2_ctrl *ctrl)
{}

/* V4L2 control ops */
static const struct v4l2_ctrl_ops hva_ctrl_ops =;

static int hva_ctrls_setup(struct hva_ctx *ctx)
{}

/*
 * mem-to-mem operations
 */

static void hva_run_work(struct work_struct *work)
{}

static void hva_device_run(void *priv)
{}

static void hva_job_abort(void *priv)
{}

static int hva_job_ready(void *priv)
{}

/* mem-to-mem ops */
static const struct v4l2_m2m_ops hva_m2m_ops =;

/*
 * VB2 queue operations
 */

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

static int hva_buf_prepare(struct vb2_buffer *vb)
{}

static void hva_buf_queue(struct vb2_buffer *vb)
{}

static int hva_start_streaming(struct vb2_queue *vq, unsigned int count)
{}

static void hva_stop_streaming(struct vb2_queue *vq)
{}

/* VB2 queue ops */
static const struct vb2_ops hva_qops =;

/*
 * V4L2 file operations
 */

static int queue_init(struct hva_ctx *ctx, struct vb2_queue *vq)
{}

static int hva_queue_init(void *priv, struct vb2_queue *src_vq,
			  struct vb2_queue *dst_vq)
{}

static int hva_open(struct file *file)
{}

static int hva_release(struct file *file)
{}

/* V4L2 file ops */
static const struct v4l2_file_operations hva_fops =;

/*
 * Platform device operations
 */

static int hva_register_device(struct hva_dev *hva)
{}

static void hva_unregister_device(struct hva_dev *hva)
{}

static int hva_probe(struct platform_device *pdev)
{}

static void hva_remove(struct platform_device *pdev)
{}

/* PM ops */
static const struct dev_pm_ops hva_pm_ops =;

static const struct of_device_id hva_match_types[] =;

MODULE_DEVICE_TABLE(of, hva_match_types);

static struct platform_driver hva_driver =;

module_platform_driver();

MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_DESCRIPTION();