Lines Matching refs:delta

63 	struct delta_dev *delta = ctx->dev;  in dump_au()  local
68 dev_dbg(delta->dev, "%s dump au[%d] dts=%lld size=%d data=%*ph\n", in dump_au()
72 dev_dbg(delta->dev, "%s dump au[%d] dts=%lld size=%d data=%*ph..%*ph\n", in dump_au()
79 struct delta_dev *delta = ctx->dev; in dump_frame() local
83 dev_dbg(delta->dev, "%s dump frame[%d] dts=%lld type=%s field=%s data=%*ph\n", in dump_frame()
179 struct delta_dev *delta = ctx->dev; in delta_pop_dts() local
187 dev_warn(delta->dev, "%s no dts to pop ... output dts = 0\n", in delta_pop_dts()
282 struct delta_dev *delta = ctx->dev; in delta_find_decoder() local
286 for (i = 0; i < delta->nb_of_decoders; i++) { in delta_find_decoder()
287 dec = delta->decoders[i]; in delta_find_decoder()
308 static void register_formats(struct delta_dev *delta) in register_formats() argument
312 for (i = 0; i < delta->nb_of_decoders; i++) { in register_formats()
313 register_format(delta->decoders[i]->pixelformat, in register_formats()
314 delta->pixelformats, in register_formats()
315 &delta->nb_of_pixelformats); in register_formats()
317 register_format(delta->decoders[i]->streamformat, in register_formats()
318 delta->streamformats, in register_formats()
319 &delta->nb_of_streamformats); in register_formats()
323 static void register_decoders(struct delta_dev *delta) in register_decoders() argument
328 if (delta->nb_of_decoders >= DELTA_MAX_DECODERS) { in register_decoders()
329 dev_dbg(delta->dev, in register_decoders()
336 delta->decoders[delta->nb_of_decoders++] = delta_decoders[i]; in register_decoders()
337 dev_info(delta->dev, "%s %s decoder registered\n", in register_decoders()
345 struct delta_dev *delta = ctx->dev; in delta_open_decoder() local
351 dev_err(delta->dev, "%s no decoder found matching %4.4s => %4.4s\n", in delta_open_decoder()
356 dev_dbg(delta->dev, "%s one decoder matching %4.4s => %4.4s\n", in delta_open_decoder()
361 delta->instance_id, (char *)&streamformat); in delta_open_decoder()
366 dev_err(delta->dev, "%s failed to open decoder instance (%d)\n", in delta_open_decoder()
371 dev_dbg(delta->dev, "%s %s decoder opened\n", ctx->name, dec->name); in delta_open_decoder()
386 struct delta_dev *delta = ctx->dev; in delta_querycap() local
389 strscpy(cap->card, delta->vdev->name, sizeof(cap->card)); in delta_querycap()
391 delta->pdev->name); in delta_querycap()
400 struct delta_dev *delta = ctx->dev; in delta_enum_fmt_stream() local
402 if (unlikely(f->index >= delta->nb_of_streamformats)) in delta_enum_fmt_stream()
405 f->pixelformat = delta->streamformats[f->index]; in delta_enum_fmt_stream()
414 struct delta_dev *delta = ctx->dev; in delta_enum_fmt_frame() local
416 if (unlikely(f->index >= delta->nb_of_pixelformats)) in delta_enum_fmt_frame()
419 f->pixelformat = delta->pixelformats[f->index]; in delta_enum_fmt_frame()
428 struct delta_dev *delta = ctx->dev; in delta_g_fmt_stream() local
434 dev_dbg(delta->dev, in delta_g_fmt_stream()
456 struct delta_dev *delta = ctx->dev; in delta_g_fmt_frame() local
463 dev_dbg(delta->dev, in delta_g_fmt_frame()
495 struct delta_dev *delta = ctx->dev; in delta_try_fmt_stream() local
504 dev_dbg(delta->dev, in delta_try_fmt_stream()
524 dev_dbg(delta->dev, in delta_try_fmt_stream()
531 dev_dbg(delta->dev, in delta_try_fmt_stream()
549 struct delta_dev *delta = ctx->dev; in delta_try_fmt_frame() local
558 dev_dbg(delta->dev, in delta_try_fmt_frame()
575 dev_dbg(delta->dev, in delta_try_fmt_frame()
583 dev_dbg(delta->dev, in delta_try_fmt_frame()
609 struct delta_dev *delta = ctx->dev; in delta_s_fmt_stream() local
616 dev_dbg(delta->dev, in delta_s_fmt_stream()
624 dev_dbg(delta->dev, "%s V4L2 S_FMT (OUTPUT): queue busy\n", in delta_s_fmt_stream()
645 struct delta_dev *delta = ctx->dev; in delta_s_fmt_frame() local
655 dev_dbg(delta->dev, "%s V4L2 S_FMT (CAPTURE): queue busy\n", in delta_s_fmt_frame()
669 dev_dbg(delta->dev, in delta_s_fmt_frame()
702 dev_dbg(delta->dev, in delta_s_fmt_frame()
766 struct delta_dev *delta = ctx->dev; in delta_complete_eos() local
787 dev_dbg(delta->dev, "%s EOS completed\n", ctx->name); in delta_complete_eos()
809 struct delta_dev *delta = ctx->dev; in delta_decoder_stop_cmd() local
813 dev_dbg(delta->dev, "%s EOS received\n", ctx->name); in delta_decoder_stop_cmd()
830 dev_dbg(delta->dev, "%s drain frame[%d]\n", in delta_decoder_stop_cmd()
861 dev_dbg(delta->dev, "%s EOS delayed\n", ctx->name); in delta_decoder_stop_cmd()
925 struct delta_dev *delta = ctx->dev; in delta_run_work() local
934 dev_err(delta->dev, "%s no decoder opened yet\n", ctx->name); in delta_run_work()
943 dev_err(delta->dev, "%s no buffer to decode\n", ctx->name); in delta_run_work()
976 dev_err(delta->dev, "%s decoding failed (%d)\n", in delta_run_work()
1002 dev_err(delta->dev, "%s cannot get decoded frame (%d)\n", in delta_run_work()
1007 dev_err(delta->dev, in delta_run_work()
1024 v4l2_m2m_job_finish(delta->m2m_dev, ctx->fh.m2m_ctx); in delta_run_work()
1031 v4l2_m2m_job_finish(delta->m2m_dev, ctx->fh.m2m_ctx); in delta_run_work()
1037 struct delta_dev *delta = ctx->dev; in delta_device_run() local
1039 queue_work(delta->work_queue, &ctx->run_work); in delta_device_run()
1045 struct delta_dev *delta = ctx->dev; in delta_job_abort() local
1047 dev_dbg(delta->dev, "%s aborting job\n", ctx->name); in delta_job_abort()
1055 struct delta_dev *delta = ctx->dev; in delta_job_ready() local
1059 dev_dbg(delta->dev, "%s not ready: not enough video buffers.\n", in delta_job_ready()
1065 dev_dbg(delta->dev, "%s not ready: not enough video capture buffers.\n", in delta_job_ready()
1071 dev_dbg(delta->dev, "%s job not ready: aborting\n", ctx->name); in delta_job_ready()
1075 dev_dbg(delta->dev, "%s job ready\n", ctx->name); in delta_job_ready()
1118 struct delta_dev *delta = ctx->dev; in delta_vb2_au_prepare() local
1128 dev_dbg(delta->dev, "%s au[%d] prepared; virt=0x%p, phy=0x%pad\n", in delta_vb2_au_prepare()
1141 struct delta_dev *delta = ctx->dev; in delta_setup_frame() local
1145 dev_err(delta->dev, in delta_setup_frame()
1152 dev_err(delta->dev, in delta_setup_frame()
1159 dev_warn(delta->dev, in delta_setup_frame()
1220 struct delta_dev *delta = ctx->dev; in dump_frames_status() local
1225 dev_info(delta->dev, in dump_frames_status()
1230 dev_info(delta->dev, in dump_frames_status()
1241 struct delta_dev *delta = ctx->dev; in delta_get_free_frame() local
1249 dev_err(delta->dev, "%s no frame available", in delta_get_free_frame()
1257 dev_err(delta->dev, in delta_get_free_frame()
1264 dev_dbg(delta->dev, in delta_get_free_frame()
1273 struct delta_dev *delta = ctx->dev; in delta_get_sync() local
1277 ret = pm_runtime_resume_and_get(delta->dev); in delta_get_sync()
1279 dev_err(delta->dev, "%s pm_runtime_resume_and_get failed (%d)\n", in delta_get_sync()
1289 struct delta_dev *delta = ctx->dev; in delta_put_autosuspend() local
1291 pm_runtime_put_autosuspend(delta->dev); in delta_put_autosuspend()
1307 struct delta_dev *delta = ctx->dev; in delta_vb2_au_start_streaming() local
1339 dev_err(delta->dev, "%s failed to start streaming, no stream header buffer enqueued\n", in delta_vb2_au_start_streaming()
1356 dev_err(delta->dev, "%s failed to start streaming, header decoding failed (%d)\n", in delta_vb2_au_start_streaming()
1363 dev_dbg_ratelimited(delta->dev, in delta_vb2_au_start_streaming()
1377 dev_dbg(delta->dev, "%s %s => %s\n", ctx->name, in delta_vb2_au_start_streaming()
1420 struct delta_dev *delta = ctx->dev; in delta_vb2_frame_queue_setup() local
1432 dev_dbg(delta->dev, in delta_vb2_frame_queue_setup()
1441 dev_dbg(delta->dev, in delta_vb2_frame_queue_setup()
1464 struct delta_dev *delta = ctx->dev; in delta_vb2_frame_prepare() local
1477 dev_err(delta->dev, in delta_vb2_frame_prepare()
1483 dev_dbg(delta->dev, in delta_vb2_frame_prepare()
1587 struct delta_dev *delta = ctx->dev; in queue_init() local
1600 q->lock = &delta->lock; in queue_init()
1601 q->dev = delta->dev; in queue_init()
1618 q->lock = &delta->lock; in queue_init()
1619 q->dev = delta->dev; in queue_init()
1626 struct delta_dev *delta = video_drvdata(file); in delta_open() local
1630 mutex_lock(&delta->lock); in delta_open()
1637 ctx->dev = delta; in delta_open()
1646 ctx->fh.m2m_ctx = v4l2_m2m_ctx_init(delta->m2m_dev, ctx, in delta_open()
1650 dev_err(delta->dev, "%s failed to initialize m2m context (%d)\n", in delta_open()
1664 delta->instance_id++; in delta_open()
1666 delta->instance_id); in delta_open()
1672 if (delta->clk_st231) in delta_open()
1673 if (clk_prepare_enable(delta->clk_st231)) in delta_open()
1674 dev_warn(delta->dev, "failed to enable st231 clk\n"); in delta_open()
1677 if (delta->clk_flash_promip) in delta_open()
1678 if (clk_prepare_enable(delta->clk_flash_promip)) in delta_open()
1679 dev_warn(delta->dev, "failed to enable delta promip clk\n"); in delta_open()
1681 mutex_unlock(&delta->lock); in delta_open()
1683 dev_dbg(delta->dev, "%s decoder instance created\n", ctx->name); in delta_open()
1692 mutex_unlock(&delta->lock); in delta_open()
1700 struct delta_dev *delta = ctx->dev; in delta_release() local
1703 mutex_lock(&delta->lock); in delta_release()
1720 if (delta->clk_st231) in delta_release()
1721 clk_disable_unprepare(delta->clk_st231); in delta_release()
1724 if (delta->clk_flash_promip) in delta_release()
1725 clk_disable_unprepare(delta->clk_flash_promip); in delta_release()
1727 dev_dbg(delta->dev, "%s decoder instance released\n", ctx->name); in delta_release()
1731 mutex_unlock(&delta->lock); in delta_release()
1749 static int delta_register_device(struct delta_dev *delta) in delta_register_device() argument
1754 if (!delta) in delta_register_device()
1757 delta->m2m_dev = v4l2_m2m_init(&delta_m2m_ops); in delta_register_device()
1758 if (IS_ERR(delta->m2m_dev)) { in delta_register_device()
1759 dev_err(delta->dev, "%s failed to initialize v4l2-m2m device\n", in delta_register_device()
1761 ret = PTR_ERR(delta->m2m_dev); in delta_register_device()
1767 dev_err(delta->dev, "%s failed to allocate video device\n", in delta_register_device()
1776 vdev->lock = &delta->lock; in delta_register_device()
1779 vdev->v4l2_dev = &delta->v4l2_dev; in delta_register_device()
1785 dev_err(delta->dev, "%s failed to register video device\n", in delta_register_device()
1790 delta->vdev = vdev; in delta_register_device()
1791 video_set_drvdata(vdev, delta); in delta_register_device()
1797 v4l2_m2m_release(delta->m2m_dev); in delta_register_device()
1802 static void delta_unregister_device(struct delta_dev *delta) in delta_unregister_device() argument
1804 if (!delta) in delta_unregister_device()
1807 if (delta->m2m_dev) in delta_unregister_device()
1808 v4l2_m2m_release(delta->m2m_dev); in delta_unregister_device()
1810 video_unregister_device(delta->vdev); in delta_unregister_device()
1815 struct delta_dev *delta; in delta_probe() local
1819 delta = devm_kzalloc(dev, sizeof(*delta), GFP_KERNEL); in delta_probe()
1820 if (!delta) { in delta_probe()
1825 delta->dev = dev; in delta_probe()
1826 delta->pdev = pdev; in delta_probe()
1827 platform_set_drvdata(pdev, delta); in delta_probe()
1829 mutex_init(&delta->lock); in delta_probe()
1832 delta->clk_delta = devm_clk_get(dev, "delta"); in delta_probe()
1833 if (IS_ERR(delta->clk_delta)) { in delta_probe()
1835 delta->clk_delta = NULL; in delta_probe()
1838 delta->clk_st231 = devm_clk_get(dev, "delta-st231"); in delta_probe()
1839 if (IS_ERR(delta->clk_st231)) { in delta_probe()
1841 delta->clk_st231 = NULL; in delta_probe()
1844 delta->clk_flash_promip = devm_clk_get(dev, "delta-flash-promip"); in delta_probe()
1845 if (IS_ERR(delta->clk_flash_promip)) { in delta_probe()
1848 delta->clk_flash_promip = NULL; in delta_probe()
1858 ret = delta_ipc_init(delta); in delta_probe()
1860 dev_err(delta->dev, "%s failed to initialize firmware ipc channel\n", in delta_probe()
1866 register_decoders(delta); in delta_probe()
1869 register_formats(delta); in delta_probe()
1872 ret = v4l2_device_register(dev, &delta->v4l2_dev); in delta_probe()
1874 dev_err(delta->dev, "%s failed to register V4L2 device\n", in delta_probe()
1879 delta->work_queue = create_workqueue(DELTA_NAME); in delta_probe()
1880 if (!delta->work_queue) { in delta_probe()
1881 dev_err(delta->dev, "%s failed to allocate work queue\n", in delta_probe()
1888 ret = delta_register_device(delta); in delta_probe()
1893 DELTA_PREFIX, delta->vdev->name, delta->vdev->num); in delta_probe()
1898 destroy_workqueue(delta->work_queue); in delta_probe()
1900 v4l2_device_unregister(&delta->v4l2_dev); in delta_probe()
1909 struct delta_dev *delta = platform_get_drvdata(pdev); in delta_remove() local
1911 delta_ipc_exit(delta); in delta_remove()
1913 delta_unregister_device(delta); in delta_remove()
1915 destroy_workqueue(delta->work_queue); in delta_remove()
1917 pm_runtime_put_autosuspend(delta->dev); in delta_remove()
1918 pm_runtime_disable(delta->dev); in delta_remove()
1920 v4l2_device_unregister(&delta->v4l2_dev); in delta_remove()
1927 struct delta_dev *delta = dev_get_drvdata(dev); in delta_runtime_suspend() local
1929 if (delta->clk_delta) in delta_runtime_suspend()
1930 clk_disable_unprepare(delta->clk_delta); in delta_runtime_suspend()
1937 struct delta_dev *delta = dev_get_drvdata(dev); in delta_runtime_resume() local
1939 if (delta->clk_delta) in delta_runtime_resume()
1940 if (clk_prepare_enable(delta->clk_delta)) in delta_runtime_resume()