Lines Matching refs:dev

49 	struct s5p_mfc_dev *dev = ctx->dev;  in clear_work_bit()  local
51 spin_lock(&dev->condlock); in clear_work_bit()
52 __clear_bit(ctx->num, &dev->ctx_work_bits); in clear_work_bit()
53 spin_unlock(&dev->condlock); in clear_work_bit()
59 struct s5p_mfc_dev *dev = ctx->dev; in set_work_bit() local
61 spin_lock(&dev->condlock); in set_work_bit()
62 __set_bit(ctx->num, &dev->ctx_work_bits); in set_work_bit()
63 spin_unlock(&dev->condlock); in set_work_bit()
69 struct s5p_mfc_dev *dev = ctx->dev; in clear_work_bit_irqsave() local
72 spin_lock_irqsave(&dev->condlock, flags); in clear_work_bit_irqsave()
73 __clear_bit(ctx->num, &dev->ctx_work_bits); in clear_work_bit_irqsave()
74 spin_unlock_irqrestore(&dev->condlock, flags); in clear_work_bit_irqsave()
80 struct s5p_mfc_dev *dev = ctx->dev; in set_work_bit_irqsave() local
83 spin_lock_irqsave(&dev->condlock, flags); in set_work_bit_irqsave()
84 __set_bit(ctx->num, &dev->ctx_work_bits); in set_work_bit_irqsave()
85 spin_unlock_irqrestore(&dev->condlock, flags); in set_work_bit_irqsave()
99 static void wake_up_dev(struct s5p_mfc_dev *dev, unsigned int reason, in wake_up_dev() argument
102 dev->int_cond = 1; in wake_up_dev()
103 dev->int_type = reason; in wake_up_dev()
104 dev->int_err = err; in wake_up_dev()
105 wake_up(&dev->queue); in wake_up_dev()
110 struct s5p_mfc_dev *dev = (struct s5p_mfc_dev *)arg; in s5p_mfc_watchdog() local
112 if (test_bit(0, &dev->hw_lock)) in s5p_mfc_watchdog()
113 atomic_inc(&dev->watchdog_cnt); in s5p_mfc_watchdog()
114 if (atomic_read(&dev->watchdog_cnt) >= MFC_WATCHDOG_CNT) { in s5p_mfc_watchdog()
121 queue_work(dev->watchdog_workqueue, &dev->watchdog_work); in s5p_mfc_watchdog()
123 dev->watchdog_timer.expires = jiffies + in s5p_mfc_watchdog()
125 add_timer(&dev->watchdog_timer); in s5p_mfc_watchdog()
130 struct s5p_mfc_dev *dev; in s5p_mfc_watchdog_worker() local
136 dev = container_of(work, struct s5p_mfc_dev, watchdog_work); in s5p_mfc_watchdog_worker()
141 mutex_locked = mutex_trylock(&dev->mfc_mutex); in s5p_mfc_watchdog_worker()
144 spin_lock_irqsave(&dev->irqlock, flags); in s5p_mfc_watchdog_worker()
149 ctx = dev->ctx[i]; in s5p_mfc_watchdog_worker()
153 s5p_mfc_hw_call_void(dev->mfc_ops, cleanup_queue, in s5p_mfc_watchdog_worker()
155 s5p_mfc_hw_call_void(dev->mfc_ops, cleanup_queue, in s5p_mfc_watchdog_worker()
160 clear_bit(0, &dev->hw_lock); in s5p_mfc_watchdog_worker()
161 spin_unlock_irqrestore(&dev->irqlock, flags); in s5p_mfc_watchdog_worker()
164 s5p_mfc_deinit_hw(dev); in s5p_mfc_watchdog_worker()
168 if (dev->num_inst > 0) { in s5p_mfc_watchdog_worker()
169 ret = s5p_mfc_load_firmware(dev); in s5p_mfc_watchdog_worker()
175 ret = s5p_mfc_init_hw(dev); in s5p_mfc_watchdog_worker()
181 mutex_unlock(&dev->mfc_mutex); in s5p_mfc_watchdog_worker()
184 static void s5p_mfc_clear_int_flags(struct s5p_mfc_dev *dev) in s5p_mfc_clear_int_flags() argument
186 mfc_write(dev, 0, S5P_FIMV_RISC_HOST_INT); in s5p_mfc_clear_int_flags()
187 mfc_write(dev, 0, S5P_FIMV_RISC2HOST_CMD); in s5p_mfc_clear_int_flags()
188 mfc_write(dev, 0xffff, S5P_FIMV_SI_RTN_CHID); in s5p_mfc_clear_int_flags()
194 struct s5p_mfc_dev *dev = ctx->dev; in s5p_mfc_handle_frame_all_extracted() local
209 if (s5p_mfc_hw_call(dev->mfc_ops, get_pic_type_top, ctx) == in s5p_mfc_handle_frame_all_extracted()
210 s5p_mfc_hw_call(dev->mfc_ops, get_pic_type_bot, ctx)) in s5p_mfc_handle_frame_all_extracted()
222 struct s5p_mfc_dev *dev = ctx->dev; in s5p_mfc_handle_frame_copy_time() local
228 frame_type = s5p_mfc_hw_call(dev->mfc_ops, get_dec_frame_type, dev); in s5p_mfc_handle_frame_copy_time()
231 dec_y_addr = s5p_mfc_hw_call(dev->mfc_ops, get_dec_y_adr, dev); in s5p_mfc_handle_frame_copy_time()
273 struct s5p_mfc_dev *dev = ctx->dev; in s5p_mfc_handle_frame_new() local
278 dspl_y_addr = s5p_mfc_hw_call(dev->mfc_ops, get_dspl_y_adr, dev); in s5p_mfc_handle_frame_new()
279 if (IS_MFCV6_PLUS(dev)) in s5p_mfc_handle_frame_new()
280 frame_type = s5p_mfc_hw_call(dev->mfc_ops, in s5p_mfc_handle_frame_new()
283 frame_type = s5p_mfc_hw_call(dev->mfc_ops, in s5p_mfc_handle_frame_new()
284 get_dec_frame_type, dev); in s5p_mfc_handle_frame_new()
302 if (s5p_mfc_hw_call(dev->mfc_ops, in s5p_mfc_handle_frame_new()
304 s5p_mfc_hw_call(dev->mfc_ops, in s5p_mfc_handle_frame_new()
327 struct s5p_mfc_dev *dev = ctx->dev; in s5p_mfc_handle_frame() local
334 dst_frame_status = s5p_mfc_hw_call(dev->mfc_ops, get_dspl_status, dev) in s5p_mfc_handle_frame()
336 dec_frame_status = s5p_mfc_hw_call(dev->mfc_ops, get_dec_status, dev) in s5p_mfc_handle_frame()
338 res_change = (s5p_mfc_hw_call(dev->mfc_ops, get_dspl_status, dev) in s5p_mfc_handle_frame()
347 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev); in s5p_mfc_handle_frame()
349 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0); in s5p_mfc_handle_frame()
351 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev); in s5p_mfc_handle_frame()
357 spin_lock_irqsave(&dev->irqlock, flags); in s5p_mfc_handle_frame()
392 ctx->consumed_stream += s5p_mfc_hw_call(dev->mfc_ops, in s5p_mfc_handle_frame()
393 get_consumed_stream, dev); in s5p_mfc_handle_frame()
408 if (s5p_mfc_hw_call(dev->mfc_ops, err_dec, err) > 0) in s5p_mfc_handle_frame()
415 spin_unlock_irqrestore(&dev->irqlock, flags); in s5p_mfc_handle_frame()
419 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev); in s5p_mfc_handle_frame()
421 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0); in s5p_mfc_handle_frame()
424 if (test_bit(0, &dev->enter_suspend)) in s5p_mfc_handle_frame()
425 wake_up_dev(dev, reason, err); in s5p_mfc_handle_frame()
427 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev); in s5p_mfc_handle_frame()
431 static void s5p_mfc_handle_error(struct s5p_mfc_dev *dev, in s5p_mfc_handle_error() argument
452 spin_lock_irqsave(&dev->irqlock, flags); in s5p_mfc_handle_error()
453 s5p_mfc_hw_call_void(dev->mfc_ops, cleanup_queue, in s5p_mfc_handle_error()
456 s5p_mfc_hw_call_void(dev->mfc_ops, cleanup_queue, in s5p_mfc_handle_error()
458 spin_unlock_irqrestore(&dev->irqlock, flags); in s5p_mfc_handle_error()
468 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0); in s5p_mfc_handle_error()
469 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev); in s5p_mfc_handle_error()
471 wake_up_dev(dev, reason, err); in s5p_mfc_handle_error()
479 struct s5p_mfc_dev *dev; in s5p_mfc_handle_seq_done() local
483 dev = ctx->dev; in s5p_mfc_handle_seq_done()
488 ctx->img_width = s5p_mfc_hw_call(dev->mfc_ops, get_img_width, in s5p_mfc_handle_seq_done()
489 dev); in s5p_mfc_handle_seq_done()
490 ctx->img_height = s5p_mfc_hw_call(dev->mfc_ops, get_img_height, in s5p_mfc_handle_seq_done()
491 dev); in s5p_mfc_handle_seq_done()
493 s5p_mfc_hw_call_void(dev->mfc_ops, dec_calc_dpb_size, ctx); in s5p_mfc_handle_seq_done()
495 ctx->pb_count = s5p_mfc_hw_call(dev->mfc_ops, get_dpb_count, in s5p_mfc_handle_seq_done()
496 dev); in s5p_mfc_handle_seq_done()
497 ctx->mv_count = s5p_mfc_hw_call(dev->mfc_ops, get_mv_count, in s5p_mfc_handle_seq_done()
498 dev); in s5p_mfc_handle_seq_done()
510 if (s5p_mfc_hw_call(dev->mfc_ops, get_consumed_stream, in s5p_mfc_handle_seq_done()
511 dev) < in s5p_mfc_handle_seq_done()
520 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev); in s5p_mfc_handle_seq_done()
522 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0); in s5p_mfc_handle_seq_done()
524 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev); in s5p_mfc_handle_seq_done()
533 struct s5p_mfc_dev *dev; in s5p_mfc_handle_init_buffers() local
538 dev = ctx->dev; in s5p_mfc_handle_init_buffers()
539 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev); in s5p_mfc_handle_init_buffers()
547 spin_lock_irqsave(&dev->irqlock, flags); in s5p_mfc_handle_init_buffers()
556 spin_unlock_irqrestore(&dev->irqlock, flags); in s5p_mfc_handle_init_buffers()
560 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0); in s5p_mfc_handle_init_buffers()
565 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev); in s5p_mfc_handle_init_buffers()
567 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0); in s5p_mfc_handle_init_buffers()
578 struct s5p_mfc_dev *dev = ctx->dev; in s5p_mfc_handle_stream_complete() local
583 s5p_mfc_clear_int_flags(dev); in s5p_mfc_handle_stream_complete()
588 spin_lock(&dev->irqlock); in s5p_mfc_handle_stream_complete()
597 spin_unlock(&dev->irqlock); in s5p_mfc_handle_stream_complete()
601 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0); in s5p_mfc_handle_stream_complete()
605 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev); in s5p_mfc_handle_stream_complete()
611 struct s5p_mfc_dev *dev = priv; in s5p_mfc_irq() local
618 atomic_set(&dev->watchdog_cnt, 0); in s5p_mfc_irq()
619 ctx = dev->ctx[dev->curr_ctx]; in s5p_mfc_irq()
621 reason = s5p_mfc_hw_call(dev->mfc_ops, get_int_reason, dev); in s5p_mfc_irq()
622 err = s5p_mfc_hw_call(dev->mfc_ops, get_int_err, dev); in s5p_mfc_irq()
628 s5p_mfc_hw_call(dev->mfc_ops, err_dec, err) >= in s5p_mfc_irq()
629 dev->warn_start) in s5p_mfc_irq()
632 s5p_mfc_handle_error(dev, ctx, reason, err); in s5p_mfc_irq()
633 clear_bit(0, &dev->enter_suspend); in s5p_mfc_irq()
642 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev); in s5p_mfc_irq()
644 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0); in s5p_mfc_irq()
646 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev); in s5p_mfc_irq()
657 ctx->inst_no = s5p_mfc_hw_call(dev->mfc_ops, get_inst_no, dev); in s5p_mfc_irq()
676 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev); in s5p_mfc_irq()
677 wake_up_dev(dev, reason, err); in s5p_mfc_irq()
678 clear_bit(0, &dev->hw_lock); in s5p_mfc_irq()
679 clear_bit(0, &dev->enter_suspend); in s5p_mfc_irq()
698 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev); in s5p_mfc_irq()
703 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev); in s5p_mfc_irq()
707 if (test_and_clear_bit(0, &dev->hw_lock) == 0) in s5p_mfc_irq()
712 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev); in s5p_mfc_irq()
721 struct s5p_mfc_dev *dev = video_drvdata(file); in s5p_mfc_open() local
727 if (mutex_lock_interruptible(&dev->mfc_mutex)) in s5p_mfc_open()
729 dev->num_inst++; /* It is guarded by mfc_mutex in vfd */ in s5p_mfc_open()
740 ctx->dev = dev; in s5p_mfc_open()
747 while (dev->ctx[ctx->num]) { in s5p_mfc_open()
757 dev->ctx[ctx->num] = ctx; in s5p_mfc_open()
758 if (vdev == dev->vfd_dec) { in s5p_mfc_open()
768 } else if (vdev == dev->vfd_enc) { in s5p_mfc_open()
788 if (dev->num_inst == 1) { in s5p_mfc_open()
789 dev->watchdog_timer.expires = jiffies + in s5p_mfc_open()
791 add_timer(&dev->watchdog_timer); in s5p_mfc_open()
798 ret = s5p_mfc_load_firmware(dev); in s5p_mfc_open()
804 ret = s5p_mfc_init_hw(dev); in s5p_mfc_open()
813 q->lock = &dev->mfc_mutex; in s5p_mfc_open()
814 if (vdev == dev->vfd_dec) { in s5p_mfc_open()
817 } else if (vdev == dev->vfd_enc) { in s5p_mfc_open()
836 q->lock = &dev->mfc_mutex; in s5p_mfc_open()
837 if (vdev == dev->vfd_dec) { in s5p_mfc_open()
840 } else if (vdev == dev->vfd_enc) { in s5p_mfc_open()
862 mutex_unlock(&dev->mfc_mutex); in s5p_mfc_open()
867 if (dev->num_inst == 1) in s5p_mfc_open()
868 s5p_mfc_deinit_hw(dev); in s5p_mfc_open()
872 if (dev->num_inst == 1) { in s5p_mfc_open()
875 del_timer_sync(&dev->watchdog_timer); in s5p_mfc_open()
880 dev->ctx[ctx->num] = NULL; in s5p_mfc_open()
886 dev->num_inst--; in s5p_mfc_open()
887 mutex_unlock(&dev->mfc_mutex); in s5p_mfc_open()
896 struct s5p_mfc_dev *dev = ctx->dev; in s5p_mfc_release() local
899 mutex_lock(&dev->mfc_mutex); in s5p_mfc_release()
909 s5p_mfc_close_mfc_inst(dev, ctx); in s5p_mfc_release()
912 if (dev->curr_ctx == ctx->num) in s5p_mfc_release()
913 clear_bit(0, &dev->hw_lock); in s5p_mfc_release()
914 dev->num_inst--; in s5p_mfc_release()
915 if (dev->num_inst == 0) { in s5p_mfc_release()
917 s5p_mfc_deinit_hw(dev); in s5p_mfc_release()
918 del_timer_sync(&dev->watchdog_timer); in s5p_mfc_release()
924 dev->ctx[ctx->num] = NULL; in s5p_mfc_release()
930 mutex_unlock(&dev->mfc_mutex); in s5p_mfc_release()
939 struct s5p_mfc_dev *dev = ctx->dev; in s5p_mfc_poll() local
945 mutex_lock(&dev->mfc_mutex); in s5p_mfc_poll()
958 mutex_unlock(&dev->mfc_mutex); in s5p_mfc_poll()
962 mutex_lock(&dev->mfc_mutex); in s5p_mfc_poll()
982 mutex_unlock(&dev->mfc_mutex); in s5p_mfc_poll()
990 struct s5p_mfc_dev *dev = ctx->dev; in s5p_mfc_mmap() local
994 if (mutex_lock_interruptible(&dev->mfc_mutex)) in s5p_mfc_mmap()
1004 mutex_unlock(&dev->mfc_mutex); in s5p_mfc_mmap()
1018 static int match_child(struct device *dev, void *data) in match_child() argument
1020 if (!dev_name(dev)) in match_child()
1022 return !strcmp(dev_name(dev), (char *)data); in match_child()
1027 static int s5p_mfc_alloc_memdevs(struct s5p_mfc_dev *dev) in s5p_mfc_alloc_memdevs() argument
1031 dev->mem_dev_l = devm_kzalloc(&dev->plat_dev->dev, in s5p_mfc_alloc_memdevs()
1033 if (!dev->mem_dev_l) { in s5p_mfc_alloc_memdevs()
1037 device_initialize(dev->mem_dev_l); in s5p_mfc_alloc_memdevs()
1038 of_property_read_u32_array(dev->plat_dev->dev.of_node, in s5p_mfc_alloc_memdevs()
1040 if (dma_declare_coherent_memory(dev->mem_dev_l, mem_info[0], in s5p_mfc_alloc_memdevs()
1048 dev->mem_dev_r = devm_kzalloc(&dev->plat_dev->dev, in s5p_mfc_alloc_memdevs()
1050 if (!dev->mem_dev_r) { in s5p_mfc_alloc_memdevs()
1054 device_initialize(dev->mem_dev_r); in s5p_mfc_alloc_memdevs()
1055 of_property_read_u32_array(dev->plat_dev->dev.of_node, in s5p_mfc_alloc_memdevs()
1057 if (dma_declare_coherent_memory(dev->mem_dev_r, mem_info[0], in s5p_mfc_alloc_memdevs()
1070 struct s5p_mfc_dev *dev; in s5p_mfc_probe() local
1076 dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL); in s5p_mfc_probe()
1077 if (!dev) { in s5p_mfc_probe()
1078 dev_err(&pdev->dev, "Not enough memory for MFC device\n"); in s5p_mfc_probe()
1082 spin_lock_init(&dev->irqlock); in s5p_mfc_probe()
1083 spin_lock_init(&dev->condlock); in s5p_mfc_probe()
1084 dev->plat_dev = pdev; in s5p_mfc_probe()
1085 if (!dev->plat_dev) { in s5p_mfc_probe()
1086 dev_err(&pdev->dev, "No platform data specified\n"); in s5p_mfc_probe()
1090 dev->variant = mfc_get_drv_data(pdev); in s5p_mfc_probe()
1092 ret = s5p_mfc_init_pm(dev); in s5p_mfc_probe()
1094 dev_err(&pdev->dev, "failed to get mfc clock source\n"); in s5p_mfc_probe()
1100 dev->regs_base = devm_ioremap_resource(&pdev->dev, res); in s5p_mfc_probe()
1101 if (IS_ERR(dev->regs_base)) in s5p_mfc_probe()
1102 return PTR_ERR(dev->regs_base); in s5p_mfc_probe()
1106 dev_err(&pdev->dev, "failed to get irq resource\n"); in s5p_mfc_probe()
1110 dev->irq = res->start; in s5p_mfc_probe()
1111 ret = devm_request_irq(&pdev->dev, dev->irq, s5p_mfc_irq, in s5p_mfc_probe()
1112 0, pdev->name, dev); in s5p_mfc_probe()
1114 dev_err(&pdev->dev, "Failed to install irq (%d)\n", ret); in s5p_mfc_probe()
1118 if (pdev->dev.of_node) { in s5p_mfc_probe()
1119 ret = s5p_mfc_alloc_memdevs(dev); in s5p_mfc_probe()
1123 dev->mem_dev_l = device_find_child(&dev->plat_dev->dev, in s5p_mfc_probe()
1125 if (!dev->mem_dev_l) { in s5p_mfc_probe()
1130 dev->mem_dev_r = device_find_child(&dev->plat_dev->dev, in s5p_mfc_probe()
1132 if (!dev->mem_dev_r) { in s5p_mfc_probe()
1139 dev->alloc_ctx[0] = vb2_dma_contig_init_ctx(dev->mem_dev_l); in s5p_mfc_probe()
1140 if (IS_ERR(dev->alloc_ctx[0])) { in s5p_mfc_probe()
1141 ret = PTR_ERR(dev->alloc_ctx[0]); in s5p_mfc_probe()
1144 dev->alloc_ctx[1] = vb2_dma_contig_init_ctx(dev->mem_dev_r); in s5p_mfc_probe()
1145 if (IS_ERR(dev->alloc_ctx[1])) { in s5p_mfc_probe()
1146 ret = PTR_ERR(dev->alloc_ctx[1]); in s5p_mfc_probe()
1150 mutex_init(&dev->mfc_mutex); in s5p_mfc_probe()
1152 ret = s5p_mfc_alloc_firmware(dev); in s5p_mfc_probe()
1156 ret = v4l2_device_register(&pdev->dev, &dev->v4l2_dev); in s5p_mfc_probe()
1159 init_waitqueue_head(&dev->queue); in s5p_mfc_probe()
1164 v4l2_err(&dev->v4l2_dev, "Failed to allocate video device\n"); in s5p_mfc_probe()
1171 vfd->lock = &dev->mfc_mutex; in s5p_mfc_probe()
1172 vfd->v4l2_dev = &dev->v4l2_dev; in s5p_mfc_probe()
1175 dev->vfd_dec = vfd; in s5p_mfc_probe()
1178 v4l2_err(&dev->v4l2_dev, "Failed to register video device\n"); in s5p_mfc_probe()
1182 v4l2_info(&dev->v4l2_dev, in s5p_mfc_probe()
1184 video_set_drvdata(vfd, dev); in s5p_mfc_probe()
1189 v4l2_err(&dev->v4l2_dev, "Failed to allocate video device\n"); in s5p_mfc_probe()
1196 vfd->lock = &dev->mfc_mutex; in s5p_mfc_probe()
1197 vfd->v4l2_dev = &dev->v4l2_dev; in s5p_mfc_probe()
1200 dev->vfd_enc = vfd; in s5p_mfc_probe()
1203 v4l2_err(&dev->v4l2_dev, "Failed to register video device\n"); in s5p_mfc_probe()
1207 v4l2_info(&dev->v4l2_dev, in s5p_mfc_probe()
1209 video_set_drvdata(vfd, dev); in s5p_mfc_probe()
1210 platform_set_drvdata(pdev, dev); in s5p_mfc_probe()
1212 dev->hw_lock = 0; in s5p_mfc_probe()
1213 dev->watchdog_workqueue = create_singlethread_workqueue(S5P_MFC_NAME); in s5p_mfc_probe()
1214 INIT_WORK(&dev->watchdog_work, s5p_mfc_watchdog_worker); in s5p_mfc_probe()
1215 atomic_set(&dev->watchdog_cnt, 0); in s5p_mfc_probe()
1216 init_timer(&dev->watchdog_timer); in s5p_mfc_probe()
1217 dev->watchdog_timer.data = (unsigned long)dev; in s5p_mfc_probe()
1218 dev->watchdog_timer.function = s5p_mfc_watchdog; in s5p_mfc_probe()
1221 s5p_mfc_init_hw_ops(dev); in s5p_mfc_probe()
1222 s5p_mfc_init_hw_cmds(dev); in s5p_mfc_probe()
1223 s5p_mfc_init_regs(dev); in s5p_mfc_probe()
1230 video_device_release(dev->vfd_enc); in s5p_mfc_probe()
1232 video_unregister_device(dev->vfd_dec); in s5p_mfc_probe()
1234 video_device_release(dev->vfd_dec); in s5p_mfc_probe()
1236 v4l2_device_unregister(&dev->v4l2_dev); in s5p_mfc_probe()
1238 s5p_mfc_release_firmware(dev); in s5p_mfc_probe()
1240 vb2_dma_contig_cleanup_ctx(dev->alloc_ctx[1]); in s5p_mfc_probe()
1242 vb2_dma_contig_cleanup_ctx(dev->alloc_ctx[0]); in s5p_mfc_probe()
1244 s5p_mfc_final_pm(dev); in s5p_mfc_probe()
1254 struct s5p_mfc_dev *dev = platform_get_drvdata(pdev); in s5p_mfc_remove() local
1256 v4l2_info(&dev->v4l2_dev, "Removing %s\n", pdev->name); in s5p_mfc_remove()
1258 del_timer_sync(&dev->watchdog_timer); in s5p_mfc_remove()
1259 flush_workqueue(dev->watchdog_workqueue); in s5p_mfc_remove()
1260 destroy_workqueue(dev->watchdog_workqueue); in s5p_mfc_remove()
1262 video_unregister_device(dev->vfd_enc); in s5p_mfc_remove()
1263 video_unregister_device(dev->vfd_dec); in s5p_mfc_remove()
1264 v4l2_device_unregister(&dev->v4l2_dev); in s5p_mfc_remove()
1265 s5p_mfc_release_firmware(dev); in s5p_mfc_remove()
1266 vb2_dma_contig_cleanup_ctx(dev->alloc_ctx[0]); in s5p_mfc_remove()
1267 vb2_dma_contig_cleanup_ctx(dev->alloc_ctx[1]); in s5p_mfc_remove()
1268 if (pdev->dev.of_node) { in s5p_mfc_remove()
1269 put_device(dev->mem_dev_l); in s5p_mfc_remove()
1270 put_device(dev->mem_dev_r); in s5p_mfc_remove()
1273 s5p_mfc_final_pm(dev); in s5p_mfc_remove()
1279 static int s5p_mfc_suspend(struct device *dev) in s5p_mfc_suspend() argument
1281 struct platform_device *pdev = to_platform_device(dev); in s5p_mfc_suspend()
1314 static int s5p_mfc_resume(struct device *dev) in s5p_mfc_resume() argument
1316 struct platform_device *pdev = to_platform_device(dev); in s5p_mfc_resume()
1326 static int s5p_mfc_runtime_suspend(struct device *dev) in s5p_mfc_runtime_suspend() argument
1328 struct platform_device *pdev = to_platform_device(dev); in s5p_mfc_runtime_suspend()
1335 static int s5p_mfc_runtime_resume(struct device *dev) in s5p_mfc_runtime_resume() argument
1337 struct platform_device *pdev = to_platform_device(dev); in s5p_mfc_runtime_resume()
1509 if (pdev->dev.of_node) { in mfc_get_drv_data()
1512 pdev->dev.of_node); in mfc_get_drv_data()