From 5df567a0d450559621465e0a0032c26fa7cd21c2 Mon Sep 17 00:00:00 2001 From: Sylwester Nawrocki Date: Tue, 13 Nov 2012 14:35:22 -0300 Subject: [PATCH] --- yaml --- r: 366927 b: refs/heads/master c: 8d274e7c0a111e91a7a3f25877af8103ddf05261 h: refs/heads/master i: 366925: 43472d148e575f95c21571c88d88c7f2fb5bf4e5 366923: a562bd9d347669c1fe5911acf299a3c73b968ade 366919: e77a55dbb37478411534bc8014733788f28d84d7 366911: d9351b92f0759883d3820295b72309903f79efa4 v: v3 --- [refs] | 2 +- .../media/platform/s5p-fimc/fimc-mdevice.c | 22 +++++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 518a6849522d..1a955d0647a3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3e20c345a6dac13a1545bd748f9d0a6336856ee7 +refs/heads/master: 8d274e7c0a111e91a7a3f25877af8103ddf05261 diff --git a/trunk/drivers/media/platform/s5p-fimc/fimc-mdevice.c b/trunk/drivers/media/platform/s5p-fimc/fimc-mdevice.c index e7164ce373db..b22489907295 100644 --- a/trunk/drivers/media/platform/s5p-fimc/fimc-mdevice.c +++ b/trunk/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 */