From 071b6860d6c6d07f338fc01927657d59e3434a82 Mon Sep 17 00:00:00 2001 From: liuxl0327 Date: Mon, 21 Mar 2022 13:58:07 +0800 Subject: [PATCH] v4l2: ov5640 support multi stream on Signed-off-by: mason.huo --- drivers/media/platform/starfive/v4l2_driver/ov5640.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) mode change 100755 => 100644 drivers/media/platform/starfive/v4l2_driver/ov5640.c diff --git a/drivers/media/platform/starfive/v4l2_driver/ov5640.c b/drivers/media/platform/starfive/v4l2_driver/ov5640.c old mode 100755 new mode 100644 index b1256941..b71bf65 --- a/drivers/media/platform/starfive/v4l2_driver/ov5640.c +++ b/drivers/media/platform/starfive/v4l2_driver/ov5640.c @@ -258,7 +258,7 @@ struct ov5640_dev { u32 ae_low, ae_high, ae_target; bool pending_mode_change; - bool streaming; + int streaming; }; static inline struct ov5640_dev *to_ov5640_dev(struct v4l2_subdev *sd) @@ -2957,9 +2957,11 @@ static int ov5640_s_stream(struct v4l2_subdev *sd, int enable) else ret = ov5640_set_stream_dvp(sensor, enable); - if (!ret) - sensor->streaming = enable; + if (ret) + goto out; } + sensor->streaming += enable ? 1 : -1; + WARN_ON(sensor->streaming < 0); out: mutex_unlock(&sensor->lock); return ret; -- 2.7.4