Commit 61c699bf authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab

media: imx: imx7-media-csi: Create immutable link to capture device

The i.MX7 camera pipeline is simple, with the CSI connected directly to
the capture device without any other option. There's thus no need to
allow link configurable by userspace. Make it immutable.
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 fbd36bce
......@@ -166,8 +166,6 @@ struct imx7_csi {
struct v4l2_subdev *src_sd;
struct media_entity *sink;
struct v4l2_mbus_framefmt format_mbus[IMX7_CSI_PADS_NUM];
const struct imx_media_pixfmt *cc[IMX7_CSI_PADS_NUM];
struct v4l2_fract frame_interval[IMX7_CSI_PADS_NUM];
......@@ -450,19 +448,6 @@ static int imx7_csi_link_setup(struct media_entity *entity,
} else {
csi->src_sd = NULL;
}
goto unlock;
}
/* source pad */
if (flags & MEDIA_LNK_FL_ENABLED) {
if (csi->sink) {
ret = -EBUSY;
goto unlock;
}
csi->sink = remote->entity;
} else {
csi->sink = NULL;
}
unlock:
......@@ -842,7 +827,7 @@ static int imx7_csi_s_stream(struct v4l2_subdev *sd, int enable)
mutex_lock(&csi->lock);
if (!csi->src_sd || !csi->sink) {
if (!csi->src_sd) {
ret = -EPIPE;
goto out_unlock;
}
......@@ -1091,7 +1076,8 @@ static int imx7_csi_registered(struct v4l2_subdev *sd)
if (IS_ERR(csi->vdev))
return PTR_ERR(csi->vdev);
ret = imx_media_capture_device_register(csi->vdev, 0);
ret = imx_media_capture_device_register(csi->vdev,
MEDIA_LNK_FL_IMMUTABLE);
if (ret)
imx_media_capture_device_remove(csi->vdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment