From 7e1db599b99655af2b2cbeaf14aab1a07d84fc6d Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Sat, 4 Mar 2017 04:52:40 -0500 Subject: media: omap3isp: csiphy: Don't assume the CSI receiver is a CSI2 module The CSI PHY is associated with a CSI receiver. The code assumes this receiver is a CSI2 module and relies on the CSI2 module object heavily to access the ISP or pipeline objects. However, the receiver could also be a CSI1/CCP2 module. Pass a new CSI receiver entity pointer to the CSI PHY acquire function, and replace all hardcoded usage of the CSI2 module with that CSI receiver entity. Signed-off-by: Sakari Ailus Tested-by: Laurent Pinchart # on Beagleboard-xM + MPT9P031 Acked-by: Pavel Machek Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/omap3isp/ispcsi2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/media/platform/omap3isp/ispcsi2.c') diff --git a/drivers/media/platform/omap3isp/ispcsi2.c b/drivers/media/platform/omap3isp/ispcsi2.c index 7dae2fe0d42d..3ec37fed710b 100644 --- a/drivers/media/platform/omap3isp/ispcsi2.c +++ b/drivers/media/platform/omap3isp/ispcsi2.c @@ -490,7 +490,7 @@ int omap3isp_csi2_reset(struct isp_csi2_device *csi2) if (!csi2->available) return -ENODEV; - if (csi2->phy->phy_in_use) + if (csi2->phy->entity) return -EBUSY; isp_reg_set(isp, csi2->regs1, ISPCSI2_SYSCONFIG, @@ -1053,7 +1053,7 @@ static int csi2_set_stream(struct v4l2_subdev *sd, int enable) switch (enable) { case ISP_PIPELINE_STREAM_CONTINUOUS: - if (omap3isp_csiphy_acquire(csi2->phy) < 0) + if (omap3isp_csiphy_acquire(csi2->phy, &sd->entity) < 0) return -ENODEV; if (csi2->output & CSI2_OUTPUT_MEMORY) omap3isp_sbl_enable(isp, OMAP3_ISP_SBL_CSI2A_WRITE); -- cgit v1.2.3-55-g7522