Lines Matching refs:pcdev
244 struct emmaprp_dev *pcdev = ctx->dev; in emmaprp_job_abort() local
248 dprintk(pcdev, "Aborting task\n"); in emmaprp_job_abort()
250 v4l2_m2m_job_finish(pcdev->m2m_dev, ctx->m2m_ctx); in emmaprp_job_abort()
256 struct emmaprp_dev *pcdev = ctx->dev; in emmaprp_lock() local
257 mutex_lock(&pcdev->dev_mutex); in emmaprp_lock()
263 struct emmaprp_dev *pcdev = ctx->dev; in emmaprp_unlock() local
264 mutex_unlock(&pcdev->dev_mutex); in emmaprp_unlock()
267 static inline void emmaprp_dump_regs(struct emmaprp_dev *pcdev) in emmaprp_dump_regs() argument
269 dprintk(pcdev, in emmaprp_dump_regs()
278 readl(pcdev->base_emma + PRP_SOURCE_Y_PTR), in emmaprp_dump_regs()
279 readl(pcdev->base_emma + PRP_SRC_FRAME_SIZE), in emmaprp_dump_regs()
280 readl(pcdev->base_emma + PRP_DEST_Y_PTR), in emmaprp_dump_regs()
281 readl(pcdev->base_emma + PRP_DEST_CR_PTR), in emmaprp_dump_regs()
282 readl(pcdev->base_emma + PRP_DEST_CB_PTR), in emmaprp_dump_regs()
283 readl(pcdev->base_emma + PRP_CH2_OUT_IMAGE_SIZE), in emmaprp_dump_regs()
284 readl(pcdev->base_emma + PRP_CNTL)); in emmaprp_dump_regs()
292 struct emmaprp_dev *pcdev = ctx->dev; in emmaprp_device_run() local
314 v4l2_err(&pcdev->v4l2_dev, in emmaprp_device_run()
320 writel(p_in, pcdev->base_emma + PRP_SOURCE_Y_PTR); in emmaprp_device_run()
322 pcdev->base_emma + PRP_SRC_FRAME_SIZE); in emmaprp_device_run()
325 writel(p_out, pcdev->base_emma + PRP_DEST_Y_PTR); in emmaprp_device_run()
326 writel(p_out + d_size, pcdev->base_emma + PRP_DEST_CB_PTR); in emmaprp_device_run()
328 pcdev->base_emma + PRP_DEST_CR_PTR); in emmaprp_device_run()
330 pcdev->base_emma + PRP_CH2_OUT_IMAGE_SIZE); in emmaprp_device_run()
333 tmp = readl(pcdev->base_emma + PRP_INTR_CNTL); in emmaprp_device_run()
337 pcdev->base_emma + PRP_INTR_CNTL); in emmaprp_device_run()
339 emmaprp_dump_regs(pcdev); in emmaprp_device_run()
342 tmp = readl(pcdev->base_emma + PRP_CNTL); in emmaprp_device_run()
346 pcdev->base_emma + PRP_CNTL); in emmaprp_device_run()
351 struct emmaprp_dev *pcdev = data; in emmaprp_irq() local
358 irqst = readl(pcdev->base_emma + PRP_INTRSTATUS); in emmaprp_irq()
359 writel(irqst, pcdev->base_emma + PRP_INTRSTATUS); in emmaprp_irq()
360 dprintk(pcdev, "irqst = 0x%08x\n", irqst); in emmaprp_irq()
362 curr_ctx = v4l2_m2m_get_curr_priv(pcdev->m2m_dev); in emmaprp_irq()
372 writel(PRP_CNTL_SWRST, pcdev->base_emma + PRP_CNTL); in emmaprp_irq()
385 spin_lock_irqsave(&pcdev->irqlock, flags); in emmaprp_irq()
388 spin_unlock_irqrestore(&pcdev->irqlock, flags); in emmaprp_irq()
392 v4l2_m2m_job_finish(pcdev->m2m_dev, curr_ctx->m2m_ctx); in emmaprp_irq()
788 struct emmaprp_dev *pcdev = video_drvdata(file); in emmaprp_open() local
796 ctx->dev = pcdev; in emmaprp_open()
798 if (mutex_lock_interruptible(&pcdev->dev_mutex)) { in emmaprp_open()
803 ctx->m2m_ctx = v4l2_m2m_ctx_init(pcdev->m2m_dev, ctx, &queue_init); in emmaprp_open()
808 mutex_unlock(&pcdev->dev_mutex); in emmaprp_open()
813 clk_prepare_enable(pcdev->clk_emma_ipg); in emmaprp_open()
814 clk_prepare_enable(pcdev->clk_emma_ahb); in emmaprp_open()
817 mutex_unlock(&pcdev->dev_mutex); in emmaprp_open()
819 dprintk(pcdev, "Created instance %p, m2m_ctx: %p\n", ctx, ctx->m2m_ctx); in emmaprp_open()
826 struct emmaprp_dev *pcdev = video_drvdata(file); in emmaprp_release() local
829 dprintk(pcdev, "Releasing instance %p\n", ctx); in emmaprp_release()
831 mutex_lock(&pcdev->dev_mutex); in emmaprp_release()
832 clk_disable_unprepare(pcdev->clk_emma_ahb); in emmaprp_release()
833 clk_disable_unprepare(pcdev->clk_emma_ipg); in emmaprp_release()
835 mutex_unlock(&pcdev->dev_mutex); in emmaprp_release()
844 struct emmaprp_dev *pcdev = video_drvdata(file); in emmaprp_poll() local
848 mutex_lock(&pcdev->dev_mutex); in emmaprp_poll()
850 mutex_unlock(&pcdev->dev_mutex); in emmaprp_poll()
856 struct emmaprp_dev *pcdev = video_drvdata(file); in emmaprp_mmap() local
860 if (mutex_lock_interruptible(&pcdev->dev_mutex)) in emmaprp_mmap()
863 mutex_unlock(&pcdev->dev_mutex); in emmaprp_mmap()
894 struct emmaprp_dev *pcdev; in emmaprp_probe() local
899 pcdev = devm_kzalloc(&pdev->dev, sizeof(*pcdev), GFP_KERNEL); in emmaprp_probe()
900 if (!pcdev) in emmaprp_probe()
903 spin_lock_init(&pcdev->irqlock); in emmaprp_probe()
905 pcdev->clk_emma_ipg = devm_clk_get(&pdev->dev, "ipg"); in emmaprp_probe()
906 if (IS_ERR(pcdev->clk_emma_ipg)) { in emmaprp_probe()
907 return PTR_ERR(pcdev->clk_emma_ipg); in emmaprp_probe()
910 pcdev->clk_emma_ahb = devm_clk_get(&pdev->dev, "ahb"); in emmaprp_probe()
911 if (IS_ERR(pcdev->clk_emma_ahb)) in emmaprp_probe()
912 return PTR_ERR(pcdev->clk_emma_ahb); in emmaprp_probe()
915 pcdev->base_emma = devm_ioremap_resource(&pdev->dev, res); in emmaprp_probe()
916 if (IS_ERR(pcdev->base_emma)) in emmaprp_probe()
917 return PTR_ERR(pcdev->base_emma); in emmaprp_probe()
919 ret = v4l2_device_register(&pdev->dev, &pcdev->v4l2_dev); in emmaprp_probe()
923 mutex_init(&pcdev->dev_mutex); in emmaprp_probe()
927 v4l2_err(&pcdev->v4l2_dev, "Failed to allocate video device\n"); in emmaprp_probe()
933 vfd->lock = &pcdev->dev_mutex; in emmaprp_probe()
934 vfd->v4l2_dev = &pcdev->v4l2_dev; in emmaprp_probe()
936 video_set_drvdata(vfd, pcdev); in emmaprp_probe()
938 pcdev->vfd = vfd; in emmaprp_probe()
939 v4l2_info(&pcdev->v4l2_dev, EMMAPRP_MODULE_NAME in emmaprp_probe()
942 platform_set_drvdata(pdev, pcdev); in emmaprp_probe()
946 dev_name(&pdev->dev), pcdev); in emmaprp_probe()
950 pcdev->m2m_dev = v4l2_m2m_init(&m2m_ops); in emmaprp_probe()
951 if (IS_ERR(pcdev->m2m_dev)) { in emmaprp_probe()
952 v4l2_err(&pcdev->v4l2_dev, "Failed to init mem2mem device\n"); in emmaprp_probe()
953 ret = PTR_ERR(pcdev->m2m_dev); in emmaprp_probe()
959 v4l2_err(&pcdev->v4l2_dev, "Failed to register video device\n"); in emmaprp_probe()
967 v4l2_m2m_release(pcdev->m2m_dev); in emmaprp_probe()
971 v4l2_device_unregister(&pcdev->v4l2_dev); in emmaprp_probe()
973 mutex_destroy(&pcdev->dev_mutex); in emmaprp_probe()
980 struct emmaprp_dev *pcdev = platform_get_drvdata(pdev); in emmaprp_remove() local
982 v4l2_info(&pcdev->v4l2_dev, "Removing " EMMAPRP_MODULE_NAME); in emmaprp_remove()
984 video_unregister_device(pcdev->vfd); in emmaprp_remove()
985 v4l2_m2m_release(pcdev->m2m_dev); in emmaprp_remove()
986 v4l2_device_unregister(&pcdev->v4l2_dev); in emmaprp_remove()
987 mutex_destroy(&pcdev->dev_mutex); in emmaprp_remove()