1 /* SPDX-License-Identifier: GPL-2.0 */
3 #ifndef _MTK_VCODEC_FW_PRIV_H_
4 #define _MTK_VCODEC_FW_PRIV_H_
6 #include "mtk_vcodec_fw.h"
10 struct mtk_vcodec_fw {
11 enum mtk_vcodec_fw_type type;
12 const struct mtk_vcodec_fw_ops *ops;
13 struct platform_device *pdev;
17 struct 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,
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);
30 #if IS_ENABLED(CONFIG_VIDEO_MEDIATEK_VCODEC_VPU)
31 struct mtk_vcodec_fw *mtk_vcodec_fw_vpu_init(struct mtk_vcodec_dev *dev,
32 enum mtk_vcodec_fw_use fw_use);
34 static inline struct mtk_vcodec_fw *
35 mtk_vcodec_fw_vpu_init(struct mtk_vcodec_dev *dev,
36 enum mtk_vcodec_fw_use fw_use)
38 return ERR_PTR(-ENODEV);
40 #endif /* CONFIG_VIDEO_MEDIATEK_VCODEC_VPU */
42 #if IS_ENABLED(CONFIG_VIDEO_MEDIATEK_VCODEC_SCP)
43 struct mtk_vcodec_fw *mtk_vcodec_fw_scp_init(struct mtk_vcodec_dev *dev);
45 static inline struct mtk_vcodec_fw *
46 mtk_vcodec_fw_scp_init(struct mtk_vcodec_dev *dev)
48 return ERR_PTR(-ENODEV);
50 #endif /* CONFIG_VIDEO_MEDIATEK_VCODEC_SCP */
52 #endif /* _MTK_VCODEC_FW_PRIV_H_ */