@@ -1266,7 +1266,8 @@ static int prp_registered(struct v4l2_subdev *sd)
priv->vdev = imx_media_capture_device_init(ic_priv->ipu_dev,
&ic_priv->sd,
- PRPENCVF_SRC_PAD, true);
+ PRPENCVF_SRC_PAD, true,
+ DEVICE_TYPE_IMX56);
if (IS_ERR(priv->vdev))
return PTR_ERR(priv->vdev);
@@ -34,6 +34,7 @@ struct capture_priv {
struct imx_media_video_dev vdev; /* Video device */
struct media_pad vdev_pad; /* Video device pad */
+ enum imx_media_device_type type; /* Type of hardware implementation */
struct v4l2_subdev *src_sd; /* Source subdev */
int src_sd_pad; /* Source subdev pad */
@@ -957,7 +958,8 @@ EXPORT_SYMBOL_GPL(imx_media_capture_device_unregister);
struct imx_media_video_dev *
imx_media_capture_device_init(struct device *dev, struct v4l2_subdev *src_sd,
- int pad, bool legacy_api)
+ int pad, bool legacy_api,
+ enum imx_media_device_type type)
{
struct capture_priv *priv;
struct video_device *vfd;
@@ -972,6 +974,7 @@ imx_media_capture_device_init(struct device *dev, struct v4l2_subdev *src_sd,
priv->src_sd_pad = pad;
priv->dev = dev;
priv->legacy_api = legacy_api;
+ priv->type = type;
mutex_init(&priv->mutex);
INIT_LIST_HEAD(&priv->ready_q);
@@ -1804,7 +1804,8 @@ static int csi_registered(struct v4l2_subdev *sd)
}
priv->vdev = imx_media_capture_device_init(priv->sd.dev, &priv->sd,
- CSI_SRC_PAD_IDMAC, true);
+ CSI_SRC_PAD_IDMAC, true,
+ DEVICE_TYPE_IMX56);
if (IS_ERR(priv->vdev)) {
ret = PTR_ERR(priv->vdev);
goto free_fim;
@@ -96,6 +96,11 @@ enum imx_pixfmt_sel {
PIXFMT_SEL_ANY = PIXFMT_SEL_YUV | PIXFMT_SEL_RGB | PIXFMT_SEL_BAYER,
};
+enum imx_media_device_type {
+ DEVICE_TYPE_IMX56,
+ DEVICE_TYPE_IMX78,
+};
+
struct imx_media_buffer {
struct vb2_v4l2_buffer vbuf; /* v4l buffer must be first */
struct list_head list;
@@ -282,7 +287,8 @@ int imx_media_ic_unregister(struct v4l2_subdev *sd);
/* imx-media-capture.c */
struct imx_media_video_dev *
imx_media_capture_device_init(struct device *dev, struct v4l2_subdev *src_sd,
- int pad, bool legacy_api);
+ int pad, bool legacy_api,
+ enum imx_media_device_type type);
void imx_media_capture_device_remove(struct imx_media_video_dev *vdev);
int imx_media_capture_device_register(struct imx_media_video_dev *vdev,
u32 link_flags);
@@ -1063,7 +1063,8 @@ static int imx7_csi_registered(struct v4l2_subdev *sd)
}
csi->vdev = imx_media_capture_device_init(csi->sd.dev, &csi->sd,
- IMX7_CSI_PAD_SRC, false);
+ IMX7_CSI_PAD_SRC, false,
+ DEVICE_TYPE_IMX78);
if (IS_ERR(csi->vdev))
return PTR_ERR(csi->vdev);