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()
187 struct s5p_mfc_dev *dev = ctx->dev; in s5p_mfc_handle_frame_all_extracted() local
203 if (s5p_mfc_hw_call(dev->mfc_ops, get_pic_type_top, ctx) == in s5p_mfc_handle_frame_all_extracted()
204 s5p_mfc_hw_call(dev->mfc_ops, get_pic_type_bot, ctx)) in s5p_mfc_handle_frame_all_extracted()
217 struct s5p_mfc_dev *dev = ctx->dev; in s5p_mfc_handle_frame_copy_time() local
223 frame_type = s5p_mfc_hw_call(dev->mfc_ops, get_dec_frame_type, dev); in s5p_mfc_handle_frame_copy_time()
226 dec_y_addr = s5p_mfc_hw_call(dev->mfc_ops, get_dec_y_adr, dev); in s5p_mfc_handle_frame_copy_time()
269 struct s5p_mfc_dev *dev = ctx->dev; in s5p_mfc_handle_frame_new() local
274 dspl_y_addr = s5p_mfc_hw_call(dev->mfc_ops, get_dspl_y_adr, dev); in s5p_mfc_handle_frame_new()
275 if (IS_MFCV6_PLUS(dev)) in s5p_mfc_handle_frame_new()
276 frame_type = s5p_mfc_hw_call(dev->mfc_ops, in s5p_mfc_handle_frame_new()
279 frame_type = s5p_mfc_hw_call(dev->mfc_ops, in s5p_mfc_handle_frame_new()
280 get_dec_frame_type, dev); in s5p_mfc_handle_frame_new()
299 if (s5p_mfc_hw_call(dev->mfc_ops, in s5p_mfc_handle_frame_new()
301 s5p_mfc_hw_call(dev->mfc_ops, in s5p_mfc_handle_frame_new()
326 struct s5p_mfc_dev *dev = ctx->dev; in s5p_mfc_handle_frame() local
333 dst_frame_status = s5p_mfc_hw_call(dev->mfc_ops, get_dspl_status, dev) in s5p_mfc_handle_frame()
335 dec_frame_status = s5p_mfc_hw_call(dev->mfc_ops, get_dec_status, dev) in s5p_mfc_handle_frame()
337 res_change = (s5p_mfc_hw_call(dev->mfc_ops, get_dspl_status, dev) in s5p_mfc_handle_frame()
346 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev); in s5p_mfc_handle_frame()
348 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0); in s5p_mfc_handle_frame()
350 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev); in s5p_mfc_handle_frame()
356 spin_lock_irqsave(&dev->irqlock, flags); in s5p_mfc_handle_frame()
391 ctx->consumed_stream += s5p_mfc_hw_call(dev->mfc_ops, in s5p_mfc_handle_frame()
392 get_consumed_stream, dev); in s5p_mfc_handle_frame()
407 if (s5p_mfc_hw_call(dev->mfc_ops, err_dec, err) > 0) in s5p_mfc_handle_frame()
416 spin_unlock_irqrestore(&dev->irqlock, flags); in s5p_mfc_handle_frame()
420 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev); in s5p_mfc_handle_frame()
422 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0); in s5p_mfc_handle_frame()
425 if (test_bit(0, &dev->enter_suspend)) in s5p_mfc_handle_frame()
426 wake_up_dev(dev, reason, err); in s5p_mfc_handle_frame()
428 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev); in s5p_mfc_handle_frame()
432 static void s5p_mfc_handle_error(struct s5p_mfc_dev *dev, in s5p_mfc_handle_error() argument
453 spin_lock_irqsave(&dev->irqlock, flags); in s5p_mfc_handle_error()
454 s5p_mfc_hw_call_void(dev->mfc_ops, cleanup_queue, in s5p_mfc_handle_error()
457 s5p_mfc_hw_call_void(dev->mfc_ops, cleanup_queue, in s5p_mfc_handle_error()
459 spin_unlock_irqrestore(&dev->irqlock, flags); in s5p_mfc_handle_error()
469 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0); in s5p_mfc_handle_error()
470 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev); in s5p_mfc_handle_error()
472 wake_up_dev(dev, reason, err); in s5p_mfc_handle_error()
480 struct s5p_mfc_dev *dev; in s5p_mfc_handle_seq_done() local
484 dev = ctx->dev; in s5p_mfc_handle_seq_done()
489 ctx->img_width = s5p_mfc_hw_call(dev->mfc_ops, get_img_width, in s5p_mfc_handle_seq_done()
490 dev); in s5p_mfc_handle_seq_done()
491 ctx->img_height = s5p_mfc_hw_call(dev->mfc_ops, get_img_height, in s5p_mfc_handle_seq_done()
492 dev); in s5p_mfc_handle_seq_done()
494 s5p_mfc_hw_call_void(dev->mfc_ops, dec_calc_dpb_size, ctx); in s5p_mfc_handle_seq_done()
496 ctx->pb_count = s5p_mfc_hw_call(dev->mfc_ops, get_dpb_count, in s5p_mfc_handle_seq_done()
497 dev); in s5p_mfc_handle_seq_done()
498 ctx->mv_count = s5p_mfc_hw_call(dev->mfc_ops, get_mv_count, in s5p_mfc_handle_seq_done()
499 dev); in s5p_mfc_handle_seq_done()
511 if (s5p_mfc_hw_call(dev->mfc_ops, get_consumed_stream, in s5p_mfc_handle_seq_done()
512 dev) < in s5p_mfc_handle_seq_done()
521 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev); in s5p_mfc_handle_seq_done()
523 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0); in s5p_mfc_handle_seq_done()
525 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev); in s5p_mfc_handle_seq_done()
534 struct s5p_mfc_dev *dev; in s5p_mfc_handle_init_buffers() local
539 dev = ctx->dev; in s5p_mfc_handle_init_buffers()
540 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev); in s5p_mfc_handle_init_buffers()
548 spin_lock_irqsave(&dev->irqlock, flags); in s5p_mfc_handle_init_buffers()
557 spin_unlock_irqrestore(&dev->irqlock, flags); in s5p_mfc_handle_init_buffers()
561 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0); in s5p_mfc_handle_init_buffers()
566 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev); in s5p_mfc_handle_init_buffers()
568 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
585 spin_lock(&dev->irqlock); in s5p_mfc_handle_stream_complete()
594 spin_unlock(&dev->irqlock); in s5p_mfc_handle_stream_complete()
598 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0); in s5p_mfc_handle_stream_complete()
602 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev); in s5p_mfc_handle_stream_complete()
608 struct s5p_mfc_dev *dev = priv; in s5p_mfc_irq() local
615 atomic_set(&dev->watchdog_cnt, 0); in s5p_mfc_irq()
616 ctx = dev->ctx[dev->curr_ctx]; in s5p_mfc_irq()
618 reason = s5p_mfc_hw_call(dev->mfc_ops, get_int_reason, dev); in s5p_mfc_irq()
619 err = s5p_mfc_hw_call(dev->mfc_ops, get_int_err, dev); in s5p_mfc_irq()
625 s5p_mfc_hw_call(dev->mfc_ops, err_dec, err) >= in s5p_mfc_irq()
626 dev->warn_start) in s5p_mfc_irq()
629 s5p_mfc_handle_error(dev, ctx, reason, err); in s5p_mfc_irq()
630 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()
646 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev); in s5p_mfc_irq()
648 WARN_ON(test_and_clear_bit(0, &dev->hw_lock) == 0); in s5p_mfc_irq()
650 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev); in s5p_mfc_irq()
661 ctx->inst_no = s5p_mfc_hw_call(dev->mfc_ops, get_inst_no, dev); in s5p_mfc_irq()
680 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev); in s5p_mfc_irq()
681 wake_up_dev(dev, reason, err); in s5p_mfc_irq()
682 clear_bit(0, &dev->hw_lock); in s5p_mfc_irq()
683 clear_bit(0, &dev->enter_suspend); in s5p_mfc_irq()
691 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev); in s5p_mfc_irq()
705 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev); in s5p_mfc_irq()
710 s5p_mfc_hw_call_void(dev->mfc_ops, clear_int_flags, dev); in s5p_mfc_irq()
714 if (test_and_clear_bit(0, &dev->hw_lock) == 0) in s5p_mfc_irq()
719 s5p_mfc_hw_call_void(dev->mfc_ops, try_run, dev); in s5p_mfc_irq()
728 struct s5p_mfc_dev *dev = video_drvdata(file); in s5p_mfc_open() local
734 if (mutex_lock_interruptible(&dev->mfc_mutex)) in s5p_mfc_open()
736 dev->num_inst++; /* It is guarded by mfc_mutex in vfd */ in s5p_mfc_open()
747 ctx->dev = dev; in s5p_mfc_open()
754 while (dev->ctx[ctx->num]) { in s5p_mfc_open()
764 dev->ctx[ctx->num] = ctx; in s5p_mfc_open()
765 if (vdev == dev->vfd_dec) { in s5p_mfc_open()
775 } else if (vdev == dev->vfd_enc) { in s5p_mfc_open()
795 if (dev->num_inst == 1) { in s5p_mfc_open()
796 dev->watchdog_timer.expires = jiffies + in s5p_mfc_open()
798 add_timer(&dev->watchdog_timer); in s5p_mfc_open()
805 ret = s5p_mfc_load_firmware(dev); in s5p_mfc_open()
811 ret = s5p_mfc_init_hw(dev); in s5p_mfc_open()
820 q->lock = &dev->mfc_mutex; in s5p_mfc_open()
821 if (vdev == dev->vfd_dec) { in s5p_mfc_open()
824 } else if (vdev == dev->vfd_enc) { in s5p_mfc_open()
843 q->lock = &dev->mfc_mutex; in s5p_mfc_open()
844 if (vdev == dev->vfd_dec) { in s5p_mfc_open()
847 } else if (vdev == dev->vfd_enc) { in s5p_mfc_open()
869 mutex_unlock(&dev->mfc_mutex); in s5p_mfc_open()
874 if (dev->num_inst == 1) in s5p_mfc_open()
875 s5p_mfc_deinit_hw(dev); in s5p_mfc_open()
879 if (dev->num_inst == 1) { in s5p_mfc_open()
882 del_timer_sync(&dev->watchdog_timer); in s5p_mfc_open()
887 dev->ctx[ctx->num] = NULL; in s5p_mfc_open()
893 dev->num_inst--; in s5p_mfc_open()
894 mutex_unlock(&dev->mfc_mutex); in s5p_mfc_open()
903 struct s5p_mfc_dev *dev = ctx->dev; in s5p_mfc_release() local
906 mutex_lock(&dev->mfc_mutex); in s5p_mfc_release()
916 s5p_mfc_close_mfc_inst(dev, ctx); in s5p_mfc_release()
919 if (dev->curr_ctx == ctx->num) in s5p_mfc_release()
920 clear_bit(0, &dev->hw_lock); in s5p_mfc_release()
921 dev->num_inst--; in s5p_mfc_release()
922 if (dev->num_inst == 0) { in s5p_mfc_release()
924 s5p_mfc_deinit_hw(dev); in s5p_mfc_release()
925 del_timer_sync(&dev->watchdog_timer); in s5p_mfc_release()
931 dev->ctx[ctx->num] = NULL; in s5p_mfc_release()
937 mutex_unlock(&dev->mfc_mutex); in s5p_mfc_release()
946 struct s5p_mfc_dev *dev = ctx->dev; in s5p_mfc_poll() local
952 mutex_lock(&dev->mfc_mutex); in s5p_mfc_poll()
965 mutex_unlock(&dev->mfc_mutex); in s5p_mfc_poll()
969 mutex_lock(&dev->mfc_mutex); in s5p_mfc_poll()
989 mutex_unlock(&dev->mfc_mutex); in s5p_mfc_poll()
997 struct s5p_mfc_dev *dev = ctx->dev; in s5p_mfc_mmap() local
1001 if (mutex_lock_interruptible(&dev->mfc_mutex)) in s5p_mfc_mmap()
1011 mutex_unlock(&dev->mfc_mutex); in s5p_mfc_mmap()
1025 static int match_child(struct device *dev, void *data) in match_child() argument
1027 if (!dev_name(dev)) in match_child()
1029 return !strcmp(dev_name(dev), (char *)data); in match_child()
1034 static int s5p_mfc_alloc_memdevs(struct s5p_mfc_dev *dev) in s5p_mfc_alloc_memdevs() argument
1038 dev->mem_dev_l = devm_kzalloc(&dev->plat_dev->dev, in s5p_mfc_alloc_memdevs()
1040 if (!dev->mem_dev_l) { in s5p_mfc_alloc_memdevs()
1044 device_initialize(dev->mem_dev_l); in s5p_mfc_alloc_memdevs()
1045 of_property_read_u32_array(dev->plat_dev->dev.of_node, in s5p_mfc_alloc_memdevs()
1047 if (dma_declare_coherent_memory(dev->mem_dev_l, mem_info[0], in s5p_mfc_alloc_memdevs()
1055 dev->mem_dev_r = devm_kzalloc(&dev->plat_dev->dev, in s5p_mfc_alloc_memdevs()
1057 if (!dev->mem_dev_r) { in s5p_mfc_alloc_memdevs()
1061 device_initialize(dev->mem_dev_r); in s5p_mfc_alloc_memdevs()
1062 of_property_read_u32_array(dev->plat_dev->dev.of_node, in s5p_mfc_alloc_memdevs()
1064 if (dma_declare_coherent_memory(dev->mem_dev_r, mem_info[0], in s5p_mfc_alloc_memdevs()
1077 struct s5p_mfc_dev *dev; in s5p_mfc_probe() local
1083 dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL); in s5p_mfc_probe()
1084 if (!dev) { in s5p_mfc_probe()
1085 dev_err(&pdev->dev, "Not enough memory for MFC device\n"); in s5p_mfc_probe()
1089 spin_lock_init(&dev->irqlock); in s5p_mfc_probe()
1090 spin_lock_init(&dev->condlock); in s5p_mfc_probe()
1091 dev->plat_dev = pdev; in s5p_mfc_probe()
1092 if (!dev->plat_dev) { in s5p_mfc_probe()
1093 dev_err(&pdev->dev, "No platform data specified\n"); in s5p_mfc_probe()
1097 dev->variant = mfc_get_drv_data(pdev); in s5p_mfc_probe()
1099 ret = s5p_mfc_init_pm(dev); in s5p_mfc_probe()
1101 dev_err(&pdev->dev, "failed to get mfc clock source\n"); in s5p_mfc_probe()
1107 dev->regs_base = devm_ioremap_resource(&pdev->dev, res); in s5p_mfc_probe()
1108 if (IS_ERR(dev->regs_base)) in s5p_mfc_probe()
1109 return PTR_ERR(dev->regs_base); in s5p_mfc_probe()
1113 dev_err(&pdev->dev, "failed to get irq resource\n"); in s5p_mfc_probe()
1117 dev->irq = res->start; in s5p_mfc_probe()
1118 ret = devm_request_irq(&pdev->dev, dev->irq, s5p_mfc_irq, in s5p_mfc_probe()
1119 0, pdev->name, dev); in s5p_mfc_probe()
1121 dev_err(&pdev->dev, "Failed to install irq (%d)\n", ret); in s5p_mfc_probe()
1125 if (pdev->dev.of_node) { in s5p_mfc_probe()
1126 ret = s5p_mfc_alloc_memdevs(dev); in s5p_mfc_probe()
1130 dev->mem_dev_l = device_find_child(&dev->plat_dev->dev, in s5p_mfc_probe()
1132 if (!dev->mem_dev_l) { in s5p_mfc_probe()
1137 dev->mem_dev_r = device_find_child(&dev->plat_dev->dev, in s5p_mfc_probe()
1139 if (!dev->mem_dev_r) { in s5p_mfc_probe()
1146 dev->alloc_ctx[0] = vb2_dma_contig_init_ctx(dev->mem_dev_l); in s5p_mfc_probe()
1147 if (IS_ERR(dev->alloc_ctx[0])) { in s5p_mfc_probe()
1148 ret = PTR_ERR(dev->alloc_ctx[0]); in s5p_mfc_probe()
1151 dev->alloc_ctx[1] = vb2_dma_contig_init_ctx(dev->mem_dev_r); in s5p_mfc_probe()
1152 if (IS_ERR(dev->alloc_ctx[1])) { in s5p_mfc_probe()
1153 ret = PTR_ERR(dev->alloc_ctx[1]); in s5p_mfc_probe()
1157 mutex_init(&dev->mfc_mutex); in s5p_mfc_probe()
1159 ret = s5p_mfc_alloc_firmware(dev); in s5p_mfc_probe()
1163 ret = v4l2_device_register(&pdev->dev, &dev->v4l2_dev); in s5p_mfc_probe()
1166 init_waitqueue_head(&dev->queue); in s5p_mfc_probe()
1171 v4l2_err(&dev->v4l2_dev, "Failed to allocate video device\n"); in s5p_mfc_probe()
1178 vfd->lock = &dev->mfc_mutex; in s5p_mfc_probe()
1179 vfd->v4l2_dev = &dev->v4l2_dev; in s5p_mfc_probe()
1182 dev->vfd_dec = vfd; in s5p_mfc_probe()
1185 v4l2_err(&dev->v4l2_dev, "Failed to register video device\n"); in s5p_mfc_probe()
1189 v4l2_info(&dev->v4l2_dev, in s5p_mfc_probe()
1191 video_set_drvdata(vfd, dev); in s5p_mfc_probe()
1196 v4l2_err(&dev->v4l2_dev, "Failed to allocate video device\n"); in s5p_mfc_probe()
1203 vfd->lock = &dev->mfc_mutex; in s5p_mfc_probe()
1204 vfd->v4l2_dev = &dev->v4l2_dev; in s5p_mfc_probe()
1207 dev->vfd_enc = vfd; in s5p_mfc_probe()
1210 v4l2_err(&dev->v4l2_dev, "Failed to register video device\n"); in s5p_mfc_probe()
1214 v4l2_info(&dev->v4l2_dev, in s5p_mfc_probe()
1216 video_set_drvdata(vfd, dev); in s5p_mfc_probe()
1217 platform_set_drvdata(pdev, dev); in s5p_mfc_probe()
1219 dev->hw_lock = 0; in s5p_mfc_probe()
1220 dev->watchdog_workqueue = create_singlethread_workqueue(S5P_MFC_NAME); in s5p_mfc_probe()
1221 INIT_WORK(&dev->watchdog_work, s5p_mfc_watchdog_worker); in s5p_mfc_probe()
1222 atomic_set(&dev->watchdog_cnt, 0); in s5p_mfc_probe()
1223 init_timer(&dev->watchdog_timer); in s5p_mfc_probe()
1224 dev->watchdog_timer.data = (unsigned long)dev; in s5p_mfc_probe()
1225 dev->watchdog_timer.function = s5p_mfc_watchdog; in s5p_mfc_probe()
1228 s5p_mfc_init_hw_ops(dev); in s5p_mfc_probe()
1229 s5p_mfc_init_hw_cmds(dev); in s5p_mfc_probe()
1230 s5p_mfc_init_regs(dev); in s5p_mfc_probe()
1237 video_device_release(dev->vfd_enc); in s5p_mfc_probe()
1239 video_unregister_device(dev->vfd_dec); in s5p_mfc_probe()
1241 video_device_release(dev->vfd_dec); in s5p_mfc_probe()
1243 v4l2_device_unregister(&dev->v4l2_dev); in s5p_mfc_probe()
1245 s5p_mfc_release_firmware(dev); in s5p_mfc_probe()
1247 vb2_dma_contig_cleanup_ctx(dev->alloc_ctx[1]); in s5p_mfc_probe()
1249 vb2_dma_contig_cleanup_ctx(dev->alloc_ctx[0]); in s5p_mfc_probe()
1251 s5p_mfc_final_pm(dev); in s5p_mfc_probe()
1261 struct s5p_mfc_dev *dev = platform_get_drvdata(pdev); in s5p_mfc_remove() local
1263 v4l2_info(&dev->v4l2_dev, "Removing %s\n", pdev->name); in s5p_mfc_remove()
1265 del_timer_sync(&dev->watchdog_timer); in s5p_mfc_remove()
1266 flush_workqueue(dev->watchdog_workqueue); in s5p_mfc_remove()
1267 destroy_workqueue(dev->watchdog_workqueue); in s5p_mfc_remove()
1269 video_unregister_device(dev->vfd_enc); in s5p_mfc_remove()
1270 video_unregister_device(dev->vfd_dec); in s5p_mfc_remove()
1271 v4l2_device_unregister(&dev->v4l2_dev); in s5p_mfc_remove()
1272 s5p_mfc_release_firmware(dev); in s5p_mfc_remove()
1273 vb2_dma_contig_cleanup_ctx(dev->alloc_ctx[0]); in s5p_mfc_remove()
1274 vb2_dma_contig_cleanup_ctx(dev->alloc_ctx[1]); in s5p_mfc_remove()
1275 if (pdev->dev.of_node) { in s5p_mfc_remove()
1276 put_device(dev->mem_dev_l); in s5p_mfc_remove()
1277 put_device(dev->mem_dev_r); in s5p_mfc_remove()
1280 s5p_mfc_final_pm(dev); in s5p_mfc_remove()
1286 static int s5p_mfc_suspend(struct device *dev) in s5p_mfc_suspend() argument
1288 struct platform_device *pdev = to_platform_device(dev); in s5p_mfc_suspend()
1321 static int s5p_mfc_resume(struct device *dev) in s5p_mfc_resume() argument
1323 struct platform_device *pdev = to_platform_device(dev); in s5p_mfc_resume()
1333 static int s5p_mfc_runtime_suspend(struct device *dev) in s5p_mfc_runtime_suspend() argument
1335 struct platform_device *pdev = to_platform_device(dev); in s5p_mfc_runtime_suspend()
1342 static int s5p_mfc_runtime_resume(struct device *dev) in s5p_mfc_runtime_resume() argument
1344 struct platform_device *pdev = to_platform_device(dev); in s5p_mfc_runtime_resume()
1514 if (pdev->dev.of_node) { in mfc_get_drv_data()
1517 pdev->dev.of_node); in mfc_get_drv_data()