[PATCH v12 68/86] media: ipu6: Stream number on CSI-2 receiver source pads is always 0

Sakari Ailus
2026-04-09T20:15:10Z

The stream number on the video nodes' single pad is always 0, thus the
stream number of the CSI-2 receivers' source pads is also 0. Remove the
complexity that is there to come up with 0.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
.../media/pci/intel/ipu6/ipu6-isys-video.c | 49 ++-----------------
1 file changed, 5 insertions(+), 44 deletions(-)

diff --git a/drivers/media/pci/intel/ipu6/ipu6-isys-video.c b/drivers/media/pci/intel/ipu6/ipu6-isys-video.c
index b6f2ef0822a7..164000985c0d 100644
--- a/drivers/media/pci/intel/ipu6/ipu6-isys-video.c
+++ b/drivers/media/pci/intel/ipu6/ipu6-isys-video.c
@@ -967,66 +967,27 @@ ipu6_isys_query_stream_by_source(struct ipu6_isys *isys, int source, u8 vc)
return stream;
}

-static u64 get_stream_mask_by_pipeline(struct ipu6_isys_video *__av)
-{
- struct media_pipeline *pipeline =
- media_entity_pipeline(&__av->vdev.entity);
- unsigned int i;
- u64 stream_mask = 0;
-
- for (i = 0; i < NR_OF_CSI2_SRC_PADS; i++) {
- struct ipu6_isys_video *av = &__av->csi2->av[i];
-
- if (pipeline == media_entity_pipeline(&av->vdev.entity))
- stream_mask |= BIT_ULL(av->source_stream);
- }
-
- return stream_mask;
-}
-
int ipu6_isys_video_set_streaming(struct ipu6_isys_video *av, int state)
{
- struct v4l2_subdev_krouting *routing;
- struct ipu6_isys_stream *stream = av->stream;
- struct v4l2_subdev_state *subdev_state;
struct device *dev = &av->isys->adev->auxdev.dev;
struct v4l2_subdev *sd;
struct media_pad *r_pad;
- u32 sink_pad, sink_stream;
- u64 r_stream;
- u64 stream_mask = 0;
int ret = 0;

- dev_dbg(dev, "set stream: %d\n", state);
-
- sd = &stream->asd->sd;
+ sd = &av->stream->asd->sd;
r_pad = media_pad_remote_pad_first(&av->pad);
- r_stream = ipu6_isys_get_src_stream_by_src_pad(sd, r_pad->index);
-
- subdev_state = v4l2_subdev_lock_and_get_active_state(sd);
- routing = &subdev_state->routing;
- ret = v4l2_subdev_routing_find_opposite_end(routing, r_pad->index,
- r_stream, &sink_pad,
- &sink_stream);
- v4l2_subdev_unlock_state(subdev_state);
- if (ret)
- return ret;

- stream_mask = get_stream_mask_by_pipeline(av);
if (!state) {
/* stop sub-device which connects with video */
- dev_dbg(dev, "stream off entity %s pad:%d mask:0x%llx\n",
- sd->name, r_pad->index, stream_mask);
- ret = v4l2_subdev_disable_streams(sd, r_pad->index,
- stream_mask);
+ dev_dbg(dev, "stream off %s pad:%d\n", sd->name, r_pad->index);
+ ret = v4l2_subdev_disable_streams(sd, r_pad->index, 1);
if (ret)
dev_err(dev, "stream off %s failed with %d\n", sd->name,
ret);
} else {
/* start sub-device which connects with video */
- dev_dbg(dev, "stream on %s pad %d mask 0x%llx\n", sd->name,
- r_pad->index, stream_mask);
- ret = v4l2_subdev_enable_streams(sd, r_pad->index, stream_mask);
+ dev_dbg(dev, "stream on %s pad %d\n", sd->name, r_pad->index);
+ ret = v4l2_subdev_enable_streams(sd, r_pad->index, 1);
if (ret)
dev_err(dev, "stream on %s failed with %d\n", sd->name,
ret);
--
2.47.3