Lines Matching refs:pcdev

237 	struct emmaprp_dev *pcdev = ctx->dev;  in emmaprp_job_abort()  local
241 dprintk(pcdev, "Aborting task\n"); in emmaprp_job_abort()
243 v4l2_m2m_job_finish(pcdev->m2m_dev, ctx->fh.m2m_ctx); in emmaprp_job_abort()
246 static inline void emmaprp_dump_regs(struct emmaprp_dev *pcdev) in emmaprp_dump_regs() argument
248 dprintk(pcdev, in emmaprp_dump_regs()
257 readl(pcdev->base_emma + PRP_SOURCE_Y_PTR), in emmaprp_dump_regs()
258 readl(pcdev->base_emma + PRP_SRC_FRAME_SIZE), in emmaprp_dump_regs()
259 readl(pcdev->base_emma + PRP_DEST_Y_PTR), in emmaprp_dump_regs()
260 readl(pcdev->base_emma + PRP_DEST_CR_PTR), in emmaprp_dump_regs()
261 readl(pcdev->base_emma + PRP_DEST_CB_PTR), in emmaprp_dump_regs()
262 readl(pcdev->base_emma + PRP_CH2_OUT_IMAGE_SIZE), in emmaprp_dump_regs()
263 readl(pcdev->base_emma + PRP_CNTL)); in emmaprp_dump_regs()
271 struct emmaprp_dev *pcdev = ctx->dev; in emmaprp_device_run() local
293 v4l2_err(&pcdev->v4l2_dev, in emmaprp_device_run()
299 writel(p_in, pcdev->base_emma + PRP_SOURCE_Y_PTR); in emmaprp_device_run()
301 pcdev->base_emma + PRP_SRC_FRAME_SIZE); in emmaprp_device_run()
304 writel(p_out, pcdev->base_emma + PRP_DEST_Y_PTR); in emmaprp_device_run()
305 writel(p_out + d_size, pcdev->base_emma + PRP_DEST_CB_PTR); in emmaprp_device_run()
307 pcdev->base_emma + PRP_DEST_CR_PTR); in emmaprp_device_run()
309 pcdev->base_emma + PRP_CH2_OUT_IMAGE_SIZE); in emmaprp_device_run()
312 tmp = readl(pcdev->base_emma + PRP_INTR_CNTL); in emmaprp_device_run()
316 pcdev->base_emma + PRP_INTR_CNTL); in emmaprp_device_run()
318 emmaprp_dump_regs(pcdev); in emmaprp_device_run()
321 tmp = readl(pcdev->base_emma + PRP_CNTL); in emmaprp_device_run()
325 pcdev->base_emma + PRP_CNTL); in emmaprp_device_run()
330 struct emmaprp_dev *pcdev = data; in emmaprp_irq() local
337 irqst = readl(pcdev->base_emma + PRP_INTRSTATUS); in emmaprp_irq()
338 writel(irqst, pcdev->base_emma + PRP_INTRSTATUS); in emmaprp_irq()
339 dprintk(pcdev, "irqst = 0x%08x\n", irqst); in emmaprp_irq()
341 curr_ctx = v4l2_m2m_get_curr_priv(pcdev->m2m_dev); in emmaprp_irq()
351 writel(PRP_CNTL_SWRST, pcdev->base_emma + PRP_CNTL); in emmaprp_irq()
364 spin_lock_irqsave(&pcdev->irqlock, flags); in emmaprp_irq()
367 spin_unlock_irqrestore(&pcdev->irqlock, flags); in emmaprp_irq()
371 v4l2_m2m_job_finish(pcdev->m2m_dev, curr_ctx->fh.m2m_ctx); in emmaprp_irq()
722 struct emmaprp_dev *pcdev = video_drvdata(file); in emmaprp_open() local
731 ctx->dev = pcdev; in emmaprp_open()
733 if (mutex_lock_interruptible(&pcdev->dev_mutex)) { in emmaprp_open()
738 ctx->fh.m2m_ctx = v4l2_m2m_ctx_init(pcdev->m2m_dev, ctx, &queue_init); in emmaprp_open()
743 mutex_unlock(&pcdev->dev_mutex); in emmaprp_open()
748 clk_prepare_enable(pcdev->clk_emma_ipg); in emmaprp_open()
749 clk_prepare_enable(pcdev->clk_emma_ahb); in emmaprp_open()
753 mutex_unlock(&pcdev->dev_mutex); in emmaprp_open()
755 dprintk(pcdev, "Created instance %p, m2m_ctx: %p\n", ctx, ctx->fh.m2m_ctx); in emmaprp_open()
762 struct emmaprp_dev *pcdev = video_drvdata(file); in emmaprp_release() local
765 dprintk(pcdev, "Releasing instance %p\n", ctx); in emmaprp_release()
767 mutex_lock(&pcdev->dev_mutex); in emmaprp_release()
768 clk_disable_unprepare(pcdev->clk_emma_ahb); in emmaprp_release()
769 clk_disable_unprepare(pcdev->clk_emma_ipg); in emmaprp_release()
773 mutex_unlock(&pcdev->dev_mutex); in emmaprp_release()
805 struct emmaprp_dev *pcdev; in emmaprp_probe() local
809 pcdev = devm_kzalloc(&pdev->dev, sizeof(*pcdev), GFP_KERNEL); in emmaprp_probe()
810 if (!pcdev) in emmaprp_probe()
813 spin_lock_init(&pcdev->irqlock); in emmaprp_probe()
815 pcdev->clk_emma_ipg = devm_clk_get(&pdev->dev, "ipg"); in emmaprp_probe()
816 if (IS_ERR(pcdev->clk_emma_ipg)) { in emmaprp_probe()
817 return PTR_ERR(pcdev->clk_emma_ipg); in emmaprp_probe()
820 pcdev->clk_emma_ahb = devm_clk_get(&pdev->dev, "ahb"); in emmaprp_probe()
821 if (IS_ERR(pcdev->clk_emma_ahb)) in emmaprp_probe()
822 return PTR_ERR(pcdev->clk_emma_ahb); in emmaprp_probe()
824 pcdev->base_emma = devm_platform_ioremap_resource(pdev, 0); in emmaprp_probe()
825 if (IS_ERR(pcdev->base_emma)) in emmaprp_probe()
826 return PTR_ERR(pcdev->base_emma); in emmaprp_probe()
828 ret = v4l2_device_register(&pdev->dev, &pcdev->v4l2_dev); in emmaprp_probe()
832 mutex_init(&pcdev->dev_mutex); in emmaprp_probe()
836 v4l2_err(&pcdev->v4l2_dev, "Failed to allocate video device\n"); in emmaprp_probe()
842 vfd->lock = &pcdev->dev_mutex; in emmaprp_probe()
843 vfd->v4l2_dev = &pcdev->v4l2_dev; in emmaprp_probe()
845 video_set_drvdata(vfd, pcdev); in emmaprp_probe()
846 pcdev->vfd = vfd; in emmaprp_probe()
847 v4l2_info(&pcdev->v4l2_dev, EMMAPRP_MODULE_NAME in emmaprp_probe()
850 platform_set_drvdata(pdev, pcdev); in emmaprp_probe()
859 dev_name(&pdev->dev), pcdev); in emmaprp_probe()
863 pcdev->m2m_dev = v4l2_m2m_init(&m2m_ops); in emmaprp_probe()
864 if (IS_ERR(pcdev->m2m_dev)) { in emmaprp_probe()
865 v4l2_err(&pcdev->v4l2_dev, "Failed to init mem2mem device\n"); in emmaprp_probe()
866 ret = PTR_ERR(pcdev->m2m_dev); in emmaprp_probe()
872 v4l2_err(&pcdev->v4l2_dev, "Failed to register video device\n"); in emmaprp_probe()
880 v4l2_m2m_release(pcdev->m2m_dev); in emmaprp_probe()
884 v4l2_device_unregister(&pcdev->v4l2_dev); in emmaprp_probe()
886 mutex_destroy(&pcdev->dev_mutex); in emmaprp_probe()
893 struct emmaprp_dev *pcdev = platform_get_drvdata(pdev); in emmaprp_remove() local
895 v4l2_info(&pcdev->v4l2_dev, "Removing " EMMAPRP_MODULE_NAME); in emmaprp_remove()
897 video_unregister_device(pcdev->vfd); in emmaprp_remove()
898 v4l2_m2m_release(pcdev->m2m_dev); in emmaprp_remove()
899 v4l2_device_unregister(&pcdev->v4l2_dev); in emmaprp_remove()
900 mutex_destroy(&pcdev->dev_mutex); in emmaprp_remove()