aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/platform/soc_camera
diff options
context:
space:
mode:
authorJavier Martin <javier.martin@vista-silicon.com>2012-10-30 11:29:00 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-12-20 14:38:03 -0200
commit6ec5575c381de50b17e68796435f20ce1b27de79 (patch)
tree2e645ba0f89f9965a94f0cdce7b0092769b54479 /drivers/media/platform/soc_camera
parentb618b69c108b4fa792ff3dfe1ea95eeca7bc6af8 (diff)
[media] media: mx2_camera: Add image size HW limits
The CSI on i.MX27 has some constraints regarding image width. This patch makes sure those requirements are met in try_fmt(). Signed-off-by: Javier Martin <javier.martin@vista-silicon.com> [g.liakhovetski@gmx.de: make constraint i.MX27-specific] Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/platform/soc_camera')
-rw-r--r--drivers/media/platform/soc_camera/mx2_camera.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/media/platform/soc_camera/mx2_camera.c b/drivers/media/platform/soc_camera/mx2_camera.c
index 77529f86038..2c148028d8c 100644
--- a/drivers/media/platform/soc_camera/mx2_camera.c
+++ b/drivers/media/platform/soc_camera/mx2_camera.c
@@ -1394,8 +1394,6 @@ static int mx2_camera_try_fmt(struct soc_camera_device *icd,
return -EINVAL;
}
- /* FIXME: implement MX27 limits */
-
/* limit to MX25 hardware capabilities */
if (cpu_is_mx25()) {
if (xlate->host_fmt->bits_per_sample <= 8)
@@ -1427,6 +1425,12 @@ static int mx2_camera_try_fmt(struct soc_camera_device *icd,
pix->sizeimage = soc_mbus_image_size(xlate->host_fmt,
pix->bytesperline, pix->height);
}
+ } else {
+ /*
+ * Width must be a multiple of 8 as requested by the CSI.
+ * (Table 39-2 in the i.MX27 Reference Manual).
+ */
+ pix->width &= ~0x7;
}
/* limit to sensor capabilities */