public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/2] media: imx: imx7-media-csi: Move stepwise framesize into a dedicated struct
@ 2023-07-20  7:41 Alexander Stein
  2023-07-20  7:41 ` [PATCH 2/2] media: imx: imx7-media-csi: Fix applying format constraints Alexander Stein
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Stein @ 2023-07-20  7:41 UTC (permalink / raw)
  To: Rui Miguel Silva, Laurent Pinchart, Mauro Carvalho Chehab,
	Shawn Guo, Sascha Hauer, Fabio Estevam, Tim Harvey
  Cc: Alexander Stein, Pengutronix Kernel Team, NXP Linux Team,
	linux-media, linux-arm-kernel

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(-)

diff --git a/drivers/media/platform/nxp/imx7-media-csi.c b/drivers/media/platform/nxp/imx7-media-csi.c
index 2f9302fc7570..73f8f2a35422 100644
--- a/drivers/media/platform/nxp/imx7-media-csi.c
+++ b/drivers/media/platform/nxp/imx7-media-csi.c
@@ -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;
 }
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-07-20 16:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-20  7:41 [PATCH 1/2] media: imx: imx7-media-csi: Move stepwise framesize into a dedicated struct Alexander Stein
2023-07-20  7:41 ` [PATCH 2/2] media: imx: imx7-media-csi: Fix applying format constraints Alexander Stein
2023-07-20 10:19   ` Alexander Stein
2023-07-20 16:43   ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox