From patchwork Tue May 10 11:51:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 15879 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 4D3C9C3272 for ; Tue, 10 May 2022 11:52:40 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 054A3656BA; Tue, 10 May 2022 13:52:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1652183560; bh=1XqqnZEZEy88Ls146BNeFzkHY5yYmenhdQ/p58Z+TVs=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=fF4H3RE4yODhOmeYVRiJA4pqhNnFGKDEHw7nFhdxE7RYYpCJzTiADLP7yJQCXYhyG Bgr+zjWv0kxaPJwlaNFV45PPJRDeXEPh3fxeTgr6CT/NaMK9D3/zzYTtdy+7zOXyop G2H6OXE2tzQTwm7cYEasIxOWsUhAoLxtfpImVgWFw0aXXylk1wL26cnromSS38zJwY 8qeFQGVuBG6cettCZuUnEB/nDE7bpIiJZ+yezNRkPei+2ZmV4KmCW65AAE1CZNj6hP ycxloiGfuUptXTsOuJUcvHH9JM0B4CyuFfP+6U6l7WSAZOMG1MC75gla9evmAxxPcp mXQMBwhPxY//w== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5DF5865698 for ; Tue, 10 May 2022 13:52:30 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="mooKxHcN"; dkim-atps=neutral Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 761DFB9A; Tue, 10 May 2022 13:52:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1652183550; bh=1XqqnZEZEy88Ls146BNeFzkHY5yYmenhdQ/p58Z+TVs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mooKxHcNO4jw+IDtFT2wTnK6JKZwFgj55AZvokHj8tbqwaiHP3AppgTGUGZOmKbbM MCPrc3KT01MtVi9bHt3w3q79/kUKgGooPfd8P/ceLQ0xaEB4p2jDK8PaCs7AncaWsT aDhMIecEUIjsXRlpQDzuVwuSAcWcjhlcti8ViSIg= To: libcamera-devel@lists.libcamera.org Date: Tue, 10 May 2022 14:51:36 +0300 Message-Id: <20220510115147.19360-40-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220510115147.19360-1-laurent.pinchart@ideasonboard.com> References: <20220510115147.19360-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 39/50] staging: media: imx: imx7-media-csi: Define macro for default mbus code X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Cc: Martin Kepplinger , kernel@pengutronix.de, Dorota Czaplejewicz , Alexander Stein , Rui Miguel Silva , Philipp Zabel , Steve Longerbeam Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Define a macro for the default media bus code and use it through the driver to replace a hardcoded value and a dynamic query from the pixel_formats table. Signed-off-by: Laurent Pinchart --- drivers/staging/media/imx/imx7-media-csi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c index bcf57aff3572..f2e85e9851e4 100644 --- a/drivers/staging/media/imx/imx7-media-csi.c +++ b/drivers/staging/media/imx/imx7-media-csi.c @@ -167,6 +167,7 @@ #define IMX7_CSI_VIDEO_MEM_LIMIT SZ_64M #define IMX7_CSI_VIDEO_EOF_TIMEOUT 2000 +#define IMX7_CSI_DEF_MBUS_CODE MEDIA_BUS_FMT_UYVY8_2X8 #define IMX7_CSI_DEF_PIX_WIDTH 640 #define IMX7_CSI_DEF_PIX_HEIGHT 480 @@ -1096,7 +1097,7 @@ static int imx7_csi_init_mbus_fmt(struct v4l2_mbus_framefmt *mbus, mbus->field = field; if (code == 0) - imx7_csi_enum_mbus_formats(&code, 0, IMX7_CSI_PIXFMT_SEL_YUV); + code = IMX7_CSI_DEF_MBUS_CODE; lcc = imx7_csi_find_mbus_format(code, IMX7_CSI_PIXFMT_SEL_ANY); if (!lcc) @@ -1629,7 +1630,7 @@ static int imx7_csi_video_init_format(struct imx7_csi *csi) .pad = IMX7_CSI_PAD_SRC, .which = V4L2_SUBDEV_FORMAT_ACTIVE, }; - fmt_src.format.code = MEDIA_BUS_FMT_UYVY8_2X8; + fmt_src.format.code = IMX7_CSI_DEF_MBUS_CODE; fmt_src.format.width = IMX7_CSI_DEF_PIX_WIDTH; fmt_src.format.height = IMX7_CSI_DEF_PIX_HEIGHT;