[PATCH 21/21] media: i2c: it6625: use enable_streams and disable_streams
From: Hermes Wu via B4 Relay
Date: Fri Sep 18 2026 - 05:04:01 EST
From: Hermes Wu <Hermes.wu@xxxxxxxxxx>
The .s_stream video op is deprecated; add .enable_streams()/
.disable_streams() pad ops instead and keep v4l2_subdev_s_stream_helper
for legacy .s_stream callers, matching the same-device-class precedent
in lt6911uxe.c.
it6625_enable_streams()/it6625_disable_streams() call
it6625_enable_stream_locked() directly rather than the removed
lock-taking it6625_enable_stream() wrapper: v4l2_subdev_enable_streams()/
disable_streams() already lock the active state -- and hence
it6625_lock, shared as sd->state_lock since the previous change --
before calling into these ops.
Do not set V4L2_SUBDEV_FL_STREAMS: this device has a single,
non-multiplexed source pad, so the core's implicit stream 0 is
sufficient and v4l2_subdev_s_stream_helper() already handles that case
without it. Error handling is unchanged from the locked helper these
ops now call directly, so streaming failures are reported to the core
instead of being silently absorbed.
Signed-off-by: Hermes Wu <Hermes.wu@xxxxxxxxxx>
---
drivers/media/i2c/it6625.c | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/drivers/media/i2c/it6625.c b/drivers/media/i2c/it6625.c
index 550eb95c6f74a81fc11cc055b4590159ac50e969..680f27a4587eccfb863bb091c1dede290e57e909 100644
--- a/drivers/media/i2c/it6625.c
+++ b/drivers/media/i2c/it6625.c
@@ -936,12 +936,6 @@ static int it6625_enable_stream_locked(struct it6625 *it6625, bool enable)
return it6625_update_config(it6625);
}
-static int it6625_enable_stream(struct it6625 *it6625, bool enable)
-{
- guard(mutex)(&it6625->it6625_lock);
- return it6625_enable_stream_locked(it6625, enable);
-}
-
static int it6625_set_mipi_config_locked(struct it6625 *it6625, u32 cfg_val)
{
u8 mipi_data_type;
@@ -1503,11 +1497,22 @@ static int it6625_dv_timings_cap(struct v4l2_subdev *sd,
return 0;
}
-static int it6625_s_stream(struct v4l2_subdev *sd, int enable)
+static int it6625_enable_streams(struct v4l2_subdev *sd,
+ struct v4l2_subdev_state *state,
+ u32 pad, u64 streams_mask)
+{
+ struct it6625 *it6625 = sd_to_6625(sd);
+
+ return it6625_enable_stream_locked(it6625, true);
+}
+
+static int it6625_disable_streams(struct v4l2_subdev *sd,
+ struct v4l2_subdev_state *state,
+ u32 pad, u64 streams_mask)
{
struct it6625 *it6625 = sd_to_6625(sd);
- return it6625_enable_stream(it6625, enable);
+ return it6625_enable_stream_locked(it6625, false);
}
static int it6625_enum_mbus_code(struct v4l2_subdev *sd,
@@ -1795,7 +1800,7 @@ static const struct v4l2_subdev_core_ops it6625_core_ops = {
static const struct v4l2_subdev_video_ops it6625_video_ops = {
.g_input_status = it6625_g_input_status,
- .s_stream = it6625_s_stream,
+ .s_stream = v4l2_subdev_s_stream_helper,
};
static const struct v4l2_subdev_pad_ops it6625_pad_ops = {
@@ -1810,6 +1815,8 @@ static const struct v4l2_subdev_pad_ops it6625_pad_ops = {
.s_dv_timings = it6625_pad_s_dv_timings,
.g_dv_timings = it6625_pad_g_dv_timings,
.query_dv_timings = it6625_pad_query_dv_timings,
+ .enable_streams = it6625_enable_streams,
+ .disable_streams = it6625_disable_streams,
};
static const struct v4l2_subdev_ops it6625_ops = {
--
2.34.1