summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeata Michalska <b.michalska@samsung.com>2014-07-14 14:47:09 +0200
committerSylwester Nawrocki <s.nawrocki@samsung.com>2014-11-27 03:40:34 -0800
commit2cba66fe0cece42a68661a475fcc6e807259f676 (patch)
tree1a870aa92d44f916c3a8c9a1b8b7b7912bf7710a
parentdeaf90b018f621ab04860e4b2090b3e89b908682 (diff)
downloadlinux-3.10-2cba66fe0cece42a68661a475fcc6e807259f676.tar.gz
linux-3.10-2cba66fe0cece42a68661a475fcc6e807259f676.tar.bz2
linux-3.10-2cba66fe0cece42a68661a475fcc6e807259f676.zip
exynos: fimc-lite: Capture frame end event notification
This patch adds notifying v4l2 subdevs upon capture frame end event. Signed-off-by: Beata Michalska <b.michalska@samsung.com> Change-Id: Id3e81b4692a6f2cfc91ffde7050a3ae6db719971
-rw-r--r--drivers/media/platform/exynos4-is/fimc-lite.c37
-rw-r--r--include/media/s5p_fimc.h9
2 files changed, 29 insertions, 17 deletions
diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c b/drivers/media/platform/exynos4-is/fimc-lite.c
index 76a194119e7..7e41268749c 100644
--- a/drivers/media/platform/exynos4-is/fimc-lite.c
+++ b/drivers/media/platform/exynos4-is/fimc-lite.c
@@ -285,25 +285,28 @@ static irqreturn_t flite_irq_handler(int irq, void *priv)
if (atomic_read(&fimc->out_path) != FIMC_IO_DMA)
goto done;
- if ((intsrc & FLITE_REG_CISTATUS_IRQ_SRC_FRMSTART) &&
- test_bit(ST_FLITE_RUN, &fimc->state) &&
- !list_empty(&fimc->pending_buf_q)) {
- vbuf = fimc_lite_pending_queue_pop(fimc);
- flite_hw_set_dma_buffer(fimc, vbuf);
- fimc_lite_active_queue_add(fimc, vbuf);
+ if ((intsrc & FLITE_REG_CISTATUS_IRQ_SRC_FRMSTART)){
+ if (test_bit(ST_FLITE_RUN, &fimc->state) &&
+ !list_empty(&fimc->pending_buf_q)) {
+ vbuf = fimc_lite_pending_queue_pop(fimc);
+ flite_hw_set_dma_buffer(fimc, vbuf);
+ fimc_lite_active_queue_add(fimc, vbuf);
+ }
}
- if ((intsrc & FLITE_REG_CISTATUS_IRQ_SRC_FRMEND) &&
- test_bit(ST_FLITE_RUN, &fimc->state) &&
- !list_empty(&fimc->active_buf_q)) {
- vbuf = fimc_lite_active_queue_pop(fimc);
- ktime_get_ts(&ts);
- tv = &vbuf->vb.v4l2_buf.timestamp;
- tv->tv_sec = ts.tv_sec;
- tv->tv_usec = ts.tv_nsec / NSEC_PER_USEC;
- vbuf->vb.v4l2_buf.sequence = fimc->frame_count++;
- flite_hw_mask_dma_buffer(fimc, vbuf->index);
- vb2_buffer_done(&vbuf->vb, VB2_BUF_STATE_DONE);
+ if ((intsrc & FLITE_REG_CISTATUS_IRQ_SRC_FRMEND)) {
+ if (test_bit(ST_FLITE_RUN, &fimc->state) &&
+ !list_empty(&fimc->active_buf_q)) {
+ vbuf = fimc_lite_active_queue_pop(fimc);
+ ktime_get_ts(&ts);
+ tv = &vbuf->vb.v4l2_buf.timestamp;
+ tv->tv_sec = ts.tv_sec;
+ tv->tv_usec = ts.tv_nsec / NSEC_PER_USEC;
+ vbuf->vb.v4l2_buf.sequence = fimc->frame_count++;
+ flite_hw_mask_dma_buffer(fimc, vbuf->index);
+ vb2_buffer_done(&vbuf->vb, VB2_BUF_STATE_DONE);
+ }
+ v4l2_subdev_notify(&fimc->subdev, EXYNOS_FIMC_IS_FRAME_DONE, NULL);
}
if (test_bit(ST_FLITE_CONFIG, &fimc->state))
diff --git a/include/media/s5p_fimc.h b/include/media/s5p_fimc.h
index b975c285c8a..5fe54ed29b1 100644
--- a/include/media/s5p_fimc.h
+++ b/include/media/s5p_fimc.h
@@ -105,6 +105,15 @@ struct s5p_platform_fimc {
* at begining of the frame transmission.
*/
#define S5P_FIMC_TX_END_NOTIFY _IO('e', 0)
+/**
+ * v4l2_device notification id - provided for internal use only.
+ * Sensors subdevs might issue S5P_FIMC_FRAME_DONE notification
+ * whenever frame has been succesfully captured despite current
+ * capturing mode.
+ * Note: Invoramtive puspose only.
+ */
+#define EXYNOS_FIMC_IS_FRAME_DONE _IO('e', 1)
+
#define FIMC_MAX_PLANES 3