45 lines · c
1/* SPDX-License-Identifier: GPL-2.0 */2 3#ifndef _MTK_VCODEC_FW_H_4#define _MTK_VCODEC_FW_H_5 6#include <linux/remoteproc.h>7#include <linux/remoteproc/mtk_scp.h>8 9#include "../../vpu/mtk_vpu.h"10 11struct mtk_vcodec_dec_dev;12struct mtk_vcodec_enc_dev;13 14enum mtk_vcodec_fw_type {15 VPU,16 SCP,17};18 19enum mtk_vcodec_fw_use {20 DECODER,21 ENCODER,22};23 24struct mtk_vcodec_fw;25 26typedef void (*mtk_vcodec_ipi_handler) (void *data,27 unsigned int len, void *priv);28 29struct mtk_vcodec_fw *mtk_vcodec_fw_select(void *priv, enum mtk_vcodec_fw_type type,30 enum mtk_vcodec_fw_use fw_use);31void mtk_vcodec_fw_release(struct mtk_vcodec_fw *fw);32 33int mtk_vcodec_fw_load_firmware(struct mtk_vcodec_fw *fw);34unsigned int mtk_vcodec_fw_get_vdec_capa(struct mtk_vcodec_fw *fw);35unsigned int mtk_vcodec_fw_get_venc_capa(struct mtk_vcodec_fw *fw);36void *mtk_vcodec_fw_map_dm_addr(struct mtk_vcodec_fw *fw, u32 mem_addr);37int mtk_vcodec_fw_ipi_register(struct mtk_vcodec_fw *fw, int id,38 mtk_vcodec_ipi_handler handler,39 const char *name, void *priv);40int mtk_vcodec_fw_ipi_send(struct mtk_vcodec_fw *fw, int id,41 void *buf, unsigned int len, unsigned int wait);42int mtk_vcodec_fw_get_type(struct mtk_vcodec_fw *fw);43 44#endif /* _MTK_VCODEC_FW_H_ */45