Lines Matching refs:comp

31 	return ctx->comp->mdp_dev->mdp_data->mdp_cfg;  in __get_plat_cfg()
39 rdma0 = mdp_cfg_get_id_inner(ctx->comp->mdp_dev, MDP_COMP_RDMA0); in get_comp_flag()
40 rsz1 = mdp_cfg_get_id_inner(ctx->comp->mdp_dev, MDP_COMP_RSZ1); in get_comp_flag()
45 if (ctx->comp->inner_id == rdma0) in get_comp_flag()
48 return BIT(ctx->comp->inner_id); in get_comp_flag()
54 phys_addr_t base = ctx->comp->reg_base; in init_rdma()
55 u8 subsys_id = ctx->comp->subsys_id; in init_rdma()
58 rdma0 = mdp_cfg_get_id_inner(ctx->comp->mdp_dev, MDP_COMP_RDMA0); in init_rdma()
63 struct mdp_comp *prz1 = ctx->comp->mdp_dev->comp[MDP_COMP_RSZ1]; in init_rdma()
66 if (ctx->comp->inner_id == rdma0 && prz1) in init_rdma()
86 phys_addr_t base = ctx->comp->reg_base; in config_rdma_frame()
87 u8 subsys_id = ctx->comp->subsys_id; in config_rdma_frame()
189 phys_addr_t base = ctx->comp->reg_base; in config_rdma_subfrm()
190 u8 subsys_id = ctx->comp->subsys_id; in config_rdma_subfrm()
254 struct device *dev = &ctx->comp->mdp_dev->pdev->dev; in wait_rdma_event()
255 phys_addr_t base = ctx->comp->reg_base; in wait_rdma_event()
256 u8 subsys_id = ctx->comp->subsys_id; in wait_rdma_event()
258 if (ctx->comp->alias_id == 0) in wait_rdma_event()
259 MM_REG_WAIT(cmd, ctx->comp->gce_event[MDP_GCE_EVENT_EOF]); in wait_rdma_event()
278 phys_addr_t base = ctx->comp->reg_base; in init_rsz()
279 u8 subsys_id = ctx->comp->subsys_id; in init_rsz()
293 phys_addr_t base = ctx->comp->reg_base; in config_rsz_frame()
294 u8 subsys_id = ctx->comp->subsys_id; in config_rsz_frame()
330 phys_addr_t base = ctx->comp->reg_base; in config_rsz_subfrm()
331 u8 subsys_id = ctx->comp->subsys_id; in config_rsz_subfrm()
395 phys_addr_t base = ctx->comp->reg_base; in advance_rsz_subfrm()
396 u8 subsys_id = ctx->comp->subsys_id; in advance_rsz_subfrm()
422 phys_addr_t base = ctx->comp->reg_base; in init_wrot()
423 u8 subsys_id = ctx->comp->subsys_id; in init_wrot()
438 phys_addr_t base = ctx->comp->reg_base; in config_wrot_frame()
439 u8 subsys_id = ctx->comp->subsys_id; in config_wrot_frame()
504 phys_addr_t base = ctx->comp->reg_base; in config_wrot_subfrm()
505 u8 subsys_id = ctx->comp->subsys_id; in config_wrot_subfrm()
552 struct device *dev = &ctx->comp->mdp_dev->pdev->dev; in wait_wrot_event()
553 phys_addr_t base = ctx->comp->reg_base; in wait_wrot_event()
554 u8 subsys_id = ctx->comp->subsys_id; in wait_wrot_event()
556 if (ctx->comp->alias_id == 0) in wait_wrot_event()
557 MM_REG_WAIT(cmd, ctx->comp->gce_event[MDP_GCE_EVENT_EOF]); in wait_wrot_event()
581 phys_addr_t base = ctx->comp->reg_base; in init_wdma()
582 u8 subsys_id = ctx->comp->subsys_id; in init_wdma()
595 phys_addr_t base = ctx->comp->reg_base; in config_wdma_frame()
596 u8 subsys_id = ctx->comp->subsys_id; in config_wdma_frame()
640 phys_addr_t base = ctx->comp->reg_base; in config_wdma_subfrm()
641 u8 subsys_id = ctx->comp->subsys_id; in config_wdma_subfrm()
683 phys_addr_t base = ctx->comp->reg_base; in wait_wdma_event()
684 u8 subsys_id = ctx->comp->subsys_id; in wait_wdma_event()
686 MM_REG_WAIT(cmd, ctx->comp->gce_event[MDP_GCE_EVENT_EOF]); in wait_wdma_event()
702 phys_addr_t base = ctx->comp->reg_base; in init_ccorr()
703 u8 subsys_id = ctx->comp->subsys_id; in init_ccorr()
715 phys_addr_t base = ctx->comp->reg_base; in config_ccorr_subfrm()
716 u8 subsys_id = ctx->comp->subsys_id; in config_ccorr_subfrm()
796 int mdp_comp_clock_on(struct device *dev, struct mdp_comp *comp) in mdp_comp_clock_on() argument
801 if (comp->comp_dev && is_dma_capable(comp->type)) { in mdp_comp_clock_on()
802 ret = pm_runtime_resume_and_get(comp->comp_dev); in mdp_comp_clock_on()
806 ret, comp->type, comp->inner_id); in mdp_comp_clock_on()
811 for (i = 0; i < comp->clk_num; i++) { in mdp_comp_clock_on()
812 if (IS_ERR_OR_NULL(comp->clks[i])) in mdp_comp_clock_on()
814 ret = clk_prepare_enable(comp->clks[i]); in mdp_comp_clock_on()
818 i, comp->type, comp->inner_id); in mdp_comp_clock_on()
827 if (IS_ERR_OR_NULL(comp->clks[i])) in mdp_comp_clock_on()
829 clk_disable_unprepare(comp->clks[i]); in mdp_comp_clock_on()
831 if (comp->comp_dev && is_dma_capable(comp->type)) in mdp_comp_clock_on()
832 pm_runtime_put_sync(comp->comp_dev); in mdp_comp_clock_on()
837 void mdp_comp_clock_off(struct device *dev, struct mdp_comp *comp) in mdp_comp_clock_off() argument
841 for (i = 0; i < comp->clk_num; i++) { in mdp_comp_clock_off()
842 if (IS_ERR_OR_NULL(comp->clks[i])) in mdp_comp_clock_off()
844 clk_disable_unprepare(comp->clks[i]); in mdp_comp_clock_off()
847 if (comp->comp_dev && is_dma_capable(comp->type)) in mdp_comp_clock_off()
848 pm_runtime_put(comp->comp_dev); in mdp_comp_clock_off()
873 struct device_node *node, struct mdp_comp *comp) in mdp_get_subsys_id() argument
880 if (!dev || !node || !comp) in mdp_get_subsys_id()
887 comp->public_id, comp->inner_id, comp->type); in mdp_get_subsys_id()
891 index = mdp->mdp_data->comp_data[comp->public_id].info.dts_reg_ofst; in mdp_get_subsys_id()
899 comp->subsys_id = cmdq_reg.subsys; in mdp_get_subsys_id()
907 struct mdp_comp *comp) in __mdp_comp_init() argument
913 index = mdp->mdp_data->comp_data[comp->public_id].info.dts_reg_ofst; in __mdp_comp_init()
919 comp->mdp_dev = mdp; in __mdp_comp_init()
920 comp->regs = of_iomap(node, 0); in __mdp_comp_init()
921 comp->reg_base = base; in __mdp_comp_init()
925 struct mdp_comp *comp, enum mtk_mdp_comp_id id) in mdp_comp_init() argument
945 comp->comp_dev = &pdev_c->dev; in mdp_comp_init()
946 comp->public_id = id; in mdp_comp_init()
947 comp->type = mdp->mdp_data->comp_data[id].match.type; in mdp_comp_init()
948 comp->inner_id = mdp->mdp_data->comp_data[id].match.inner_id; in mdp_comp_init()
949 comp->alias_id = mdp->mdp_data->comp_data[id].match.alias_id; in mdp_comp_init()
950 comp->ops = mdp_comp_ops[comp->type]; in mdp_comp_init()
951 __mdp_comp_init(mdp, node, comp); in mdp_comp_init()
953 comp->clk_num = mdp->mdp_data->comp_data[id].info.clk_num; in mdp_comp_init()
954 comp->clks = devm_kzalloc(dev, sizeof(struct clk *) * comp->clk_num, in mdp_comp_init()
956 if (!comp->clks) in mdp_comp_init()
961 for (i = 0; i < comp->clk_num; i++) { in mdp_comp_init()
962 comp->clks[i] = of_clk_get(node, i + clk_ofst); in mdp_comp_init()
963 if (IS_ERR(comp->clks[i])) in mdp_comp_init()
967 mdp_get_subsys_id(mdp, dev, node, comp); in mdp_comp_init()
970 if (is_bypass_gce_event(comp->type) || in mdp_comp_init()
975 comp->gce_event[MDP_GCE_EVENT_SOF] = event; in mdp_comp_init()
978 if (is_dma_capable(comp->type)) { in mdp_comp_init()
988 comp->gce_event[MDP_GCE_EVENT_EOF] = event; in mdp_comp_init()
993 static void mdp_comp_deinit(struct mdp_comp *comp) in mdp_comp_deinit() argument
995 if (!comp) in mdp_comp_deinit()
998 if (comp->comp_dev && comp->clks) { in mdp_comp_deinit()
999 devm_kfree(&comp->mdp_dev->pdev->dev, comp->clks); in mdp_comp_deinit()
1000 comp->clks = NULL; in mdp_comp_deinit()
1003 if (comp->regs) in mdp_comp_deinit()
1004 iounmap(comp->regs); in mdp_comp_deinit()
1012 struct mdp_comp *comp; in mdp_comp_create() local
1015 if (mdp->comp[id]) in mdp_comp_create()
1018 comp = devm_kzalloc(dev, sizeof(*comp), GFP_KERNEL); in mdp_comp_create()
1019 if (!comp) in mdp_comp_create()
1022 ret = mdp_comp_init(mdp, node, comp, id); in mdp_comp_create()
1024 devm_kfree(dev, comp); in mdp_comp_create()
1027 mdp->comp[id] = comp; in mdp_comp_create()
1028 mdp->comp[id]->mdp_dev = mdp; in mdp_comp_create()
1031 dev->of_node->name, comp->type, comp->alias_id, id, comp->inner_id, in mdp_comp_create()
1032 (u32)comp->reg_base, comp->regs); in mdp_comp_create()
1033 return comp; in mdp_comp_create()
1048 struct mdp_comp *comp; in mdp_comp_sub_create() local
1071 comp = mdp_comp_create(mdp, node, id); in mdp_comp_sub_create()
1072 if (IS_ERR(comp)) { in mdp_comp_sub_create()
1073 ret = PTR_ERR(comp); in mdp_comp_sub_create()
1088 for (i = 0; i < ARRAY_SIZE(mdp->comp); i++) { in mdp_comp_destroy()
1089 if (mdp->comp[i]) { in mdp_comp_destroy()
1090 if (is_dma_capable(mdp->comp[i]->type)) in mdp_comp_destroy()
1091 pm_runtime_disable(mdp->comp[i]->comp_dev); in mdp_comp_destroy()
1092 mdp_comp_deinit(mdp->comp[i]); in mdp_comp_destroy()
1093 devm_kfree(mdp->comp[i]->comp_dev, mdp->comp[i]); in mdp_comp_destroy()
1094 mdp->comp[i] = NULL; in mdp_comp_destroy()
1114 struct mdp_comp *comp; in mdp_comp_config() local
1137 comp = mdp_comp_create(mdp, node, id); in mdp_comp_config()
1138 if (IS_ERR(comp)) { in mdp_comp_config()
1139 ret = PTR_ERR(comp); in mdp_comp_config()
1144 if (!is_dma_capable(comp->type)) in mdp_comp_config()
1146 pm_runtime_enable(comp->comp_dev); in mdp_comp_config()
1184 ctx->comp = mdp->comp[public_id]; in mdp_comp_ctx_config()
1185 if (!ctx->comp) { in mdp_comp_ctx_config()