linux/drivers/media/platform/amphion/vpu.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright 2020-2021 NXP
 */

#ifndef _AMPHION_VPU_H
#define _AMPHION_VPU_H

#include <media/v4l2-device.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-mem2mem.h>
#include <linux/mailbox_client.h>
#include <linux/mailbox_controller.h>
#include <linux/kfifo.h>

#define VPU_TIMEOUT_WAKEUP
#define VPU_TIMEOUT
#define VPU_INST_NULL_ID
#define VPU_MSG_BUFFER_SIZE

enum imx_plat_type {};

enum vpu_core_type {};

struct vpu_dev;
struct vpu_resources {};

struct vpu_buffer {};

struct vpu_func {};

struct vpu_dev {};

struct vpu_format {};

struct vpu_core_resources {};

struct vpu_mbox {};

enum vpu_core_state {};

struct vpu_core {};

enum vpu_codec_state {};

struct vpu_frame_info {};

struct vpu_inst;
struct vpu_inst_ops {};

struct vpu_inst {};

#define call_vop(inst, op, args...)		\

#define call_void_vop(inst, op, args...)

enum {};

struct vpu_vb2_buffer {};

void vpu_writel(struct vpu_dev *vpu, u32 reg, u32 val);
u32 vpu_readl(struct vpu_dev *vpu, u32 reg);

static inline struct vpu_vb2_buffer *to_vpu_vb2_buffer(struct vb2_v4l2_buffer *vbuf)
{}

static inline const char *vpu_core_type_desc(enum vpu_core_type type)
{}

static inline struct vpu_inst *to_inst(struct file *filp)
{}

#define ctrl_to_inst(ctrl)

const struct v4l2_ioctl_ops *venc_get_ioctl_ops(void);
const struct v4l2_file_operations *venc_get_fops(void);
const struct v4l2_ioctl_ops *vdec_get_ioctl_ops(void);
const struct v4l2_file_operations *vdec_get_fops(void);

int vpu_add_func(struct vpu_dev *vpu, struct vpu_func *func);
void vpu_remove_func(struct vpu_func *func);

struct vpu_inst *vpu_inst_get(struct vpu_inst *inst);
void vpu_inst_put(struct vpu_inst *inst);
struct vpu_core *vpu_request_core(struct vpu_dev *vpu, enum vpu_core_type type);
void vpu_release_core(struct vpu_core *core);
int vpu_inst_register(struct vpu_inst *inst);
int vpu_inst_unregister(struct vpu_inst *inst);
const struct vpu_core_resources *vpu_get_resource(struct vpu_inst *inst);

int vpu_inst_create_dbgfs_file(struct vpu_inst *inst);
int vpu_inst_remove_dbgfs_file(struct vpu_inst *inst);
int vpu_core_create_dbgfs_file(struct vpu_core *core);
int vpu_core_remove_dbgfs_file(struct vpu_core *core);
void vpu_inst_record_flow(struct vpu_inst *inst, u32 flow);

int vpu_core_driver_init(void);
void vpu_core_driver_exit(void);

const char *vpu_id_name(u32 id);
const char *vpu_codec_state_name(enum vpu_codec_state state);

extern bool debug;
#define vpu_trace(dev, fmt, arg...)

#endif