diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2011-08-22 11:35:09 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-11-03 16:28:21 -0400 |
commit | 6ac939c06f34eaba2bc4b3be1d7f6bf26f629a23 (patch) | |
tree | c091533995478e2bf09f53168ada290b0b7f473f /drivers/media | |
parent | 377c9ba772b0c3f848c12810231eb103aad473eb (diff) |
[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: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/sh_mobile_ceu_camera.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/media/video/sh_mobile_ceu_camera.c b/drivers/media/video/sh_mobile_ceu_camera.c index 59101c0be869..5c8ddd821df6 100644 --- a/drivers/media/video/sh_mobile_ceu_camera.c +++ b/drivers/media/video/sh_mobile_ceu_camera.c | |||
@@ -717,10 +717,13 @@ static void capture_restore(struct sh_mobile_ceu_dev *pcdev, u32 capsr) | |||
717 | static struct v4l2_subdev *find_bus_subdev(struct sh_mobile_ceu_dev *pcdev, | 717 | static struct v4l2_subdev *find_bus_subdev(struct sh_mobile_ceu_dev *pcdev, |
718 | struct soc_camera_device *icd) | 718 | struct soc_camera_device *icd) |
719 | { | 719 | { |
720 | if (!pcdev->csi2_pdev) | 720 | if (pcdev->csi2_pdev) { |
721 | return soc_camera_to_subdev(icd); | 721 | struct v4l2_subdev *csi2_sd = find_csi2(pcdev); |
722 | if (csi2_sd && csi2_sd->grp_id == (u32)icd) | ||
723 | return csi2_sd; | ||
724 | } | ||
722 | 725 | ||
723 | return find_csi2(pcdev); | 726 | return soc_camera_to_subdev(icd); |
724 | } | 727 | } |
725 | 728 | ||
726 | #define CEU_BUS_FLAGS (V4L2_MBUS_MASTER | \ | 729 | #define CEU_BUS_FLAGS (V4L2_MBUS_MASTER | \ |