@@ -260,6 +260,20 @@ imx7_csi_notifier_to_dev(struct v4l2_async_notifier *n)
return container_of(n, struct imx7_csi, notifier);
}
+/*
+ * TODO: The constraints are hardware-specific and may depend on the
+ * pixel format. This should come from the driver using
+ * imx_media_capture.
+ */
+static const struct v4l2_frmsize_stepwise imx7_csi_frmsize_stepwise = {
+ .min_width = 1,
+ .min_height = 1,
+ .max_width = 65535,
+ .max_height = 65535,
+ .step_width = 1,
+ .step_height = 1,
+};
+
/* -----------------------------------------------------------------------------
* Hardware Configuration
*/
@@ -1082,18 +1096,8 @@ static int imx7_csi_video_enum_framesizes(struct file *file, void *fh,
if (!cc)
return -EINVAL;
- /*
- * TODO: The constraints are hardware-specific and may depend on the
- * pixel format. This should come from the driver using
- * imx_media_capture.
- */
fsize->type = V4L2_FRMSIZE_TYPE_CONTINUOUS;
- fsize->stepwise.min_width = 1;
- fsize->stepwise.max_width = 65535;
- fsize->stepwise.min_height = 1;
- fsize->stepwise.max_height = 65535;
- fsize->stepwise.step_width = 1;
- fsize->stepwise.step_height = 1;
+ fsize->stepwise = imx7_csi_frmsize_stepwise;
return 0;
}
This way these constraints can be reused later on. No functional change intended. Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> --- drivers/media/platform/nxp/imx7-media-csi.c | 26 ++++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-)