Lines Matching refs:vou_dev
97 static void sh_vou_reg_a_write(struct sh_vou_device *vou_dev, unsigned int reg, in sh_vou_reg_a_write() argument
100 __raw_writel(value, vou_dev->base + reg); in sh_vou_reg_a_write()
103 static void sh_vou_reg_ab_write(struct sh_vou_device *vou_dev, unsigned int reg, in sh_vou_reg_ab_write() argument
106 __raw_writel(value, vou_dev->base + reg); in sh_vou_reg_ab_write()
107 __raw_writel(value, vou_dev->base + reg + 0x1000); in sh_vou_reg_ab_write()
110 static void sh_vou_reg_m_write(struct sh_vou_device *vou_dev, unsigned int reg, in sh_vou_reg_m_write() argument
113 __raw_writel(value, vou_dev->base + reg + 0x2000); in sh_vou_reg_m_write()
116 static u32 sh_vou_reg_a_read(struct sh_vou_device *vou_dev, unsigned int reg) in sh_vou_reg_a_read() argument
118 return __raw_readl(vou_dev->base + reg); in sh_vou_reg_a_read()
121 static void sh_vou_reg_a_set(struct sh_vou_device *vou_dev, unsigned int reg, in sh_vou_reg_a_set() argument
124 u32 old = __raw_readl(vou_dev->base + reg); in sh_vou_reg_a_set()
127 __raw_writel(value, vou_dev->base + reg); in sh_vou_reg_a_set()
130 static void sh_vou_reg_b_set(struct sh_vou_device *vou_dev, unsigned int reg, in sh_vou_reg_b_set() argument
133 sh_vou_reg_a_set(vou_dev, reg + 0x1000, value, mask); in sh_vou_reg_b_set()
136 static void sh_vou_reg_ab_set(struct sh_vou_device *vou_dev, unsigned int reg, in sh_vou_reg_ab_set() argument
139 sh_vou_reg_a_set(vou_dev, reg, value, mask); in sh_vou_reg_ab_set()
140 sh_vou_reg_b_set(vou_dev, reg, value, mask); in sh_vou_reg_ab_set()
197 static void sh_vou_schedule_next(struct sh_vou_device *vou_dev, in sh_vou_schedule_next() argument
203 switch (vou_dev->pix.pixelformat) { in sh_vou_schedule_next()
206 addr2 = addr1 + vou_dev->pix.width * vou_dev->pix.height; in sh_vou_schedule_next()
212 sh_vou_reg_m_write(vou_dev, VOUAD1R, addr1); in sh_vou_schedule_next()
213 sh_vou_reg_m_write(vou_dev, VOUAD2R, addr2); in sh_vou_schedule_next()
216 static void sh_vou_stream_config(struct sh_vou_device *vou_dev) in sh_vou_stream_config() argument
225 switch (vou_dev->pix.pixelformat) { in sh_vou_stream_config()
241 sh_vou_reg_a_write(vou_dev, VOUSWR, dataswap); in sh_vou_stream_config()
242 sh_vou_reg_ab_write(vou_dev, VOUAIR, vou_dev->pix.width * row_coeff); in sh_vou_stream_config()
251 struct sh_vou_device *vou_dev = vb2_get_drv_priv(vq); in sh_vou_queue_setup() local
252 struct v4l2_pix_format *pix = &vou_dev->pix; in sh_vou_queue_setup()
253 int bytes_per_line = vou_fmt[vou_dev->pix_idx].bpp * pix->width / 8; in sh_vou_queue_setup()
255 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); in sh_vou_queue_setup()
261 alloc_ctxs[0] = vou_dev->alloc_ctx; in sh_vou_queue_setup()
267 struct sh_vou_device *vou_dev = vb2_get_drv_priv(vb->vb2_queue); in sh_vou_buf_prepare() local
268 struct v4l2_pix_format *pix = &vou_dev->pix; in sh_vou_buf_prepare()
269 unsigned bytes_per_line = vou_fmt[vou_dev->pix_idx].bpp * pix->width / 8; in sh_vou_buf_prepare()
272 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); in sh_vou_buf_prepare()
276 dev_warn(vou_dev->v4l2_dev.dev, "buffer too small (%lu < %u)\n", in sh_vou_buf_prepare()
289 struct sh_vou_device *vou_dev = vb2_get_drv_priv(vb->vb2_queue); in sh_vou_buf_queue() local
293 spin_lock_irqsave(&vou_dev->lock, flags); in sh_vou_buf_queue()
294 list_add_tail(&shbuf->list, &vou_dev->buf_list); in sh_vou_buf_queue()
295 spin_unlock_irqrestore(&vou_dev->lock, flags); in sh_vou_buf_queue()
300 struct sh_vou_device *vou_dev = vb2_get_drv_priv(vq); in sh_vou_start_streaming() local
304 vou_dev->sequence = 0; in sh_vou_start_streaming()
305 ret = v4l2_device_call_until_err(&vou_dev->v4l2_dev, 0, in sh_vou_start_streaming()
308 list_for_each_entry_safe(buf, node, &vou_dev->buf_list, list) { in sh_vou_start_streaming()
313 vou_dev->active = NULL; in sh_vou_start_streaming()
317 buf = list_entry(vou_dev->buf_list.next, struct sh_vou_buffer, list); in sh_vou_start_streaming()
319 vou_dev->active = buf; in sh_vou_start_streaming()
322 sh_vou_reg_a_write(vou_dev, VOURPR, 1); in sh_vou_start_streaming()
323 dev_dbg(vou_dev->v4l2_dev.dev, "%s: first buffer status 0x%x\n", in sh_vou_start_streaming()
324 __func__, sh_vou_reg_a_read(vou_dev, VOUSTR)); in sh_vou_start_streaming()
325 sh_vou_schedule_next(vou_dev, &buf->vb); in sh_vou_start_streaming()
330 sh_vou_reg_a_write(vou_dev, VOURPR, 0); in sh_vou_start_streaming()
331 sh_vou_schedule_next(vou_dev, &buf->vb); in sh_vou_start_streaming()
334 sh_vou_reg_a_write(vou_dev, VOURCR, 5); in sh_vou_start_streaming()
336 sh_vou_stream_config(vou_dev); in sh_vou_start_streaming()
338 sh_vou_reg_a_write(vou_dev, VOUIR, 0x10004); in sh_vou_start_streaming()
341 vou_dev->status = SH_VOU_RUNNING; in sh_vou_start_streaming()
342 sh_vou_reg_a_write(vou_dev, VOUER, 0x107); in sh_vou_start_streaming()
348 struct sh_vou_device *vou_dev = vb2_get_drv_priv(vq); in sh_vou_stop_streaming() local
352 v4l2_device_call_until_err(&vou_dev->v4l2_dev, 0, in sh_vou_stop_streaming()
355 sh_vou_reg_a_set(vou_dev, VOUER, 0, 1); in sh_vou_stop_streaming()
357 sh_vou_reg_a_set(vou_dev, VOUIR, 0, 0x30000); in sh_vou_stop_streaming()
359 spin_lock_irqsave(&vou_dev->lock, flags); in sh_vou_stop_streaming()
360 list_for_each_entry_safe(buf, node, &vou_dev->buf_list, list) { in sh_vou_stop_streaming()
364 vou_dev->active = NULL; in sh_vou_stop_streaming()
365 spin_unlock_irqrestore(&vou_dev->lock, flags); in sh_vou_stop_streaming()
382 struct sh_vou_device *vou_dev = video_drvdata(file); in sh_vou_querycap() local
384 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); in sh_vou_querycap()
399 struct sh_vou_device *vou_dev = video_drvdata(file); in sh_vou_enum_fmt_vid_out() local
404 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); in sh_vou_enum_fmt_vid_out()
417 struct sh_vou_device *vou_dev = video_drvdata(file); in sh_vou_g_fmt_vid_out() local
419 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); in sh_vou_g_fmt_vid_out()
422 fmt->fmt.pix = vou_dev->pix; in sh_vou_g_fmt_vid_out()
434 static void sh_vou_configure_geometry(struct sh_vou_device *vou_dev, in sh_vou_configure_geometry() argument
440 struct v4l2_rect *rect = &vou_dev->rect; in sh_vou_configure_geometry()
441 struct v4l2_pix_format *pix = &vou_dev->pix; in sh_vou_configure_geometry()
444 if (vou_dev->std & V4L2_STD_525_60) { in sh_vou_configure_geometry()
481 dev_dbg(vou_dev->v4l2_dev.dev, in sh_vou_configure_geometry()
487 sh_vou_reg_ab_write(vou_dev, VOUISR, (pix->width << 16) | frame_in_height); in sh_vou_configure_geometry()
488 sh_vou_reg_ab_write(vou_dev, VOUVPR, (black_left << 16) | black_top); in sh_vou_configure_geometry()
489 sh_vou_reg_ab_write(vou_dev, VOUDPR, (rect->left << 16) | frame_out_top); in sh_vou_configure_geometry()
490 sh_vou_reg_ab_write(vou_dev, VOUDSR, (dsr_h << 16) | dsr_v); in sh_vou_configure_geometry()
502 dev_dbg(vou_dev->v4l2_dev.dev, "%s: scaling 0x%x\n", fmt->desc, vouvcr); in sh_vou_configure_geometry()
505 sh_vou_reg_ab_write(vou_dev, VOUVCR, vouvcr); in sh_vou_configure_geometry()
506 sh_vou_reg_ab_write(vou_dev, VOUDFR, in sh_vou_configure_geometry()
670 struct sh_vou_device *vou_dev = video_drvdata(file); in sh_vou_try_fmt_vid_out() local
675 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); in sh_vou_try_fmt_vid_out()
688 if (vou_dev->std & V4L2_STD_525_60) in sh_vou_try_fmt_vid_out()
703 static int sh_vou_set_fmt_vid_out(struct sh_vou_device *vou_dev, in sh_vou_set_fmt_vid_out() argument
719 if (vb2_is_busy(&vou_dev->queue)) in sh_vou_set_fmt_vid_out()
728 geo.output = vou_dev->rect; in sh_vou_set_fmt_vid_out()
730 vou_adjust_output(&geo, vou_dev->std); in sh_vou_set_fmt_vid_out()
734 ret = v4l2_device_call_until_err(&vou_dev->v4l2_dev, 0, pad, in sh_vou_set_fmt_vid_out()
740 dev_dbg(vou_dev->v4l2_dev.dev, "%s(): %ux%u -> %ux%u\n", __func__, in sh_vou_set_fmt_vid_out()
743 if (vou_dev->std & V4L2_STD_525_60) in sh_vou_set_fmt_vid_out()
759 vou_adjust_input(&geo, vou_dev->std); in sh_vou_set_fmt_vid_out()
763 vou_dev->rect = geo.output; in sh_vou_set_fmt_vid_out()
767 dev_dbg(vou_dev->v4l2_dev.dev, "%s(): %ux%u\n", __func__, in sh_vou_set_fmt_vid_out()
770 vou_dev->pix_idx = pix_idx; in sh_vou_set_fmt_vid_out()
772 vou_dev->pix = *pix; in sh_vou_set_fmt_vid_out()
774 sh_vou_configure_geometry(vou_dev, pix_idx, in sh_vou_set_fmt_vid_out()
783 struct sh_vou_device *vou_dev = video_drvdata(file); in sh_vou_s_fmt_vid_out() local
788 return sh_vou_set_fmt_vid_out(vou_dev, &fmt->fmt.pix); in sh_vou_s_fmt_vid_out()
794 struct sh_vou_device *vou_dev = video_drvdata(file); in sh_vou_enum_output() local
800 a->std = vou_dev->vdev.tvnorms; in sh_vou_enum_output()
832 struct sh_vou_device *vou_dev = video_drvdata(file); in sh_vou_s_std() local
835 dev_dbg(vou_dev->v4l2_dev.dev, "%s(): 0x%llx\n", __func__, std_id); in sh_vou_s_std()
837 if (std_id == vou_dev->std) in sh_vou_s_std()
840 if (vb2_is_busy(&vou_dev->queue)) in sh_vou_s_std()
843 ret = v4l2_device_call_until_err(&vou_dev->v4l2_dev, 0, video, in sh_vou_s_std()
849 vou_dev->rect.top = vou_dev->rect.left = 0; in sh_vou_s_std()
850 vou_dev->rect.width = VOU_MAX_IMAGE_WIDTH; in sh_vou_s_std()
852 sh_vou_reg_ab_set(vou_dev, VOUCR, in sh_vou_s_std()
853 sh_vou_ntsc_mode(vou_dev->pdata->bus_fmt) << 29, 7 << 29); in sh_vou_s_std()
854 vou_dev->rect.height = 480; in sh_vou_s_std()
856 sh_vou_reg_ab_set(vou_dev, VOUCR, 5 << 29, 7 << 29); in sh_vou_s_std()
857 vou_dev->rect.height = 576; in sh_vou_s_std()
860 vou_dev->pix.width = vou_dev->rect.width; in sh_vou_s_std()
861 vou_dev->pix.height = vou_dev->rect.height; in sh_vou_s_std()
862 vou_dev->pix.bytesperline = in sh_vou_s_std()
863 vou_dev->pix.width * vou_fmt[vou_dev->pix_idx].bpl; in sh_vou_s_std()
864 vou_dev->pix.sizeimage = vou_dev->pix.height * in sh_vou_s_std()
865 ((vou_dev->pix.width * vou_fmt[vou_dev->pix_idx].bpp) >> 3); in sh_vou_s_std()
866 vou_dev->std = std_id; in sh_vou_s_std()
867 sh_vou_set_fmt_vid_out(vou_dev, &vou_dev->pix); in sh_vou_s_std()
874 struct sh_vou_device *vou_dev = video_drvdata(file); in sh_vou_g_std() local
876 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); in sh_vou_g_std()
878 *std = vou_dev->std; in sh_vou_g_std()
885 struct sh_vou_device *vou_dev = video_drvdata(file); in sh_vou_log_status() local
887 pr_info("VOUER: 0x%08x\n", sh_vou_reg_a_read(vou_dev, VOUER)); in sh_vou_log_status()
888 pr_info("VOUCR: 0x%08x\n", sh_vou_reg_a_read(vou_dev, VOUCR)); in sh_vou_log_status()
889 pr_info("VOUSTR: 0x%08x\n", sh_vou_reg_a_read(vou_dev, VOUSTR)); in sh_vou_log_status()
890 pr_info("VOUVCR: 0x%08x\n", sh_vou_reg_a_read(vou_dev, VOUVCR)); in sh_vou_log_status()
891 pr_info("VOUISR: 0x%08x\n", sh_vou_reg_a_read(vou_dev, VOUISR)); in sh_vou_log_status()
892 pr_info("VOUBCR: 0x%08x\n", sh_vou_reg_a_read(vou_dev, VOUBCR)); in sh_vou_log_status()
893 pr_info("VOUDPR: 0x%08x\n", sh_vou_reg_a_read(vou_dev, VOUDPR)); in sh_vou_log_status()
894 pr_info("VOUDSR: 0x%08x\n", sh_vou_reg_a_read(vou_dev, VOUDSR)); in sh_vou_log_status()
895 pr_info("VOUVPR: 0x%08x\n", sh_vou_reg_a_read(vou_dev, VOUVPR)); in sh_vou_log_status()
896 pr_info("VOUIR: 0x%08x\n", sh_vou_reg_a_read(vou_dev, VOUIR)); in sh_vou_log_status()
897 pr_info("VOUSRR: 0x%08x\n", sh_vou_reg_a_read(vou_dev, VOUSRR)); in sh_vou_log_status()
898 pr_info("VOUMSR: 0x%08x\n", sh_vou_reg_a_read(vou_dev, VOUMSR)); in sh_vou_log_status()
899 pr_info("VOUHIR: 0x%08x\n", sh_vou_reg_a_read(vou_dev, VOUHIR)); in sh_vou_log_status()
900 pr_info("VOUDFR: 0x%08x\n", sh_vou_reg_a_read(vou_dev, VOUDFR)); in sh_vou_log_status()
901 pr_info("VOUAD1R: 0x%08x\n", sh_vou_reg_a_read(vou_dev, VOUAD1R)); in sh_vou_log_status()
902 pr_info("VOUAD2R: 0x%08x\n", sh_vou_reg_a_read(vou_dev, VOUAD2R)); in sh_vou_log_status()
903 pr_info("VOUAIR: 0x%08x\n", sh_vou_reg_a_read(vou_dev, VOUAIR)); in sh_vou_log_status()
904 pr_info("VOUSWR: 0x%08x\n", sh_vou_reg_a_read(vou_dev, VOUSWR)); in sh_vou_log_status()
905 pr_info("VOURCR: 0x%08x\n", sh_vou_reg_a_read(vou_dev, VOURCR)); in sh_vou_log_status()
906 pr_info("VOURPR: 0x%08x\n", sh_vou_reg_a_read(vou_dev, VOURPR)); in sh_vou_log_status()
913 struct sh_vou_device *vou_dev = video_drvdata(file); in sh_vou_g_selection() local
919 sel->r = vou_dev->rect; in sh_vou_g_selection()
926 if (vou_dev->std & V4L2_STD_525_60) in sh_vou_g_selection()
942 struct sh_vou_device *vou_dev = video_drvdata(file); in sh_vou_s_selection() local
944 struct v4l2_pix_format *pix = &vou_dev->pix; in sh_vou_s_selection()
960 if (vb2_is_busy(&vou_dev->queue)) in sh_vou_s_selection()
963 if (vou_dev->std & V4L2_STD_525_60) in sh_vou_s_selection()
990 v4l2_device_call_until_err(&vou_dev->v4l2_dev, 0, video, in sh_vou_s_selection()
994 ret = v4l2_device_call_until_err(&vou_dev->v4l2_dev, 0, pad, in sh_vou_s_selection()
1013 vou_adjust_input(&geo, vou_dev->std); in sh_vou_s_selection()
1016 vou_dev->rect = geo.output; in sh_vou_s_selection()
1020 sh_vou_configure_geometry(vou_dev, vou_dev->pix_idx, in sh_vou_s_selection()
1028 struct sh_vou_device *vou_dev = dev_id; in sh_vou_isr() local
1032 u32 irq_status = sh_vou_reg_a_read(vou_dev, VOUIR), masked; in sh_vou_isr()
1033 u32 vou_status = sh_vou_reg_a_read(vou_dev, VOUSTR); in sh_vou_isr()
1037 dev_warn(vou_dev->v4l2_dev.dev, "IRQ status 0x%x!\n", in sh_vou_isr()
1042 spin_lock(&vou_dev->lock); in sh_vou_isr()
1043 if (!vou_dev->active || list_empty(&vou_dev->buf_list)) { in sh_vou_isr()
1045 dev_warn(vou_dev->v4l2_dev.dev, in sh_vou_isr()
1048 sh_vou_reg_a_set(vou_dev, VOUIR, 0, 0x300); in sh_vou_isr()
1049 spin_unlock(&vou_dev->lock); in sh_vou_isr()
1054 dev_dbg(vou_dev->v4l2_dev.dev, in sh_vou_isr()
1062 sh_vou_reg_a_write(vou_dev, VOUIR, masked); in sh_vou_isr()
1064 vb = vou_dev->active; in sh_vou_isr()
1067 sh_vou_schedule_next(vou_dev, &vb->vb); in sh_vou_isr()
1068 spin_unlock(&vou_dev->lock); in sh_vou_isr()
1075 vb->vb.sequence = vou_dev->sequence++; in sh_vou_isr()
1079 vou_dev->active = list_entry(vou_dev->buf_list.next, in sh_vou_isr()
1082 if (list_is_singular(&vou_dev->buf_list)) { in sh_vou_isr()
1084 sh_vou_schedule_next(vou_dev, &vou_dev->active->vb); in sh_vou_isr()
1086 struct sh_vou_buffer *new = list_entry(vou_dev->active->list.next, in sh_vou_isr()
1088 sh_vou_schedule_next(vou_dev, &new->vb); in sh_vou_isr()
1091 spin_unlock(&vou_dev->lock); in sh_vou_isr()
1096 static int sh_vou_hw_init(struct sh_vou_device *vou_dev) in sh_vou_hw_init() argument
1098 struct sh_vou_pdata *pdata = vou_dev->pdata; in sh_vou_hw_init()
1103 sh_vou_reg_a_write(vou_dev, VOUIR, 0); in sh_vou_hw_init()
1106 sh_vou_reg_a_write(vou_dev, VOUSRR, 0x101); in sh_vou_hw_init()
1107 while (--i && (sh_vou_reg_a_read(vou_dev, VOUSRR) & 0x101)) in sh_vou_hw_init()
1113 dev_dbg(vou_dev->v4l2_dev.dev, "Reset took %dus\n", 100 - i); in sh_vou_hw_init()
1121 sh_vou_reg_ab_set(vou_dev, VOUCR, voucr, 0xfc000000); in sh_vou_hw_init()
1124 sh_vou_reg_a_write(vou_dev, VOURCR, 4); in sh_vou_hw_init()
1126 sh_vou_reg_ab_write(vou_dev, VOUMSR, 0x800000); in sh_vou_hw_init()
1128 sh_vou_set_fmt_vid_out(vou_dev, &vou_dev->pix); in sh_vou_hw_init()
1136 struct sh_vou_device *vou_dev = video_drvdata(file); in sh_vou_open() local
1139 if (mutex_lock_interruptible(&vou_dev->fop_lock)) in sh_vou_open()
1146 vou_dev->status == SH_VOU_INITIALISING) { in sh_vou_open()
1148 pm_runtime_get_sync(vou_dev->v4l2_dev.dev); in sh_vou_open()
1149 err = sh_vou_hw_init(vou_dev); in sh_vou_open()
1151 pm_runtime_put(vou_dev->v4l2_dev.dev); in sh_vou_open()
1154 vou_dev->status = SH_VOU_IDLE; in sh_vou_open()
1158 mutex_unlock(&vou_dev->fop_lock); in sh_vou_open()
1164 struct sh_vou_device *vou_dev = video_drvdata(file); in sh_vou_release() local
1167 mutex_lock(&vou_dev->fop_lock); in sh_vou_release()
1172 vou_dev->status = SH_VOU_INITIALISING; in sh_vou_release()
1173 sh_vou_reg_a_set(vou_dev, VOUER, 0, 0x101); in sh_vou_release()
1174 pm_runtime_put(vou_dev->v4l2_dev.dev); in sh_vou_release()
1176 mutex_unlock(&vou_dev->fop_lock); in sh_vou_release()
1231 struct sh_vou_device *vou_dev; in sh_vou_probe() local
1245 vou_dev = devm_kzalloc(&pdev->dev, sizeof(*vou_dev), GFP_KERNEL); in sh_vou_probe()
1246 if (!vou_dev) in sh_vou_probe()
1249 INIT_LIST_HEAD(&vou_dev->buf_list); in sh_vou_probe()
1250 spin_lock_init(&vou_dev->lock); in sh_vou_probe()
1251 mutex_init(&vou_dev->fop_lock); in sh_vou_probe()
1252 vou_dev->pdata = vou_pdata; in sh_vou_probe()
1253 vou_dev->status = SH_VOU_INITIALISING; in sh_vou_probe()
1254 vou_dev->pix_idx = 1; in sh_vou_probe()
1256 rect = &vou_dev->rect; in sh_vou_probe()
1257 pix = &vou_dev->pix; in sh_vou_probe()
1260 vou_dev->std = V4L2_STD_NTSC_M; in sh_vou_probe()
1273 vou_dev->base = devm_ioremap_resource(&pdev->dev, reg_res); in sh_vou_probe()
1274 if (IS_ERR(vou_dev->base)) in sh_vou_probe()
1275 return PTR_ERR(vou_dev->base); in sh_vou_probe()
1277 ret = devm_request_irq(&pdev->dev, irq, sh_vou_isr, 0, "vou", vou_dev); in sh_vou_probe()
1281 ret = v4l2_device_register(&pdev->dev, &vou_dev->v4l2_dev); in sh_vou_probe()
1287 vdev = &vou_dev->vdev; in sh_vou_probe()
1291 vdev->v4l2_dev = &vou_dev->v4l2_dev; in sh_vou_probe()
1293 vdev->lock = &vou_dev->fop_lock; in sh_vou_probe()
1295 video_set_drvdata(vdev, vou_dev); in sh_vou_probe()
1298 q = &vou_dev->queue; in sh_vou_probe()
1301 q->drv_priv = vou_dev; in sh_vou_probe()
1307 q->lock = &vou_dev->fop_lock; in sh_vou_probe()
1312 vou_dev->alloc_ctx = vb2_dma_contig_init_ctx(&pdev->dev); in sh_vou_probe()
1313 if (IS_ERR(vou_dev->alloc_ctx)) { in sh_vou_probe()
1315 ret = PTR_ERR(vou_dev->alloc_ctx); in sh_vou_probe()
1319 INIT_LIST_HEAD(&vou_dev->buf_list); in sh_vou_probe()
1330 ret = sh_vou_hw_init(vou_dev); in sh_vou_probe()
1334 subdev = v4l2_i2c_new_subdev_board(&vou_dev->v4l2_dev, i2c_adap, in sh_vou_probe()
1352 vb2_dma_contig_cleanup_ctx(vou_dev->alloc_ctx); in sh_vou_probe()
1355 v4l2_device_unregister(&vou_dev->v4l2_dev); in sh_vou_probe()
1362 struct sh_vou_device *vou_dev = container_of(v4l2_dev, in sh_vou_remove() local
1369 video_unregister_device(&vou_dev->vdev); in sh_vou_remove()
1371 vb2_dma_contig_cleanup_ctx(vou_dev->alloc_ctx); in sh_vou_remove()
1372 v4l2_device_unregister(&vou_dev->v4l2_dev); in sh_vou_remove()