Lines Matching refs:mpp

95 		container_of(dev, struct vdpu_dev, mpp)
121 struct mpp_dev mpp; member
349 struct mpp_dev *mpp = session->mpp; in vdpu_alloc_task() local
363 mpp_task->hw_info = mpp->var->hw_info; in vdpu_alloc_task()
384 mpp_task_dump_mem_region(mpp, mpp_task); in vdpu_alloc_task()
385 mpp_task_dump_reg(mpp, mpp_task); in vdpu_alloc_task()
391 static int vdpu_run(struct mpp_dev *mpp, in vdpu_run() argument
397 u32 timing_en = mpp->srv->timing_en; in vdpu_run()
402 mpp_write_relaxed(mpp, VDPU1_REG_CLR_CACHE_BASE, 1); in vdpu_run()
410 mpp_write_req(mpp, task->reg, s, e, reg_en); in vdpu_run()
414 mpp_iommu_flush_tlb(mpp->iommu_info); in vdpu_run()
417 mpp->cur_task = mpp_task; in vdpu_run()
423 mpp_write(mpp, VDPU1_REG_DEC_INT_EN, in vdpu_run()
433 static int vdpu_finish(struct mpp_dev *mpp, in vdpu_finish() argument
450 mpp_read_req(mpp, task->reg, s, e); in vdpu_finish()
455 dec_get = mpp_read_relaxed(mpp, VDPU1_REG_STREAM_RLC_BASE); in vdpu_finish()
466 static int vdpu_result(struct mpp_dev *mpp, in vdpu_result() argument
501 static int vdpu_procfs_remove(struct mpp_dev *mpp) in vdpu_procfs_remove() argument
503 struct vdpu_dev *dec = to_vdpu_dev(mpp); in vdpu_procfs_remove()
513 static int vdpu_procfs_init(struct mpp_dev *mpp) in vdpu_procfs_init() argument
515 struct vdpu_dev *dec = to_vdpu_dev(mpp); in vdpu_procfs_init()
517 dec->procfs = proc_mkdir(mpp->dev->of_node->name, mpp->srv->procfs); in vdpu_procfs_init()
525 mpp_procfs_create_common(dec->procfs, mpp); in vdpu_procfs_init()
530 dec->procfs, &mpp->session_max_buffers); in vdpu_procfs_init()
535 static inline int vdpu_procfs_remove(struct mpp_dev *mpp) in vdpu_procfs_remove() argument
540 static inline int vdpu_procfs_init(struct mpp_dev *mpp) in vdpu_procfs_init() argument
546 static int vdpu_init(struct mpp_dev *mpp) in vdpu_init() argument
549 struct vdpu_dev *dec = to_vdpu_dev(mpp); in vdpu_init()
551 mpp->grf_info = &mpp->srv->grf_infos[MPP_DRIVER_VDPU1]; in vdpu_init()
554 ret = mpp_get_clk_info(mpp, &dec->aclk_info, "aclk_vcodec"); in vdpu_init()
557 ret = mpp_get_clk_info(mpp, &dec->hclk_info, "hclk_vcodec"); in vdpu_init()
564 dec->rst_a = mpp_reset_control_get(mpp, RST_TYPE_A, "video_a"); in vdpu_init()
567 dec->rst_h = mpp_reset_control_get(mpp, RST_TYPE_H, "video_h"); in vdpu_init()
574 static int vdpu_3036_init(struct mpp_dev *mpp) in vdpu_3036_init() argument
576 vdpu_init(mpp); in vdpu_3036_init()
577 set_bit(mpp->var->device_type, &mpp->queue->dev_active_flags); in vdpu_3036_init()
581 static int vdpu_clk_on(struct mpp_dev *mpp) in vdpu_clk_on() argument
583 struct vdpu_dev *dec = to_vdpu_dev(mpp); in vdpu_clk_on()
591 static int vdpu_clk_off(struct mpp_dev *mpp) in vdpu_clk_off() argument
593 struct vdpu_dev *dec = to_vdpu_dev(mpp); in vdpu_clk_off()
601 static int vdpu_3288_get_freq(struct mpp_dev *mpp, in vdpu_3288_get_freq() argument
614 static int vdpu_3368_get_freq(struct mpp_dev *mpp, in vdpu_3368_get_freq() argument
627 static int vdpu_set_freq(struct mpp_dev *mpp, in vdpu_set_freq() argument
630 struct vdpu_dev *dec = to_vdpu_dev(mpp); in vdpu_set_freq()
638 static int vdpu_reduce_freq(struct mpp_dev *mpp) in vdpu_reduce_freq() argument
640 struct vdpu_dev *dec = to_vdpu_dev(mpp); in vdpu_reduce_freq()
647 static int vdpu_irq(struct mpp_dev *mpp) in vdpu_irq() argument
649 mpp->irq_status = mpp_read(mpp, VDPU1_REG_DEC_INT_EN); in vdpu_irq()
650 if (!(mpp->irq_status & VDPU1_DEC_INT_RAW)) in vdpu_irq()
653 mpp_write(mpp, VDPU1_REG_DEC_INT_EN, 0); in vdpu_irq()
655 mpp_write(mpp, VDPU1_REG_DEC_EN, VDPU1_CLOCK_GATE_EN); in vdpu_irq()
660 static int vdpu_isr(struct mpp_dev *mpp) in vdpu_isr() argument
664 struct mpp_task *mpp_task = mpp->cur_task; in vdpu_isr()
668 dev_err(mpp->dev, "no current task\n"); in vdpu_isr()
672 mpp->cur_task = NULL; in vdpu_isr()
674 task->irq_status = mpp->irq_status; in vdpu_isr()
685 atomic_inc(&mpp->reset_request); in vdpu_isr()
694 static int vdpu_soft_reset(struct mpp_dev *mpp) in vdpu_soft_reset() argument
699 mpp_write(mpp, VDPU1_REG_SOFT_RESET, 1); in vdpu_soft_reset()
700 ret = readl_relaxed_poll_timeout(mpp->reg_base + VDPU1_REG_SOFT_RESET, in vdpu_soft_reset()
706 static int vdpu_reset(struct mpp_dev *mpp) in vdpu_reset() argument
708 struct vdpu_dev *dec = to_vdpu_dev(mpp); in vdpu_reset()
712 ret = vdpu_soft_reset(mpp); in vdpu_reset()
718 mpp_pmu_idle_request(mpp, true); in vdpu_reset()
724 mpp_pmu_idle_request(mpp, false); in vdpu_reset()
728 mpp_write(mpp, VDPU1_REG_DEC_INT_EN, 0); in vdpu_reset()
733 static int vdpu_3036_set_grf(struct mpp_dev *mpp) in vdpu_3036_set_grf() argument
737 struct mpp_taskqueue *queue = mpp->queue; in vdpu_3036_set_grf()
740 grf_changed = mpp_grf_is_changed(mpp->grf_info); in vdpu_3036_set_grf()
747 pd_is_on = rockchip_pmu_pd_is_on(mpp->dev); in vdpu_3036_set_grf()
749 rockchip_pmu_pd_on(mpp->dev); in vdpu_3036_set_grf()
750 mpp->hw_ops->clk_on(mpp); in vdpu_3036_set_grf()
766 mpp_set_grf(mpp->grf_info); in vdpu_3036_set_grf()
767 rockchip_iommu_enable(mpp->dev); in vdpu_3036_set_grf()
768 set_bit(mpp->var->device_type, &queue->dev_active_flags); in vdpu_3036_set_grf()
770 mpp->hw_ops->clk_off(mpp); in vdpu_3036_set_grf()
772 rockchip_pmu_pd_off(mpp->dev); in vdpu_3036_set_grf()
902 struct mpp_dev *mpp = NULL; in vdpu_probe() local
910 mpp = &dec->mpp; in vdpu_probe()
911 platform_set_drvdata(pdev, mpp); in vdpu_probe()
916 mpp->var = (struct mpp_dev_var *)match->data; in vdpu_probe()
918 mpp->core_id = of_alias_get_id(pdev->dev.of_node, "vdpu"); in vdpu_probe()
921 ret = mpp_dev_probe(mpp, pdev); in vdpu_probe()
927 ret = devm_request_threaded_irq(dev, mpp->irq, in vdpu_probe()
931 dev_name(dev), mpp); in vdpu_probe()
937 if (mpp->var->device_type == MPP_DEVICE_VDPU1) { in vdpu_probe()
938 mpp->srv->sub_devices[MPP_DEVICE_VDPU1_PP] = mpp; in vdpu_probe()
939 set_bit(MPP_DEVICE_VDPU1_PP, &mpp->srv->hw_support); in vdpu_probe()
942 mpp->session_max_buffers = VDPU1_SESSION_MAX_BUFFERS; in vdpu_probe()
943 vdpu_procfs_init(mpp); in vdpu_probe()
945 mpp_dev_register_srv(mpp, mpp->srv); in vdpu_probe()
954 struct mpp_dev *mpp = dev_get_drvdata(dev); in vdpu_remove() local
957 mpp_dev_remove(mpp); in vdpu_remove()
958 vdpu_procfs_remove(mpp); in vdpu_remove()