From patchwork Mon Feb 15 04:26:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 383130 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2057C433E6 for ; Mon, 15 Feb 2021 04:29:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5668064E8E for ; Mon, 15 Feb 2021 04:29:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229927AbhBOE25 (ORCPT ); Sun, 14 Feb 2021 23:28:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229895AbhBOE24 (ORCPT ); Sun, 14 Feb 2021 23:28:56 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C55BEC061756 for ; Sun, 14 Feb 2021 20:28:15 -0800 (PST) Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id DE6E3A25; Mon, 15 Feb 2021 05:28:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1613363292; bh=5qkcyL8CSVzlCODprLbiuhGMSr8z/oVh88RsRGcwnRw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G3uCj+nos+mAlPvcXfUgDlAbEERhr20wvtFBje5zFlOLRwceb4/+phyreM/2GKh9m Aybr0lYLBTQdSBHvRuO5+XHu1creYuUf3JabC9Udf+MhwKoOOzizIjbciZwpeMaAOL axcWyWjjtsRhPU2jNRAH17qDV7XcXDocFaVfLack= From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: Rui Miguel Silva , Steve Longerbeam , Philipp Zabel , Ezequiel Garcia , Fabio Estevam Subject: [PATCH v2 01/77] media: imx: Drop dependency on I2C Date: Mon, 15 Feb 2021 06:26:25 +0200 Message-Id: <20210215042741.28850-2-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210215042741.28850-1-laurent.pinchart@ideasonboard.com> References: <20210215042741.28850-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The i.MX staging media drivers don't depend on I2C. Drop the dependency from Kconfig. Signed-off-by: Laurent Pinchart Reviewed-by: Rui Miguel Silva Reviewed-by: Philipp Zabel --- drivers/staging/media/imx/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/imx/Kconfig b/drivers/staging/media/imx/Kconfig index 15322dc3124a..743e43742211 100644 --- a/drivers/staging/media/imx/Kconfig +++ b/drivers/staging/media/imx/Kconfig @@ -18,7 +18,7 @@ menu "i.MX5/6/7/8 Media Sub devices" config VIDEO_IMX_CSI tristate "i.MX5/6 Camera Sensor Interface driver" - depends on VIDEO_IMX_MEDIA && VIDEO_DEV && I2C + depends on VIDEO_IMX_MEDIA && VIDEO_DEV depends on IMX_IPUV3_CORE default y help @@ -26,7 +26,7 @@ config VIDEO_IMX_CSI config VIDEO_IMX7_CSI tristate "i.MX6UL/L / i.MX7 / i.MX8M Camera Sensor Interface driver" - depends on VIDEO_IMX_MEDIA && VIDEO_DEV && I2C + depends on VIDEO_IMX_MEDIA && VIDEO_DEV default y help Enable support for video4linux camera sensor interface driver for From patchwork Mon Feb 15 04:26:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 383129 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 669F6C433DB for ; Mon, 15 Feb 2021 04:29:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3A5D264EB6 for ; Mon, 15 Feb 2021 04:29:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229930AbhBOE3U (ORCPT ); Sun, 14 Feb 2021 23:29:20 -0500 Received: from perceval.ideasonboard.com ([213.167.242.64]:45318 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229888AbhBOE3O (ORCPT ); Sun, 14 Feb 2021 23:29:14 -0500 Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 08D0014C0; Mon, 15 Feb 2021 05:28:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1613363294; bh=I8Svdrs+I5w29jhEhcMwEr7dqJKME+cuH1UYtODc+nc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rYvZca5T0U6w7hrUNj2FRwI5svdCWkMYrq/c0ABNq2pj0MAWm/uQn9xquhs/TF60w sr3EiMLAGjpAk8Y7dI3QuE2rNdYq6nolQI9eCmx7iHJDwqf2HTmpbiA1BqsIdOC5GJ ZvAI++vrnIU3aU8rKdZi4M4m0UmstnD8ETtanxMM= From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: Rui Miguel Silva , Steve Longerbeam , Philipp Zabel , Ezequiel Garcia , Fabio Estevam Subject: [PATCH v2 04/77] media: imx: Compile imx6-media-objs only for CONFIG_VIDEO_IMX_CSI Date: Mon, 15 Feb 2021 06:26:28 +0200 Message-Id: <20210215042741.28850-5-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210215042741.28850-1-laurent.pinchart@ideasonboard.com> References: <20210215042741.28850-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org imx6-media-objs contains a set of objects that are specific to the i.MX6 IPU-based media subsystem. They're not needed for the i.MX7 CSI. Only compile them if CONFIG_VIDEO_IMX_CSI is selected. Signed-off-by: Laurent Pinchart Reviewed-by: Rui Miguel Silva Reviewed-by: Ezequiel Garcia --- drivers/staging/media/imx/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/media/imx/Makefile b/drivers/staging/media/imx/Makefile index 69cc5da04a2e..6ac33275cc97 100644 --- a/drivers/staging/media/imx/Makefile +++ b/drivers/staging/media/imx/Makefile @@ -1,11 +1,11 @@ # SPDX-License-Identifier: GPL-2.0 +imx-media-common-objs := imx-media-capture.o imx-media-dev-common.o \ + imx-media-of.o imx-media-utils.o + imx6-media-objs := imx-media-dev.o imx-media-internal-sd.o \ imx-ic-common.o imx-ic-prp.o imx-ic-prpencvf.o imx-media-vdic.o \ imx-media-csc-scaler.o -imx-media-common-objs := imx-media-capture.o imx-media-dev-common.o \ - imx-media-of.o imx-media-utils.o - imx6-media-csi-objs := imx-media-csi.o imx-media-fim.o obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media-common.o From patchwork Mon Feb 15 04:26:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 383128 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29724C433DB for ; Mon, 15 Feb 2021 04:29:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F384564EC4 for ; Mon, 15 Feb 2021 04:29:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229933AbhBOE3g (ORCPT ); Sun, 14 Feb 2021 23:29:36 -0500 Received: from perceval.ideasonboard.com ([213.167.242.64]:45318 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229873AbhBOE3f (ORCPT ); Sun, 14 Feb 2021 23:29:35 -0500 Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A39901644; Mon, 15 Feb 2021 05:28:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1613363295; bh=6clLBIoDYl0GcZbPxrdwEhAxt07A3I/8d8DktzqaR5Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tpe5IC3VW0MbzYM+YssdH7GRzOIm8m8tE4BTvSiCIeqnQLvCBW3qPEoqCvgiTX1z0 EbWMPLFUmIz1fxHoKlVDAGjdiXv29amwQE/YEdErq4tRP+RJJae8r0uODG0oZC9d8k seb+dTEx0qwsLgpgLzYRxnqzUM4tHKOUUshLjDkM= From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: Rui Miguel Silva , Steve Longerbeam , Philipp Zabel , Ezequiel Garcia , Fabio Estevam Subject: [PATCH v2 05/77] media: imx: Set default sizes through macros in all drivers Date: Mon, 15 Feb 2021 06:26:29 +0200 Message-Id: <20210215042741.28850-6-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210215042741.28850-1-laurent.pinchart@ideasonboard.com> References: <20210215042741.28850-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org All drivers use 640x480 as the default size, but they all hardcode those values. Create two global macros named IMX_MEDIA_DEF_PIX_WIDTH and IMX_MEDIA_DEF_PIX_HEIGHT to store the default size, and use them through the code. Signed-off-by: Laurent Pinchart Reviewed-by: Rui Miguel Silva --- drivers/staging/media/imx/imx-ic-prp.c | 4 +++- drivers/staging/media/imx/imx-ic-prpencvf.c | 5 +++-- drivers/staging/media/imx/imx-media-csi.c | 13 +++++++------ drivers/staging/media/imx/imx-media-vdic.c | 5 +++-- drivers/staging/media/imx/imx-media.h | 3 +++ drivers/staging/media/imx/imx6-mipi-csi2.c | 4 +++- 6 files changed, 22 insertions(+), 12 deletions(-) diff --git a/drivers/staging/media/imx/imx-ic-prp.c b/drivers/staging/media/imx/imx-ic-prp.c index 5b09e11b1a0e..f21ed881295f 100644 --- a/drivers/staging/media/imx/imx-ic-prp.c +++ b/drivers/staging/media/imx/imx-ic-prp.c @@ -442,7 +442,9 @@ static int prp_registered(struct v4l2_subdev *sd) /* set a default mbus format */ imx_media_enum_ipu_formats(&code, 0, PIXFMT_SEL_YUV); - return imx_media_init_mbus_fmt(&priv->format_mbus, 640, 480, code, + return imx_media_init_mbus_fmt(&priv->format_mbus, + IMX_MEDIA_DEF_PIX_WIDTH, + IMX_MEDIA_DEF_PIX_HEIGHT, code, V4L2_FIELD_NONE, NULL); } diff --git a/drivers/staging/media/imx/imx-ic-prpencvf.c b/drivers/staging/media/imx/imx-ic-prpencvf.c index 74f5de466d5d..47df1a5a1ae8 100644 --- a/drivers/staging/media/imx/imx-ic-prpencvf.c +++ b/drivers/staging/media/imx/imx-ic-prpencvf.c @@ -1255,8 +1255,9 @@ static int prp_registered(struct v4l2_subdev *sd) for (i = 0; i < PRPENCVF_NUM_PADS; i++) { ret = imx_media_init_mbus_fmt(&priv->format_mbus[i], - 640, 480, code, V4L2_FIELD_NONE, - &priv->cc[i]); + IMX_MEDIA_DEF_PIX_WIDTH, + IMX_MEDIA_DEF_PIX_HEIGHT, code, + V4L2_FIELD_NONE, &priv->cc[i]); if (ret) return ret; } diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c index ef5add079774..b9d3f98a2c8f 100644 --- a/drivers/staging/media/imx/imx-media-csi.c +++ b/drivers/staging/media/imx/imx-media-csi.c @@ -1758,8 +1758,9 @@ static int csi_registered(struct v4l2_subdev *sd) /* set a default mbus format */ ret = imx_media_init_mbus_fmt(&priv->format_mbus[i], - 640, 480, code, V4L2_FIELD_NONE, - &priv->cc[i]); + IMX_MEDIA_DEF_PIX_WIDTH, + IMX_MEDIA_DEF_PIX_HEIGHT, code, + V4L2_FIELD_NONE, &priv->cc[i]); if (ret) goto put_csi; @@ -1772,10 +1773,10 @@ static int csi_registered(struct v4l2_subdev *sd) priv->skip = &csi_skip[0]; /* init default crop and compose rectangle sizes */ - priv->crop.width = 640; - priv->crop.height = 480; - priv->compose.width = 640; - priv->compose.height = 480; + priv->crop.width = IMX_MEDIA_DEF_PIX_WIDTH; + priv->crop.height = IMX_MEDIA_DEF_PIX_HEIGHT; + priv->compose.width = IMX_MEDIA_DEF_PIX_WIDTH; + priv->compose.height = IMX_MEDIA_DEF_PIX_HEIGHT; priv->fim = imx_media_fim_init(&priv->sd); if (IS_ERR(priv->fim)) { diff --git a/drivers/staging/media/imx/imx-media-vdic.c b/drivers/staging/media/imx/imx-media-vdic.c index 879329f81f79..395b850736fa 100644 --- a/drivers/staging/media/imx/imx-media-vdic.c +++ b/drivers/staging/media/imx/imx-media-vdic.c @@ -856,8 +856,9 @@ static int vdic_registered(struct v4l2_subdev *sd) /* set a default mbus format */ ret = imx_media_init_mbus_fmt(&priv->format_mbus[i], - 640, 480, code, V4L2_FIELD_NONE, - &priv->cc[i]); + IMX_MEDIA_DEF_PIX_WIDTH, + IMX_MEDIA_DEF_PIX_HEIGHT, code, + V4L2_FIELD_NONE, &priv->cc[i]); if (ret) return ret; diff --git a/drivers/staging/media/imx/imx-media.h b/drivers/staging/media/imx/imx-media.h index c8b6a43d0d7c..1abb9bb88c12 100644 --- a/drivers/staging/media/imx/imx-media.h +++ b/drivers/staging/media/imx/imx-media.h @@ -15,6 +15,9 @@ #include #include