diff options
author | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2012-11-13 21:35:22 +0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-03-31 18:01:44 +0400 |
commit | 8d274e7c0a111e91a7a3f25877af8103ddf05261 (patch) | |
tree | ff8c2c861016337dd5eb306e008cf251261bf22d | |
parent | 3e20c345a6dac13a1545bd748f9d0a6336856ee7 (diff) | |
download | linux-8d274e7c0a111e91a7a3f25877af8103ddf05261.tar.xz |
[media] s5p-fimc: Ensure proper s_stream() call order in the ISP datapaths
Since the FIMC-IS firmware communicates with an image sensor directly
through the ISP I2C bus controllers data streaming cannot be simply
enabled from left to right or disabled from right to left along the
processing pipeline. Thus a subdev index to call s_stream() on is
looked up from a table, rather than doing the op call based on
increasing/decreasing indexes.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/platform/s5p-fimc/fimc-mdevice.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/drivers/media/platform/s5p-fimc/fimc-mdevice.c b/drivers/media/platform/s5p-fimc/fimc-mdevice.c index e7164ce373db..b22489907295 100644 --- a/drivers/media/platform/s5p-fimc/fimc-mdevice.c +++ b/drivers/media/platform/s5p-fimc/fimc-mdevice.c @@ -225,28 +225,36 @@ static int __fimc_pipeline_close(struct fimc_pipeline *p) } /** - * __fimc_pipeline_s_stream - invoke s_stream on pipeline subdevs + * __fimc_pipeline_s_stream - call s_stream() on pipeline subdevs * @pipeline: video pipeline structure - * @on: passed as the s_stream call argument + * @on: passed as the s_stream() callback argument */ static int __fimc_pipeline_s_stream(struct fimc_pipeline *p, bool on) { - int i, ret; + static const u8 seq[2][IDX_MAX] = { + { IDX_FIMC, IDX_SENSOR, IDX_IS_ISP, IDX_CSIS, IDX_FLITE }, + { IDX_CSIS, IDX_FLITE, IDX_FIMC, IDX_SENSOR, IDX_IS_ISP }, + }; + int i, ret = 0; if (p->subdevs[IDX_SENSOR] == NULL) return -ENODEV; for (i = 0; i < IDX_MAX; i++) { - unsigned int idx = on ? (IDX_MAX - 1) - i : i; + unsigned int idx = seq[on][i]; ret = v4l2_subdev_call(p->subdevs[idx], video, s_stream, on); if (ret < 0 && ret != -ENOIOCTLCMD && ret != -ENODEV) - return ret; + goto error; } - return 0; - +error: + for (; i >= 0; i--) { + unsigned int idx = seq[on][i]; + v4l2_subdev_call(p->subdevs[idx], video, s_stream, !on); + } + return ret; } /* Media pipeline operations for the FIMC/FIMC-LITE video device driver */ |