Commit 6ec5575c authored by Javier Martin's avatar Javier Martin Committed by Mauro Carvalho Chehab

[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: default avatarJavier Martin <javier.martin@vista-silicon.com>
[g.liakhovetski@gmx.de: make constraint i.MX27-specific]
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent b618b69c
...@@ -1394,8 +1394,6 @@ static int mx2_camera_try_fmt(struct soc_camera_device *icd, ...@@ -1394,8 +1394,6 @@ static int mx2_camera_try_fmt(struct soc_camera_device *icd,
return -EINVAL; return -EINVAL;
} }
/* FIXME: implement MX27 limits */
/* limit to MX25 hardware capabilities */ /* limit to MX25 hardware capabilities */
if (cpu_is_mx25()) { if (cpu_is_mx25()) {
if (xlate->host_fmt->bits_per_sample <= 8) if (xlate->host_fmt->bits_per_sample <= 8)
...@@ -1427,6 +1425,12 @@ static int mx2_camera_try_fmt(struct soc_camera_device *icd, ...@@ -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->sizeimage = soc_mbus_image_size(xlate->host_fmt,
pix->bytesperline, pix->height); 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 */ /* limit to sensor capabilities */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment