GNU Linux-libre 5.19-rc6-gnu
[releases.git] / drivers / media / platform / mediatek / vcodec / mtk_vcodec_fw.h
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
11 struct mtk_vcodec_dev;
12
13 enum mtk_vcodec_fw_type {
14         VPU,
15         SCP,
16 };
17
18 enum mtk_vcodec_fw_use {
19         DECODER,
20         ENCODER,
21 };
22
23 struct mtk_vcodec_fw;
24
25 typedef void (*mtk_vcodec_ipi_handler) (void *data,
26         unsigned int len, void *priv);
27
28 struct mtk_vcodec_fw *mtk_vcodec_fw_select(struct mtk_vcodec_dev *dev,
29                                            enum mtk_vcodec_fw_type type,
30                                            enum mtk_vcodec_fw_use fw_use);
31 void mtk_vcodec_fw_release(struct mtk_vcodec_fw *fw);
32
33 int mtk_vcodec_fw_load_firmware(struct mtk_vcodec_fw *fw);
34 unsigned int mtk_vcodec_fw_get_vdec_capa(struct mtk_vcodec_fw *fw);
35 unsigned int mtk_vcodec_fw_get_venc_capa(struct mtk_vcodec_fw *fw);
36 void *mtk_vcodec_fw_map_dm_addr(struct mtk_vcodec_fw *fw, u32 mem_addr);
37 int mtk_vcodec_fw_ipi_register(struct mtk_vcodec_fw *fw, int id,
38                                mtk_vcodec_ipi_handler handler,
39                                const char *name, void *priv);
40 int mtk_vcodec_fw_ipi_send(struct mtk_vcodec_fw *fw, int id,
41                            void *buf, unsigned int len, unsigned int wait);
42 int mtk_vcodec_fw_get_type(struct mtk_vcodec_fw *fw);
43
44 #endif /* _MTK_VCODEC_FW_H_ */