Commit dbedd2f4 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab
Browse files

media: v4l2-mc: Add link flags to v4l2_create_fwnode_links_to_pad()



Add a flags argument to the v4l2_create_fwnode_links_to_pad() function
to specify the link flags. This allows drivers to create immutable links
for instance.

Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarRui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 42849cf0
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -310,7 +310,7 @@ int v4l_vb2q_enable_media_source(struct vb2_queue *q)
EXPORT_SYMBOL_GPL(v4l_vb2q_enable_media_source);

int v4l2_create_fwnode_links_to_pad(struct v4l2_subdev *src_sd,
				    struct media_pad *sink)
				    struct media_pad *sink, u32 flags)
{
	struct fwnode_handle *endpoint;
	struct v4l2_subdev *sink_sd;
@@ -367,7 +367,7 @@ int v4l2_create_fwnode_links_to_pad(struct v4l2_subdev *src_sd,
			sink_sd->entity.name, sink_idx);

		ret = media_create_pad_link(&src_sd->entity, src_idx,
					    &sink_sd->entity, sink_idx, 0);
					    &sink_sd->entity, sink_idx, flags);
		if (ret) {
			dev_err(sink_sd->dev,
				"link %s:%d -> %s:%d failed with %d\n",
@@ -395,7 +395,7 @@ int v4l2_create_fwnode_links(struct v4l2_subdev *src_sd,
		if (!(pad->flags & MEDIA_PAD_FL_SINK))
			continue;

		ret = v4l2_create_fwnode_links_to_pad(src_sd, pad);
		ret = v4l2_create_fwnode_links_to_pad(src_sd, pad, 0);
		if (ret)
			return ret;
	}
+1 −1
Original line number Diff line number Diff line
@@ -1894,7 +1894,7 @@ static int imx_csi_notify_bound(struct v4l2_async_notifier *notifier,
	if (sd->entity.function == MEDIA_ENT_F_VID_MUX)
		sd->grp_id = IMX_MEDIA_GRP_ID_CSI_MUX;

	return v4l2_create_fwnode_links_to_pad(sd, sink);
	return v4l2_create_fwnode_links_to_pad(sd, sink, 0);
}

static const struct v4l2_async_notifier_operations csi_notify_ops = {
+1 −1
Original line number Diff line number Diff line
@@ -621,7 +621,7 @@ static int csi2_notify_bound(struct v4l2_async_notifier *notifier,

	dev_dbg(csi2->dev, "Bound %s pad: %d\n", sd->name, pad);

	return v4l2_create_fwnode_links_to_pad(sd, sink);
	return v4l2_create_fwnode_links_to_pad(sd, sink, 0);
}

static void csi2_notify_unbind(struct v4l2_async_notifier *notifier,
+1 −1
Original line number Diff line number Diff line
@@ -1128,7 +1128,7 @@ static int imx7_csi_notify_bound(struct v4l2_async_notifier *notifier,
	if (sd->entity.function == MEDIA_ENT_F_VID_MUX)
		sd->grp_id = IMX_MEDIA_GRP_ID_CSI_MUX;

	return v4l2_create_fwnode_links_to_pad(sd, sink);
	return v4l2_create_fwnode_links_to_pad(sd, sink, 0);
}

static const struct v4l2_async_notifier_operations imx7_csi_notify_ops = {
+1 −1
Original line number Diff line number Diff line
@@ -962,7 +962,7 @@ static int mipi_csis_notify_bound(struct v4l2_async_notifier *notifier,
	struct csi_state *state = mipi_notifier_to_csis_state(notifier);
	struct media_pad *sink = &state->mipi_sd.entity.pads[CSIS_PAD_SINK];

	return v4l2_create_fwnode_links_to_pad(sd, sink);
	return v4l2_create_fwnode_links_to_pad(sd, sink, 0);
}

static const struct v4l2_async_notifier_operations mipi_csis_notify_ops = {
Loading