summaryrefslogtreecommitdiffstats
path: root/drivers/staging/media/omap4iss/iss_csi2.c
diff options
context:
space:
mode:
authorJavier Martinez Canillas2015-09-02 16:28:08 +0200
committerMauro Carvalho Chehab2016-01-11 15:18:45 +0100
commit5837ceea11ca11339e49947aacbccb62f3646993 (patch)
treec0dbe7166995c5a33fcb609c2ac01e4160fdac06 /drivers/staging/media/omap4iss/iss_csi2.c
parent[media] omap3isp: create links after all subdevs have been bound (diff)
downloadkernel-qcow2-linux-5837ceea11ca11339e49947aacbccb62f3646993.tar.gz
kernel-qcow2-linux-5837ceea11ca11339e49947aacbccb62f3646993.tar.xz
kernel-qcow2-linux-5837ceea11ca11339e49947aacbccb62f3646993.zip
[media] staging: omap4iss: separate links creation from entities init
The omap4iss driver initializes the entities and creates the pads links before the entities are registered with the media device. This does not work now that object IDs are used to create links so the media_device has to be set. Split out the pads links creation from the entity initialization so are made after the entities registration. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/staging/media/omap4iss/iss_csi2.c')
-rw-r--r--drivers/staging/media/omap4iss/iss_csi2.c35
1 files changed, 27 insertions, 8 deletions
diff --git a/drivers/staging/media/omap4iss/iss_csi2.c b/drivers/staging/media/omap4iss/iss_csi2.c
index c6eb5a7a593f..13878a275277 100644
--- a/drivers/staging/media/omap4iss/iss_csi2.c
+++ b/drivers/staging/media/omap4iss/iss_csi2.c
@@ -1290,16 +1290,8 @@ static int csi2_init_entities(struct iss_csi2_device *csi2, const char *subname)
if (ret < 0)
goto error_video;
- /* Connect the CSI2 subdev to the video node. */
- ret = media_create_pad_link(&csi2->subdev.entity, CSI2_PAD_SOURCE,
- &csi2->video_out.video.entity, 0, 0);
- if (ret < 0)
- goto error_link;
-
return 0;
-error_link:
- omap4iss_video_cleanup(&csi2->video_out);
error_video:
media_entity_cleanup(&csi2->subdev.entity);
return ret;
@@ -1342,6 +1334,33 @@ int omap4iss_csi2_init(struct iss_device *iss)
}
/*
+ * omap4iss_csi2_create_pads_links() - CSI2 pads links creation
+ * @iss: Pointer to ISS device
+ *
+ * return negative error code or zero on success
+ */
+int omap4iss_csi2_create_pads_links(struct iss_device *iss)
+{
+ struct iss_csi2_device *csi2a = &iss->csi2a;
+ struct iss_csi2_device *csi2b = &iss->csi2b;
+ int ret;
+
+ /* Connect the CSI2a subdev to the video node. */
+ ret = media_create_pad_link(&csi2a->subdev.entity, CSI2_PAD_SOURCE,
+ &csi2a->video_out.video.entity, 0, 0);
+ if (ret < 0)
+ return ret;
+
+ /* Connect the CSI2b subdev to the video node. */
+ ret = media_create_pad_link(&csi2b->subdev.entity, CSI2_PAD_SOURCE,
+ &csi2b->video_out.video.entity, 0, 0);
+ if (ret < 0)
+ return ret;
+
+ return 0;
+}
+
+/*
* omap4iss_csi2_cleanup - Routine for module driver cleanup
*/
void omap4iss_csi2_cleanup(struct iss_device *iss)