Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6ac939c0 authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Mauro Carvalho Chehab
Browse files

[media] V4L: sh-mobile-ceu-camera: fix mixed CSI2 & parallel camera case



The current sh_mobile_ceu_camera driver can cause an Oops, if a CSI2 and a
parallel camera are registered on the same CEU. Fix it by making CSI2
association with a camera more targeted.

Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 377c9ba7
Loading
Loading
Loading
Loading
+6 −3
Original line number Original line Diff line number Diff line
@@ -717,10 +717,13 @@ static void capture_restore(struct sh_mobile_ceu_dev *pcdev, u32 capsr)
static struct v4l2_subdev *find_bus_subdev(struct sh_mobile_ceu_dev *pcdev,
static struct v4l2_subdev *find_bus_subdev(struct sh_mobile_ceu_dev *pcdev,
					   struct soc_camera_device *icd)
					   struct soc_camera_device *icd)
{
{
	if (!pcdev->csi2_pdev)
	if (pcdev->csi2_pdev) {
		return soc_camera_to_subdev(icd);
		struct v4l2_subdev *csi2_sd = find_csi2(pcdev);
		if (csi2_sd && csi2_sd->grp_id == (u32)icd)
			return csi2_sd;
	}


	return find_csi2(pcdev);
	return soc_camera_to_subdev(icd);
}
}


#define CEU_BUS_FLAGS (V4L2_MBUS_MASTER |	\
#define CEU_BUS_FLAGS (V4L2_MBUS_MASTER |	\