1
2
3#ifndef _MTK_VCODEC_FW_PRIV_H_
4#define _MTK_VCODEC_FW_PRIV_H_
5
6#include "mtk_vcodec_fw.h"
7
8struct mtk_vcodec_dev;
9
10struct mtk_vcodec_fw {
11 enum mtk_vcodec_fw_type type;
12 const struct mtk_vcodec_fw_ops *ops;
13 struct platform_device *pdev;
14 struct mtk_scp *scp;
15};
16
17struct mtk_vcodec_fw_ops {
18 int (*load_firmware)(struct mtk_vcodec_fw *fw);
19 unsigned int (*get_vdec_capa)(struct mtk_vcodec_fw *fw);
20 unsigned int (*get_venc_capa)(struct mtk_vcodec_fw *fw);
21 void *(*map_dm_addr)(struct mtk_vcodec_fw *fw, u32 dtcm_dmem_addr);
22 int (*ipi_register)(struct mtk_vcodec_fw *fw, int id,
23 mtk_vcodec_ipi_handler handler, const char *name,
24 void *priv);
25 int (*ipi_send)(struct mtk_vcodec_fw *fw, int id, void *buf,
26 unsigned int len, unsigned int wait);
27 void (*release)(struct mtk_vcodec_fw *fw);
28};
29
30#if IS_ENABLED(CONFIG_VIDEO_MEDIATEK_VCODEC_VPU)
31struct mtk_vcodec_fw *mtk_vcodec_fw_vpu_init(struct mtk_vcodec_dev *dev,
32 enum mtk_vcodec_fw_use fw_use);
33#else
34static inline struct mtk_vcodec_fw *
35mtk_vcodec_fw_vpu_init(struct mtk_vcodec_dev *dev,
36 enum mtk_vcodec_fw_use fw_use)
37{
38 return ERR_PTR(-ENODEV);
39}
40#endif
41
42#if IS_ENABLED(CONFIG_VIDEO_MEDIATEK_VCODEC_SCP)
43struct mtk_vcodec_fw *mtk_vcodec_fw_scp_init(struct mtk_vcodec_dev *dev);
44#else
45static inline struct mtk_vcodec_fw *
46mtk_vcodec_fw_scp_init(struct mtk_vcodec_dev *dev)
47{
48 return ERR_PTR(-ENODEV);
49}
50#endif
51
52#endif
53