aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2011-03-24 11:51:07 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-05-20 10:52:36 -0400
commit066f7867207b8e13d2062069e0ba7cb3a5bf04b2 (patch)
tree3ba6934e248262d1c2dd2a119869a3fabc68e480 /drivers/media/video
parentc68956c14b6accaf6371c8db26deb23fe8e3a3f3 (diff)
[media] V4L: sh_mobile_ceu_camera: implement .stop_streaming()
The .stop_streaming() videobuf2 operation has to be implemented to guarantee, that video buffers are not written to after a STREAMOFF. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/sh_mobile_ceu_camera.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/media/video/sh_mobile_ceu_camera.c b/drivers/media/video/sh_mobile_ceu_camera.c
index 134e86bf6d97..e6839bb70acc 100644
--- a/drivers/media/video/sh_mobile_ceu_camera.c
+++ b/drivers/media/video/sh_mobile_ceu_camera.c
@@ -427,6 +427,26 @@ static int sh_mobile_ceu_videobuf_init(struct vb2_buffer *vb)
427 return 0; 427 return 0;
428} 428}
429 429
430static int sh_mobile_ceu_stop_streaming(struct vb2_queue *q)
431{
432 struct soc_camera_device *icd = container_of(q, struct soc_camera_device, vb2_vidq);
433 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
434 struct sh_mobile_ceu_dev *pcdev = ici->priv;
435 struct list_head *buf_head, *tmp;
436 unsigned long flags;
437
438 spin_lock_irqsave(&pcdev->lock, flags);
439
440 pcdev->active = NULL;
441
442 list_for_each_safe(buf_head, tmp, &pcdev->capture)
443 list_del_init(buf_head);
444
445 spin_unlock_irqrestore(&pcdev->lock, flags);
446
447 return sh_mobile_ceu_soft_reset(pcdev);
448}
449
430static struct vb2_ops sh_mobile_ceu_videobuf_ops = { 450static struct vb2_ops sh_mobile_ceu_videobuf_ops = {
431 .queue_setup = sh_mobile_ceu_videobuf_setup, 451 .queue_setup = sh_mobile_ceu_videobuf_setup,
432 .buf_prepare = sh_mobile_ceu_videobuf_prepare, 452 .buf_prepare = sh_mobile_ceu_videobuf_prepare,
@@ -435,6 +455,7 @@ static struct vb2_ops sh_mobile_ceu_videobuf_ops = {
435 .buf_init = sh_mobile_ceu_videobuf_init, 455 .buf_init = sh_mobile_ceu_videobuf_init,
436 .wait_prepare = soc_camera_unlock, 456 .wait_prepare = soc_camera_unlock,
437 .wait_finish = soc_camera_lock, 457 .wait_finish = soc_camera_lock,
458 .stop_streaming = sh_mobile_ceu_stop_streaming,
438}; 459};
439 460
440static irqreturn_t sh_mobile_ceu_irq(int irq, void *data) 461static irqreturn_t sh_mobile_ceu_irq(int irq, void *data)