From patchwork Thu Jul 20 07:41:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 13319953 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3A325EB64DD for ; Thu, 20 Jul 2023 07:42:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=6y8YJU2t5aSLQspgO+gMQtEHgnvAQ3mhP4bfyD5GIX4=; b=PmrDWTRsmMfqQ5 ZGSWI2YymH659WCjeM08hBASjzEEp+RHb6iqHpTKUl6Kzr2EZCTLyJdpCZus+89q5jSJu5EGJ/Fvp ZAw5NxcMnqZKvpXvwbucyWWnBvru9JOwBxBhLw3NKS+SMfg++mjpX/xlCZGNuwrkJMXYxmKU2eFk3 QlwQ6ITltsTo2A0qCdulg0YZpi3dTkbnXO7nHXjss3vXlyH5NTcCuuAXley0wN3qrea8bRKBeDoiP iG5CLgkAkKcnRXuRGj+iPv8GkrRhBw5zRaMvniBdXsW88bijjQk+vnpRB6WgCzc0FsMwTe5y0pNSR t8snbh+gLcC7EkjtlSYg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qMOID-00A9R4-0t; Thu, 20 Jul 2023 07:41:45 +0000 Received: from mx1.tq-group.com ([93.104.207.81]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qMOI9-00A9PG-2J for linux-arm-kernel@lists.infradead.org; Thu, 20 Jul 2023 07:41:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1689838901; x=1721374901; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=cXY/BLZfaDuNi5P3IqCRO4cP4HDGKE/2ag+TBekzt7g=; b=kft+6grxy5w2dVEb2kTg2TjUf1LivJ6fREpDEPlviAhTYecS++jsdrW2 /ck6F9+o70fgx/O0Qy0XCgYERNTu/vaUE0xrDuGvva0U1llIejkiis/M2 8o7YutktD1eHBiINOMvSE24SHYTO8j82G0A5K4Myefr+KNsRvafbalQIb wJqc8jjfAgkWst2I7BoUveITs29Hx1RDZ9QCMmCdoklUqNxpeBj2FCAxW b0TL0D+I2KFDFmgoqzJxxI3jBOy2COyaLURD++Mrdij/NP5P5XGDk4I2V 0Y8aoKwaRFyVXZDPbavkjuBGlhoCEcsD5Bc4UDJg5XxvNQhAdX/Pbvj+t w==; X-IronPort-AV: E=Sophos;i="6.01,218,1684792800"; d="scan'208";a="32025079" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 20 Jul 2023 09:41:32 +0200 Received: from steina-w.tq-net.de (unknown [10.123.53.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id 8C2FA280078; Thu, 20 Jul 2023 09:41:32 +0200 (CEST) From: Alexander Stein 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@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2] media: imx: imx7-media-csi: Move stepwise framesize into a dedicated struct Date: Thu, 20 Jul 2023 09:41:28 +0200 Message-Id: <20230720074129.3680269-1-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230720_004142_078410_EAF84B7F X-CRM114-Status: GOOD ( 13.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This way these constraints can be reused later on. No functional change intended. Signed-off-by: Alexander Stein --- 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; }