summaryrefslogtreecommitdiff
path: root/drivers/staging/media/dt3155v4l/dt3155v4l.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/media/dt3155v4l/dt3155v4l.c')
-rw-r--r--drivers/staging/media/dt3155v4l/dt3155v4l.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/staging/media/dt3155v4l/dt3155v4l.c b/drivers/staging/media/dt3155v4l/dt3155v4l.c
index e33b7f5..c32e0ac 100644
--- a/drivers/staging/media/dt3155v4l/dt3155v4l.c
+++ b/drivers/staging/media/dt3155v4l/dt3155v4l.c
@@ -26,6 +26,7 @@
#include <linux/slab.h>
#include <media/v4l2-dev.h>
#include <media/v4l2-ioctl.h>
+#include <media/v4l2-common.h>
#include <media/videobuf2-dma-contig.h>
#include "dt3155v4l.h"
@@ -341,7 +342,7 @@ dt3155_irq_handler_even(int irq, void *dev_id)
spin_lock(&ipd->lock);
if (ipd->curr_buf) {
- do_gettimeofday(&ipd->curr_buf->v4l2_buf.timestamp);
+ v4l2_get_timestamp(&ipd->curr_buf->v4l2_buf.timestamp);
ipd->curr_buf->v4l2_buf.sequence = (ipd->field_count) >> 1;
vb2_buffer_done(ipd->curr_buf, VB2_BUF_STATE_DONE);
}
@@ -390,6 +391,7 @@ dt3155_open(struct file *filp)
goto err_alloc_queue;
}
pd->q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ pd->q->timestamp_type = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
pd->q->io_modes = VB2_READ | VB2_MMAP;
pd->q->ops = &q_ops;
pd->q->mem_ops = &vb2_dma_contig_memops;
@@ -398,7 +400,7 @@ dt3155_open(struct file *filp)
pd->field_count = 0;
ret = vb2_queue_init(pd->q);
if (ret < 0)
- return ret;
+ goto err_request_irq;
INIT_LIST_HEAD(&pd->dmaq);
spin_lock_init(&pd->lock);
/* disable all irqs, clear all irq flags */
@@ -410,6 +412,7 @@ dt3155_open(struct file *filp)
goto err_request_irq;
}
pd->users++;
+ mutex_unlock(&pd->mux);
return 0; /* success */
err_request_irq:
kfree(pd->q);
@@ -612,9 +615,9 @@ dt3155_ioc_g_std(struct file *filp, void *p, v4l2_std_id *norm)
}
static int
-dt3155_ioc_s_std(struct file *filp, void *p, v4l2_std_id *norm)
+dt3155_ioc_s_std(struct file *filp, void *p, v4l2_std_id norm)
{
- if (*norm & DT3155_CURRENT_NORM)
+ if (norm & DT3155_CURRENT_NORM)
return 0;
return -EINVAL;
}