[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250219-rcar-streams-v1-5-f1b93e370aab@ideasonboard.com>
Date: Wed, 19 Feb 2025 15:48:59 +0200
From: Tomi Valkeinen <tomi.valkeinen+renesas@...asonboard.com>
To: Niklas Söderlund <niklas.soderlund@...natech.se>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Sakari Ailus <sakari.ailus@...ux.intel.com>
Cc: linux-media@...r.kernel.org, linux-renesas-soc@...r.kernel.org,
linux-kernel@...r.kernel.org,
Niklas Söderlund <niklas.soderlund+renesas@...natech.se>,
Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Jacopo Mondi <jacopo.mondi@...asonboard.com>,
Tomi Valkeinen <tomi.valkeinen+renesas@...asonboard.com>
Subject: [PATCH 05/18] media: rcar-isp: Move {enable|disable}_streams()
calls
With multiple streams the operation to enable the ISP hardware and to
call {enable|disable}_streams() on upstream subdev will need to be
handled separately.
Prepare for that by moving {enable|disable}_streams() calls out from
risp_start() and risp_stop().
Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@...asonboard.com>
---
drivers/media/platform/renesas/rcar-isp.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/drivers/media/platform/renesas/rcar-isp.c b/drivers/media/platform/renesas/rcar-isp.c
index 46534a479201..8e222c9ec604 100644
--- a/drivers/media/platform/renesas/rcar-isp.c
+++ b/drivers/media/platform/renesas/rcar-isp.c
@@ -268,18 +268,11 @@ static int risp_start(struct rcar_isp *isp, struct v4l2_subdev_state *state)
/* Start ISP. */
risp_write(isp, ISPSTART_REG, ISPSTART_START);
- ret = v4l2_subdev_enable_streams(isp->remote, isp->remote_pad,
- BIT_ULL(0));
- if (ret)
- risp_power_off(isp);
-
- return ret;
+ return 0;
}
static void risp_stop(struct rcar_isp *isp)
{
- v4l2_subdev_disable_streams(isp->remote, isp->remote_pad, BIT_ULL(0));
-
/* Stop ISP. */
risp_write(isp, ISPSTART_REG, ISPSTART_STOP);
@@ -305,6 +298,13 @@ static int risp_enable_streams(struct v4l2_subdev *sd,
return ret;
}
+ ret = v4l2_subdev_enable_streams(isp->remote, isp->remote_pad,
+ BIT_ULL(0));
+ if (ret) {
+ risp_stop(isp);
+ return ret;
+ }
+
isp->stream_count += 1;
return ret;
@@ -322,6 +322,8 @@ static int risp_disable_streams(struct v4l2_subdev *sd,
if (!isp->remote)
return -ENODEV;
+ v4l2_subdev_disable_streams(isp->remote, isp->remote_pad, BIT_ULL(0));
+
if (isp->stream_count == 1)
risp_stop(isp);
--
2.43.0
Powered by blists - more mailing lists