From patchwork Wed Sep 7 20:04:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 604946 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6100EC54EE9 for ; Wed, 7 Sep 2022 20:04:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229996AbiIGUEr (ORCPT ); Wed, 7 Sep 2022 16:04:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229884AbiIGUEq (ORCPT ); Wed, 7 Sep 2022 16:04:46 -0400 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 E28EF18B35 for ; Wed, 7 Sep 2022 13:04:43 -0700 (PDT) Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4DF318A3; Wed, 7 Sep 2022 22:04:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1662581081; bh=XjW177k5DK7mE2Kkli1vE8alWetqg/zDuynN+q6JR00=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KUYvnOP27SGs6S+ThWOmWc+ecdEbFCySVWGQ3yNOGLX4mmlhUE+xV0XQgZcnSMDQc y/Rvx5kpa2aRptO0njxcvhlYLjB9WpfQSN1bAssPfnwRadM/wpXMnjoyiuR2nFgBcy lYUhzSZC88R1lFlA9CY/Fk8RWnbsxXwLdHtclCPY= From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: Rui Miguel Silva , Steve Longerbeam , Philipp Zabel , Paul Elder , Jacopo Mondi , kernel@pengutronix.de, linux-imx@nxp.com Subject: [PATCH 1/6] media: imx: Decouple imx8mq-mipi-csi2 from imx7-media-csi Date: Wed, 7 Sep 2022 23:04:19 +0300 Message-Id: <20220907200424.32136-2-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220907200424.32136-1-laurent.pinchart@ideasonboard.com> References: <20220907200424.32136-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The imx8mq-mipi-csi2 driver targets SoCs that also run the imx7-media-csi driver, but they are distinct. Decouple them in Kconfig to prepare for destaging of the imx7-media-csi driver. Signed-off-by: Laurent Pinchart --- drivers/staging/media/imx/Kconfig | 10 ++++++++++ drivers/staging/media/imx/Makefile | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/staging/media/imx/Kconfig b/drivers/staging/media/imx/Kconfig index 0bacac302d7e..bfb849701489 100644 --- a/drivers/staging/media/imx/Kconfig +++ b/drivers/staging/media/imx/Kconfig @@ -32,3 +32,13 @@ config VIDEO_IMX7_CSI i.MX6UL/L, i.MX7 or i.MX8M. endmenu endif + +config VIDEO_IMX8MQ_MIPI_CSI2 + tristate "NXP i.MX8MQ MIPI CSI-2 receiver" + depends on ARCH_MXC || COMPILE_TEST + depends on VIDEO_DEV + select MEDIA_CONTROLLER + select V4L2_FWNODE + select VIDEO_V4L2_SUBDEV_API + help + V4L2 driver for the MIPI CSI-2 receiver found in the i.MX8MQ SoC. diff --git a/drivers/staging/media/imx/Makefile b/drivers/staging/media/imx/Makefile index d82be898145b..cef9f30eb401 100644 --- a/drivers/staging/media/imx/Makefile +++ b/drivers/staging/media/imx/Makefile @@ -15,4 +15,4 @@ obj-$(CONFIG_VIDEO_IMX_CSI) += imx6-media-csi.o obj-$(CONFIG_VIDEO_IMX_CSI) += imx6-mipi-csi2.o obj-$(CONFIG_VIDEO_IMX7_CSI) += imx7-media-csi.o -obj-$(CONFIG_VIDEO_IMX7_CSI) += imx8mq-mipi-csi2.o +obj-$(CONFIG_VIDEO_IMX8MQ_MIPI_CSI2) += imx8mq-mipi-csi2.o From patchwork Wed Sep 7 20:04:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 603696 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F7B8C54EE9 for ; Wed, 7 Sep 2022 20:04:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230000AbiIGUEv (ORCPT ); Wed, 7 Sep 2022 16:04:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230001AbiIGUEt (ORCPT ); Wed, 7 Sep 2022 16:04:49 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB52B193DE for ; Wed, 7 Sep 2022 13:04:45 -0700 (PDT) Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B345B8F1; Wed, 7 Sep 2022 22:04:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1662581082; bh=bzVCmgEimKxwP7irBEEsgoZtcZ0JdF4W9at2ALfNM0Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JfOUiKYkY8XextiAyTY0Jh9BmF2FK6jyz2o9Dze4/XtN2x5jEF1AkcPxIV2lx/GPu mStj7yYpY/UfljS1KT1nn0j7xEHqem98DyrCCxwtYf7i4ZaDilie4dzHsX5OF700kH JAfUx18WCJv7O3Q92grTpoE7sIGgMaRoIg5YXU0k= From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: Rui Miguel Silva , Steve Longerbeam , Philipp Zabel , Paul Elder , Jacopo Mondi , kernel@pengutronix.de, linux-imx@nxp.com Subject: [PATCH 2/6] media: imx: Unstage the imx7-media-csi driver Date: Wed, 7 Sep 2022 23:04:20 +0300 Message-Id: <20220907200424.32136-3-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220907200424.32136-1-laurent.pinchart@ideasonboard.com> References: <20220907200424.32136-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The imx7-media-csi driver, currently in staging, is ready for prime-time. The staging TODO file lists a few items specific to that driver, that are already addressed (the "all of the above" part) or can be addressed later: - The frame interval monitoring support is a software mechanism to monitor the device for unexpected stalls, and should be part of the V4L2 core if desired. - Restricting the support media bus formats based on the SoC integration only aims at reducing userspace confusion by not enumerating options that are known not to be possible, it won't cause regressions if handled later. Move the description of the media bus format restriction TODO item to the driver, drop the other TODO items, and move the driver out of staging. Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder Acked-by: Rui Miguel Silva --- MAINTAINERS | 2 +- drivers/media/platform/nxp/Kconfig | 13 +++++++++ drivers/media/platform/nxp/Makefile | 1 + .../platform/nxp}/imx7-media-csi.c | 24 +++++++++++++++ drivers/staging/media/imx/Kconfig | 7 ----- drivers/staging/media/imx/Makefile | 1 - drivers/staging/media/imx/TODO | 29 ------------------- 7 files changed, 39 insertions(+), 38 deletions(-) rename drivers/{staging/media/imx => media/platform/nxp}/imx7-media-csi.c (97%) diff --git a/MAINTAINERS b/MAINTAINERS index 338c155f60ef..1dfa1d51955c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -12595,7 +12595,7 @@ F: Documentation/admin-guide/media/imx7.rst F: Documentation/devicetree/bindings/media/nxp,imx-mipi-csi2.yaml F: Documentation/devicetree/bindings/media/nxp,imx7-csi.yaml F: drivers/media/platform/nxp/imx-mipi-csis.c -F: drivers/staging/media/imx/imx7-media-csi.c +F: drivers/media/platform/nxp/imx7-media-csi.c MEDIA DRIVERS FOR HELENE M: Abylay Ospan diff --git a/drivers/media/platform/nxp/Kconfig b/drivers/media/platform/nxp/Kconfig index 1ac0a6e91111..3aa4207bcd41 100644 --- a/drivers/media/platform/nxp/Kconfig +++ b/drivers/media/platform/nxp/Kconfig @@ -4,6 +4,19 @@ comment "NXP media platform drivers" +config VIDEO_IMX7_CSI + tristate "NXP CSI Bridge driver" + depends on ARCH_MXC || COMPILE_TEST + depends on HAS_DMA + depends on VIDEO_DEV + select MEDIA_CONTROLLER + select V4L2_FWNODE + select VIDEOBUF2_DMA_CONTIG + select VIDEO_V4L2_SUBDEV_API + help + Driver for the NXP Camera Sensor Interface (CSI) Bridge. This device + is found in the i.MX6UL/L, i.MX7 and i.MX8M[MQ] SoCs. + config VIDEO_IMX_MIPI_CSIS tristate "NXP MIPI CSI-2 CSIS receiver found on i.MX7 and i.MX8 models" depends on ARCH_MXC || COMPILE_TEST diff --git a/drivers/media/platform/nxp/Makefile b/drivers/media/platform/nxp/Makefile index efc38c6578ce..92cb8f4c215e 100644 --- a/drivers/media/platform/nxp/Makefile +++ b/drivers/media/platform/nxp/Makefile @@ -2,6 +2,7 @@ obj-y += imx-jpeg/ +obj-$(CONFIG_VIDEO_IMX7_CSI) += imx7-media-csi.o obj-$(CONFIG_VIDEO_IMX_MIPI_CSIS) += imx-mipi-csis.o obj-$(CONFIG_VIDEO_IMX_PXP) += imx-pxp.o obj-$(CONFIG_VIDEO_MX2_EMMAPRP) += mx2_emmaprp.o diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/media/platform/nxp/imx7-media-csi.c similarity index 97% rename from drivers/staging/media/imx/imx7-media-csi.c rename to drivers/media/platform/nxp/imx7-media-csi.c index 21d6e56ffcd4..72de9fc9862a 100644 --- a/drivers/staging/media/imx/imx7-media-csi.c +++ b/drivers/media/platform/nxp/imx7-media-csi.c @@ -807,6 +807,30 @@ static irqreturn_t imx7_csi_irq_handler(int irq, void *data) * List of supported pixel formats for the subdevs. Keep V4L2_PIX_FMT_UYVY and * MEDIA_BUS_FMT_UYVY8_2X8 first to match IMX7_CSI_DEF_PIX_FORMAT and * IMX7_CSI_DEF_MBUS_CODE. + * + * TODO: Restrict the supported formats list based on the SoC integration. + * + * The CSI bridge can be configured to sample pixel components from the Rx queue + * in single (8bpp) or double (16bpp) component modes. Image format variants + * with different sample sizes (ie YUYV_2X8 vs YUYV_1X16) determine the pixel + * components sampling size per each clock cycle and their packing mode (see + * imx7_csi_configure() for details). + * + * As the CSI bridge can be interfaced with different IP blocks depending on the + * SoC model it is integrated on, the Rx queue sampling size should match the + * size of the samples transferred by the transmitting IP block. To avoid + * misconfigurations of the capture pipeline, the enumeration of the supported + * formats should be restricted to match the pixel source transmitting mode. + * + * Example: i.MX8MM SoC integrates the CSI bridge with the Samsung CSIS CSI-2 + * receiver which operates in dual pixel sampling mode. The CSI bridge should + * only expose the 1X16 formats variant which instructs it to operate in dual + * pixel sampling mode. When the CSI bridge is instead integrated on an i.MX7, + * which supports both serial and parallel input, it should expose both + * variants. + * + * This currently only applies to YUYV formats, but other formats might need to + * be handled in the same way. */ static const struct imx7_csi_pixfmt pixel_formats[] = { /*** YUV formats start here ***/ diff --git a/drivers/staging/media/imx/Kconfig b/drivers/staging/media/imx/Kconfig index bfb849701489..21fd79515042 100644 --- a/drivers/staging/media/imx/Kconfig +++ b/drivers/staging/media/imx/Kconfig @@ -23,13 +23,6 @@ config VIDEO_IMX_CSI default y help A video4linux camera sensor interface driver for i.MX5/6. - -config VIDEO_IMX7_CSI - tristate "i.MX6UL/L / i.MX7 / i.MX8M Camera Sensor Interface driver" - default y - help - Enable support for video4linux camera sensor interface driver for - i.MX6UL/L, i.MX7 or i.MX8M. endmenu endif diff --git a/drivers/staging/media/imx/Makefile b/drivers/staging/media/imx/Makefile index cef9f30eb401..906a422aa656 100644 --- a/drivers/staging/media/imx/Makefile +++ b/drivers/staging/media/imx/Makefile @@ -14,5 +14,4 @@ obj-$(CONFIG_VIDEO_IMX_CSI) += imx6-media.o obj-$(CONFIG_VIDEO_IMX_CSI) += imx6-media-csi.o obj-$(CONFIG_VIDEO_IMX_CSI) += imx6-mipi-csi2.o -obj-$(CONFIG_VIDEO_IMX7_CSI) += imx7-media-csi.o obj-$(CONFIG_VIDEO_IMX8MQ_MIPI_CSI2) += imx8mq-mipi-csi2.o diff --git a/drivers/staging/media/imx/TODO b/drivers/staging/media/imx/TODO index 5d3a337c8702..afee26870af7 100644 --- a/drivers/staging/media/imx/TODO +++ b/drivers/staging/media/imx/TODO @@ -23,32 +23,3 @@ - Similarly to the legacy control handling, legacy format handling where formats on the video nodes are influenced by the active format of the connected subdev should be removed. - -- i.MX7: all of the above, since it uses the imx media core - -- i.MX7: use Frame Interval Monitor - -- imx7-media-csi: Restrict the supported formats list to the SoC version. - - The imx7 CSI bridge can be configured to sample pixel components from the Rx - queue in single (8bpp) or double (16bpp) component modes. Image format - variants with different sample sizes (ie YUYV_2X8 vs YUYV_1X16) determine the - pixel components sampling size per each clock cycle and their packing mode - (see imx7_csi_configure() for details). - - As the imx7 CSI bridge can be interfaced with different IP blocks depending on - the SoC model it is integrated on, the Rx queue sampling size should match - the size of the samples transferred by the transmitting IP block. - - To avoid mis-configurations of the capture pipeline, the enumeration of the - supported formats should be restricted to match the pixel source transmitting - mode. - - Example: i.MX8MM SoC integrates the CSI bridge with the Samsung CSIS CSI-2 - receiver which operates in dual pixel sampling mode. The CSI bridge should - only expose the 1X16 formats variant which instructs it to operate in dual - pixel sampling mode. When the CSI bridge is instead integrated on an i.MX7, - which supports both serial and parallel input, it should expose both variants. - - This currently only applies to YUYV formats, but other formats might need - to be handled in the same way. From patchwork Wed Sep 7 20:04:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 604945 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62778C38145 for ; Wed, 7 Sep 2022 20:04:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229999AbiIGUEw (ORCPT ); Wed, 7 Sep 2022 16:04:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230002AbiIGUEt (ORCPT ); Wed, 7 Sep 2022 16:04:49 -0400 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 2D6351BEAF for ; Wed, 7 Sep 2022 13:04:47 -0700 (PDT) Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4D7D5907; Wed, 7 Sep 2022 22:04:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1662581084; bh=gRAsPlMnO5Vlxin88PFJ5n6Za2/sfgS5C9fYMdvJedQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qyGHBZ7jkOoYxNneLSlgTYZ94dQZUv2L2v+zui37QibvdqEz5ASekG7joQSUrMQpU ZAaoHINHqVYeMwEJz1L9zPSRC2KuVxm8qcJdyje7/fTzXAhfBsM16AvGfPUz8VSCsS 5KhSzF46VqlgGxIz32QmOLqBA2RplzW3Sg3f1cIk= From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: Rui Miguel Silva , Steve Longerbeam , Philipp Zabel , Paul Elder , Jacopo Mondi , kernel@pengutronix.de, linux-imx@nxp.com Subject: [PATCH 3/6] staging: media: imx: Drop imx_media_subdev_bound() Date: Wed, 7 Sep 2022 23:04:21 +0300 Message-Id: <20220907200424.32136-4-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220907200424.32136-1-laurent.pinchart@ideasonboard.com> References: <20220907200424.32136-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The imx_media_subdev_bound() function is a no-op, and the async notifier .bound() operation is optional. Drop it. Signed-off-by: Laurent Pinchart --- drivers/staging/media/imx/imx-media-dev-common.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/drivers/staging/media/imx/imx-media-dev-common.c b/drivers/staging/media/imx/imx-media-dev-common.c index e6d6ed3b1161..8f7ced3a9cca 100644 --- a/drivers/staging/media/imx/imx-media-dev-common.c +++ b/drivers/staging/media/imx/imx-media-dev-common.c @@ -19,18 +19,6 @@ static inline struct imx_media_dev *notifier2dev(struct v4l2_async_notifier *n) return container_of(n, struct imx_media_dev, notifier); } -/* async subdev bound notifier */ -static int imx_media_subdev_bound(struct v4l2_async_notifier *notifier, - struct v4l2_subdev *sd, - struct v4l2_async_subdev *asd) -{ - struct imx_media_dev *imxmd = notifier2dev(notifier); - - dev_dbg(imxmd->md.dev, "subdev %s bound\n", sd->name); - - return 0; -} - /* * Create the missing media links from the CSI-2 receiver. * Called after all async subdevs have bound. @@ -337,7 +325,6 @@ static void imx_media_notify(struct v4l2_subdev *sd, unsigned int notification, } static const struct v4l2_async_notifier_operations imx_media_notifier_ops = { - .bound = imx_media_subdev_bound, .complete = imx_media_probe_complete, }; From patchwork Wed Sep 7 20:04:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 603695 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D11E2C54EE9 for ; Wed, 7 Sep 2022 20:04:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230002AbiIGUEy (ORCPT ); Wed, 7 Sep 2022 16:04:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230003AbiIGUEv (ORCPT ); Wed, 7 Sep 2022 16:04:51 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5BF419292 for ; Wed, 7 Sep 2022 13:04:50 -0700 (PDT) Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C5963888; Wed, 7 Sep 2022 22:04:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1662581086; bh=QRqh6Zp3axo3I2zFhkRkPaNLa1ui2erN7CUSMECf9v4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SKDVJjZeKPLDa0cRDbBiYumKaAn5nMYVRPiEdsvYee8YEos6YXMKSLBerKlIY8i3b itYV7+9GjQIVVDsJIDu2a+t2lu4Ii29CAYlUDp4XaqtqjNOpKNR29Jvh558poSMvxM Y4RSYoCiKZk3+oP1nvy4eQQP2LE3DjKxV782vOVs= From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: Rui Miguel Silva , Steve Longerbeam , Philipp Zabel , Paul Elder , Jacopo Mondi , kernel@pengutronix.de, linux-imx@nxp.com Subject: [PATCH 4/6] staging: media: imx: Drop IMX_MEDIA_GRP_ID_CSI Date: Wed, 7 Sep 2022 23:04:22 +0300 Message-Id: <20220907200424.32136-5-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220907200424.32136-1-laurent.pinchart@ideasonboard.com> References: <20220907200424.32136-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The IMX_MEDIA_GRP_ID_CSI group ID isn't used anymore. Drop it. Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder --- drivers/staging/media/imx/imx-media-dev-common.c | 1 - drivers/staging/media/imx/imx-media.h | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/staging/media/imx/imx-media-dev-common.c b/drivers/staging/media/imx/imx-media-dev-common.c index 8f7ced3a9cca..991820a8500f 100644 --- a/drivers/staging/media/imx/imx-media-dev-common.c +++ b/drivers/staging/media/imx/imx-media-dev-common.c @@ -39,7 +39,6 @@ static void imx_media_create_csi2_links(struct imx_media_dev *imxmd) list_for_each_entry(sd, &imxmd->v4l2_dev.subdevs, list) { /* skip if not a CSI or a CSI mux */ if (!(sd->grp_id & IMX_MEDIA_GRP_ID_IPU_CSI) && - !(sd->grp_id & IMX_MEDIA_GRP_ID_CSI) && !(sd->grp_id & IMX_MEDIA_GRP_ID_CSI_MUX)) continue; diff --git a/drivers/staging/media/imx/imx-media.h b/drivers/staging/media/imx/imx-media.h index f263fc3adbb9..5e794f291da6 100644 --- a/drivers/staging/media/imx/imx-media.h +++ b/drivers/staging/media/imx/imx-media.h @@ -299,7 +299,6 @@ void imx_media_csc_scaler_device_unregister(struct imx_media_video_dev *vdev); /* subdev group ids */ #define IMX_MEDIA_GRP_ID_CSI2 BIT(8) -#define IMX_MEDIA_GRP_ID_CSI BIT(9) #define IMX_MEDIA_GRP_ID_IPU_CSI_BIT 10 #define IMX_MEDIA_GRP_ID_IPU_CSI (0x3 << IMX_MEDIA_GRP_ID_IPU_CSI_BIT) #define IMX_MEDIA_GRP_ID_IPU_CSI0 BIT(IMX_MEDIA_GRP_ID_IPU_CSI_BIT) From patchwork Wed Sep 7 20:04:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 604944 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C61B6C6FA82 for ; Wed, 7 Sep 2022 20:04:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230007AbiIGUEz (ORCPT ); Wed, 7 Sep 2022 16:04:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230006AbiIGUEw (ORCPT ); Wed, 7 Sep 2022 16:04:52 -0400 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 EA5131BE9E for ; Wed, 7 Sep 2022 13:04:50 -0700 (PDT) Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 352278A3; Wed, 7 Sep 2022 22:04:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1662581087; bh=heDVr1gDF8wXd9qioWgKgUyhBXO1GbGDJdg7vXUT650=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CAL+epKqOukwdjIAJWioW3DLgtQfrhEc6VsoN+P2qIZiQT6u0JypXpiVrj5Fy6A/V ak5/WwYOsoqkgQr+s37Z15VBU+Antkb4R6rkirZg+7tmKRyP5MsMERrW2DhLrAaliO OERUkucBeAR0TsefDq7geC9df6q/b33isLSraENM= From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: Rui Miguel Silva , Steve Longerbeam , Philipp Zabel , Paul Elder , Jacopo Mondi , kernel@pengutronix.de, linux-imx@nxp.com Subject: [PATCH 5/6] staging: media: imx: Drop unused helper functions Date: Wed, 7 Sep 2022 23:04:23 +0300 Message-Id: <20220907200424.32136-6-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220907200424.32136-1-laurent.pinchart@ideasonboard.com> References: <20220907200424.32136-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The imx_media_find_subdev_by_fwnode(), imx_media_find_subdev_by_devname(), imx_media_pipeline_csi2_channel() and imx_media_pipeline_video_device() helper functions are not used. Drop them. Signed-off-by: Laurent Pinchart --- drivers/staging/media/imx/imx-media-utils.c | 68 --------------------- drivers/staging/media/imx/imx-media.h | 10 --- 2 files changed, 78 deletions(-) diff --git a/drivers/staging/media/imx/imx-media-utils.c b/drivers/staging/media/imx/imx-media-utils.c index 294c808b2ebe..07770b47e19b 100644 --- a/drivers/staging/media/imx/imx-media-utils.c +++ b/drivers/staging/media/imx/imx-media-utils.c @@ -626,36 +626,6 @@ void imx_media_grp_id_to_sd_name(char *sd_name, int sz, u32 grp_id, int ipu_id) } EXPORT_SYMBOL_GPL(imx_media_grp_id_to_sd_name); -struct v4l2_subdev * -imx_media_find_subdev_by_fwnode(struct imx_media_dev *imxmd, - struct fwnode_handle *fwnode) -{ - struct v4l2_subdev *sd; - - list_for_each_entry(sd, &imxmd->v4l2_dev.subdevs, list) { - if (sd->fwnode == fwnode) - return sd; - } - - return NULL; -} -EXPORT_SYMBOL_GPL(imx_media_find_subdev_by_fwnode); - -struct v4l2_subdev * -imx_media_find_subdev_by_devname(struct imx_media_dev *imxmd, - const char *devname) -{ - struct v4l2_subdev *sd; - - list_for_each_entry(sd, &imxmd->v4l2_dev.subdevs, list) { - if (!strcmp(devname, dev_name(sd->dev))) - return sd; - } - - return NULL; -} -EXPORT_SYMBOL_GPL(imx_media_find_subdev_by_devname); - /* * Adds a video device to the master video device list. This is called * when a video device is registered. @@ -756,25 +726,6 @@ find_pipeline_entity(struct media_entity *start, u32 grp_id, return pad ? pad->entity : NULL; } -/* - * Find the upstream mipi-csi2 virtual channel reached from the given - * start entity in the current pipeline. - * Must be called with mdev->graph_mutex held. - */ -int imx_media_pipeline_csi2_channel(struct media_entity *start_entity) -{ - struct media_pad *pad; - int ret = -EPIPE; - - pad = imx_media_pipeline_pad(start_entity, IMX_MEDIA_GRP_ID_CSI2, - 0, true); - if (pad) - ret = pad->index - 1; - - return ret; -} -EXPORT_SYMBOL_GPL(imx_media_pipeline_csi2_channel); - /* * Find a subdev reached upstream from the given start entity in * the current pipeline. @@ -794,25 +745,6 @@ imx_media_pipeline_subdev(struct media_entity *start_entity, u32 grp_id, } EXPORT_SYMBOL_GPL(imx_media_pipeline_subdev); -/* - * Find a subdev reached upstream from the given start entity in - * the current pipeline. - * Must be called with mdev->graph_mutex held. - */ -struct video_device * -imx_media_pipeline_video_device(struct media_entity *start_entity, - enum v4l2_buf_type buftype, bool upstream) -{ - struct media_entity *me; - - me = find_pipeline_entity(start_entity, 0, buftype, upstream); - if (!me) - return ERR_PTR(-ENODEV); - - return media_entity_to_video_device(me); -} -EXPORT_SYMBOL_GPL(imx_media_pipeline_video_device); - /* * Find a fwnode endpoint that maps to the given subdevice's pad. * If there are multiple endpoints that map to the pad, only the diff --git a/drivers/staging/media/imx/imx-media.h b/drivers/staging/media/imx/imx-media.h index 5e794f291da6..5a1436dbb12d 100644 --- a/drivers/staging/media/imx/imx-media.h +++ b/drivers/staging/media/imx/imx-media.h @@ -201,24 +201,14 @@ int imx_media_mbus_fmt_to_pix_fmt(struct v4l2_pix_format *pix, const struct imx_media_pixfmt *cc); void imx_media_grp_id_to_sd_name(char *sd_name, int sz, u32 grp_id, int ipu_id); -struct v4l2_subdev * -imx_media_find_subdev_by_fwnode(struct imx_media_dev *imxmd, - struct fwnode_handle *fwnode); -struct v4l2_subdev * -imx_media_find_subdev_by_devname(struct imx_media_dev *imxmd, - const char *devname); void imx_media_add_video_device(struct imx_media_dev *imxmd, struct imx_media_video_dev *vdev); -int imx_media_pipeline_csi2_channel(struct media_entity *start_entity); struct media_pad * imx_media_pipeline_pad(struct media_entity *start_entity, u32 grp_id, enum v4l2_buf_type buftype, bool upstream); struct v4l2_subdev * imx_media_pipeline_subdev(struct media_entity *start_entity, u32 grp_id, bool upstream); -struct video_device * -imx_media_pipeline_video_device(struct media_entity *start_entity, - enum v4l2_buf_type buftype, bool upstream); struct fwnode_handle *imx_media_get_pad_fwnode(struct media_pad *pad); struct imx_media_dma_buf { From patchwork Wed Sep 7 20:04:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 603694 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B96E3C6FA89 for ; Wed, 7 Sep 2022 20:04:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230006AbiIGUE4 (ORCPT ); Wed, 7 Sep 2022 16:04:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230003AbiIGUEz (ORCPT ); Wed, 7 Sep 2022 16:04:55 -0400 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 949E520F75 for ; Wed, 7 Sep 2022 13:04:53 -0700 (PDT) Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id BB57AE81; Wed, 7 Sep 2022 22:04:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1662581089; bh=6Yde0QeO7axbIOr0yg8qR2SESdJqpYa6mDnpGbDyfD8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DzmCMB14Y5Sptxs84ysNTwzvmWdlgr6b4I7dZceitWEgKs+vLu5qk9lQ9qYg0bJTF b9LXGyA2HkugA2nDFu+TtBjlh0qZpI1EfyVL7GP4pzt4dWrVZzHxWztSC52FuXX6/W Kh8V91oAmgpT0pTPzH/N3lmK2kpDVrbZXxBBQBtk= From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: Rui Miguel Silva , Steve Longerbeam , Philipp Zabel , Paul Elder , Jacopo Mondi , kernel@pengutronix.de, linux-imx@nxp.com Subject: [PATCH 6/6] staging: media: imx: Make imx_media_of_add_csi() static Date: Wed, 7 Sep 2022 23:04:24 +0300 Message-Id: <20220907200424.32136-7-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220907200424.32136-1-laurent.pinchart@ideasonboard.com> References: <20220907200424.32136-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The imx_media_of_add_csi() function is only called in its compilation unit. Make it static and don't export it. Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder --- drivers/staging/media/imx/imx-media-of.c | 5 ++--- drivers/staging/media/imx/imx-media.h | 2 -- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/staging/media/imx/imx-media-of.c b/drivers/staging/media/imx/imx-media-of.c index 59f1eb7b62bc..92a99010c150 100644 --- a/drivers/staging/media/imx/imx-media-of.c +++ b/drivers/staging/media/imx/imx-media-of.c @@ -16,8 +16,8 @@ #include