summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/s3c-camif
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2015-09-17 23:19:37 +0200
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-10-01 13:29:23 +0200
commit5ba0e2c3ad4c049b19f6cad7ec62e59424a55183 (patch)
treeda731151900e30bac077a5ef1872b32a62d1a7e2 /drivers/media/platform/s3c-camif
parent[media] exynos4-is: use monotonic timestamps as advertized (diff)
downloadlinux-5ba0e2c3ad4c049b19f6cad7ec62e59424a55183.tar.xz
linux-5ba0e2c3ad4c049b19f6cad7ec62e59424a55183.zip
[media] use v4l2_get_timestamp where possible
This is a preparation for a change to the type of v4l2 timestamps. v4l2_get_timestamp() is a helper function that reads the monotonic time and stores it into a 'struct timeval'. Multiple drivers implement the same thing themselves for historic reasons. Changing them all to use v4l2_get_timestamp() is more consistent and reduces the amount of code duplication, and most importantly simplifies the following changes. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> [hans.verkuil@cisco.com: dropped the v4l2-dev.c patch that didn't belong here] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform/s3c-camif')
-rw-r--r--drivers/media/platform/s3c-camif/camif-capture.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/media/platform/s3c-camif/camif-capture.c b/drivers/media/platform/s3c-camif/camif-capture.c
index 76e6289a5612..edf70725ecf3 100644
--- a/drivers/media/platform/s3c-camif/camif-capture.c
+++ b/drivers/media/platform/s3c-camif/camif-capture.c
@@ -328,23 +328,17 @@ irqreturn_t s3c_camif_irq_handler(int irq, void *priv)
!list_empty(&vp->active_buf_q)) {
unsigned int index;
struct camif_buffer *vbuf;
- struct timeval *tv;
- struct timespec ts;
/*
* Get previous DMA write buffer index:
* 0 => DMA buffer 0, 2;
* 1 => DMA buffer 1, 3.
*/
index = (CISTATUS_FRAMECNT(status) + 2) & 1;
-
- ktime_get_ts(&ts);
vbuf = camif_active_queue_peek(vp, index);
if (!WARN_ON(vbuf == NULL)) {
/* Dequeue a filled buffer */
- tv = &vbuf->vb.v4l2_buf.timestamp;
- tv->tv_sec = ts.tv_sec;
- tv->tv_usec = ts.tv_nsec / NSEC_PER_USEC;
+ v4l2_get_timestamp(&vbuf->vb.v4l2_buf.timestamp);
vbuf->vb.v4l2_buf.sequence = vp->frame_sequence++;
vb2_buffer_done(&vbuf->vb, VB2_BUF_STATE_DONE);