[2/4] media: mx2_camera: Add image size HW limits.
Commit Message
The CSI has some constraints regarding image with.
This patch makes sure those requirements are met
in try_fmt().
Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
---
drivers/media/platform/soc_camera/mx2_camera.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
@@ -1234,7 +1234,11 @@ static int mx2_camera_try_fmt(struct soc_camera_device *icd,
return -EINVAL;
}
- /* FIXME: implement MX27 limits */
+ /*
+ * With must be multiple of 8 as requested by the CSI.
+ * (Table 39-2 in the i.MX27 Reference Manual).
+ */
+ pix->width &= ~0x7;
/* limit to sensor capabilities */
mf.width = pix->width;