summaryrefslogtreecommitdiff
path: root/isp/omap3isp.c
diff options
context:
space:
mode:
Diffstat (limited to 'isp/omap3isp.c')
-rw-r--r--isp/omap3isp.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/isp/omap3isp.c b/isp/omap3isp.c
index 0c677b4..ed5094c 100644
--- a/isp/omap3isp.c
+++ b/isp/omap3isp.c
@@ -1001,6 +1001,7 @@ struct omap3_isp_device *omap3_isp_open(const char *devname,
return NULL;
memset(isp, 0, sizeof *isp);
+ isp->state = OMAP3_ISP_IDLE;
isp->ops = ops;
omap3_isp_pipeline_init(&isp->viewfinder);
@@ -1217,6 +1218,9 @@ int omap3_isp_viewfinder_start(struct omap3_isp_device *isp, unsigned int bufs)
unsigned int i;
int ret;
+ if (isp->state != OMAP3_ISP_IDLE)
+ return -EBUSY;
+
/* Setup the pipeline. */
ret = omap3_isp_viewfinder_setup_pipeline(isp);
if (ret < 0)
@@ -1260,6 +1264,7 @@ int omap3_isp_viewfinder_start(struct omap3_isp_device *isp, unsigned int bufs)
}
isp->viewfinder.state = OMAP3_ISP_PIPELINE_RUNNING;
+ isp->state = OMAP3_ISP_VIEWFINDER;
return 0;
}
@@ -1283,6 +1288,7 @@ int omap3_isp_viewfinder_stop(struct omap3_isp_device *isp)
omap3_isp_pool_stop(pool);
isp->viewfinder.state = OMAP3_ISP_PIPELINE_STOPPED;
+ isp->state = OMAP3_ISP_IDLE;
return 0;
}
@@ -1387,6 +1393,9 @@ int omap3_isp_snapshot_capture(struct omap3_isp_device *isp)
{
int ret;
+ if (isp->state != OMAP3_ISP_IDLE)
+ return -EBUSY;
+
/* Configure the pipeline. */
ret = omap3_isp_pipeline_activate(isp, &isp->snapshot);
if (ret < 0) {
@@ -1410,6 +1419,7 @@ int omap3_isp_snapshot_capture(struct omap3_isp_device *isp)
return ret;
}
+ isp->state = OMAP3_ISP_SNAPSHOT;
return 0;
}
@@ -1430,6 +1440,8 @@ int omap3_isp_snapshot_done(struct omap3_isp_device *isp)
return ret;
}
+ isp->state = OMAP3_ISP_IDLE;
+
/* Queue all buffers for the next snapshot. */
for (i = 0; i < isp->snapshot.output->video->nbufs; ++i) {
buffer.index = i;