diff options
author | Prabhakar Lad <prabhakar.csengg@gmail.com> | 2014-11-26 17:42:24 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-12-22 11:33:27 -0500 |
commit | 2914e72681cdb3f310b0a0d570e9ac17b8c37d0c (patch) | |
tree | 606ba0b5e95e16f3c290f1bacf5efa7258c6a254 | |
parent | 97bf6af1f928216fd6c5a66e8a57bfa95a659672 (diff) |
[media] media: s3c-camif: use vb2_ops_wait_prepare/finish helper
This patch drops driver specific wait_prepare() and
wait_finish() callbacks from vb2_ops and instead uses
the the helpers vb2_ops_wait_prepare/finish() provided
by the vb2 core, the lock member of the queue needs
to be initalized to a mutex so that vb2 helpers
vb2_ops_wait_prepare/finish() can make use of it.
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Cc: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | drivers/media/platform/s3c-camif/camif-capture.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/drivers/media/platform/s3c-camif/camif-capture.c b/drivers/media/platform/s3c-camif/camif-capture.c index aa40c8269ab8..54479d60cc0d 100644 --- a/drivers/media/platform/s3c-camif/camif-capture.c +++ b/drivers/media/platform/s3c-camif/camif-capture.c | |||
@@ -536,24 +536,12 @@ static void buffer_queue(struct vb2_buffer *vb) | |||
536 | spin_unlock_irqrestore(&camif->slock, flags); | 536 | spin_unlock_irqrestore(&camif->slock, flags); |
537 | } | 537 | } |
538 | 538 | ||
539 | static void camif_lock(struct vb2_queue *vq) | ||
540 | { | ||
541 | struct camif_vp *vp = vb2_get_drv_priv(vq); | ||
542 | mutex_lock(&vp->camif->lock); | ||
543 | } | ||
544 | |||
545 | static void camif_unlock(struct vb2_queue *vq) | ||
546 | { | ||
547 | struct camif_vp *vp = vb2_get_drv_priv(vq); | ||
548 | mutex_unlock(&vp->camif->lock); | ||
549 | } | ||
550 | |||
551 | static const struct vb2_ops s3c_camif_qops = { | 539 | static const struct vb2_ops s3c_camif_qops = { |
552 | .queue_setup = queue_setup, | 540 | .queue_setup = queue_setup, |
553 | .buf_prepare = buffer_prepare, | 541 | .buf_prepare = buffer_prepare, |
554 | .buf_queue = buffer_queue, | 542 | .buf_queue = buffer_queue, |
555 | .wait_prepare = camif_unlock, | 543 | .wait_prepare = vb2_ops_wait_prepare, |
556 | .wait_finish = camif_lock, | 544 | .wait_finish = vb2_ops_wait_finish, |
557 | .start_streaming = start_streaming, | 545 | .start_streaming = start_streaming, |
558 | .stop_streaming = stop_streaming, | 546 | .stop_streaming = stop_streaming, |
559 | }; | 547 | }; |
@@ -1161,6 +1149,7 @@ int s3c_camif_register_video_node(struct camif_dev *camif, int idx) | |||
1161 | q->buf_struct_size = sizeof(struct camif_buffer); | 1149 | q->buf_struct_size = sizeof(struct camif_buffer); |
1162 | q->drv_priv = vp; | 1150 | q->drv_priv = vp; |
1163 | q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; | 1151 | q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; |
1152 | q->lock = &vp->camif->lock; | ||
1164 | 1153 | ||
1165 | ret = vb2_queue_init(q); | 1154 | ret = vb2_queue_init(q); |
1166 | if (ret) | 1155 | if (ret) |