From patchwork Tue May 10 11:51:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 15844 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 96FE1C326C for ; Tue, 10 May 2022 11:52:03 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 451056564D; Tue, 10 May 2022 13:52:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1652183523; bh=pcHJ/iHL8mYCDutTvm2V49TLbx7X/i0r5Te2u6dAS1Q=; 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=zsvmt7kwqO0OG8fEZOjxP4FrgpaUpjLbqcq1saqbVYw/KirBkTPsYCN+a9ksvnjRq aUp632hS7NqOYFsIyiTbC/YuMN6RGZSEXDCv2ZSNax7Pwez/2T45hJQ+FvnIYUHlE7 20CJ7zma/InLZH/zH5IjtdH9n7wkXfjxdebws+errwS9gDJ8PYuStPh2MatT/LXdpQ MMH7Rvxiwm9K1EvXMvA1XOxIopbGNARwiRGXzLCGi5XoFTJaVM6VKn3UvCh5LrmTf7 pqBIB8yTJHnewnY7DOtkZ2l7bcdW4UGkAIiOJ/vU3uDlNX4lFYobosWp2o5cw5bGt1 ZN6f8/VDg536g== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 385D865648 for ; Tue, 10 May 2022 13:52:00 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="jgDwYlm6"; 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 5A254DFF; Tue, 10 May 2022 13:51:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1652183520; bh=pcHJ/iHL8mYCDutTvm2V49TLbx7X/i0r5Te2u6dAS1Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jgDwYlm6p4aEHUvn3Y4nUh2HkT21gU6UJFCytdlnkqEhrt7d8n7LTHv2ATmbP6mW7 Rkl0pcrnOqucYxbG6b/wI0fiq+K4NhxFBmyrlUiDOvWA8emS4rKiF8ak0nyMuYn39n j9b8iD86m0lHB8/Ge6J90T6/TudPh9gqd77Gu0P0= To: libcamera-devel@lists.libcamera.org Date: Tue, 10 May 2022 14:51:01 +0300 Message-Id: <20220510115147.19360-5-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 04/50] staging: media: imx: imx7-media-csi: Drop duplicate link creation 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" The imx_media_create_csi2_links() creates a media controller link between the CSI-2 receiver and the next entity in the pipeline, which can be either a video mux (handled by the video-mux driver) or the CSI bridge itself. This isn't needed, as the link is already created either by the video-mux driver or by the imx7-media-csi driver itself (in imx7_csi_notify_bound()). Drop imx_media_create_csi2_links(), which allows dropping the CSI bridge subdev grp_id. Signed-off-by: Laurent Pinchart --- drivers/staging/media/imx/imx7-media-csi.c | 31 ---------------------- 1 file changed, 31 deletions(-) diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c index 708076b7045a..e2d6dabad007 100644 --- a/drivers/staging/media/imx/imx7-media-csi.c +++ b/drivers/staging/media/imx/imx7-media-csi.c @@ -726,34 +726,6 @@ static inline struct imx_media_dev *notifier2dev(struct v4l2_async_notifier *n) return container_of(n, struct imx_media_dev, notifier); } -/* - * Create the missing media links from the CSI-2 receiver. - * Called after all async subdevs have bound. - */ -static void imx_media_create_csi2_links(struct imx_media_dev *imxmd) -{ - struct v4l2_subdev *sd, *csi2 = NULL; - - list_for_each_entry(sd, &imxmd->v4l2_dev.subdevs, list) { - if (sd->grp_id == IMX_MEDIA_GRP_ID_CSI2) { - csi2 = sd; - break; - } - } - if (!csi2) - return; - - 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; - - v4l2_create_fwnode_links(csi2, sd); - } -} - /* * adds given video device to given imx-media source pad vdev list. * Continues upstream from the pad entity's sink pads. @@ -883,8 +855,6 @@ static int __imx_media_probe_complete(struct v4l2_async_notifier *notifier) mutex_lock(&imxmd->mutex); - imx_media_create_csi2_links(imxmd); - ret = imx_media_create_pad_vdev_lists(imxmd); if (ret) goto unlock; @@ -1477,7 +1447,6 @@ static int imx7_csi_probe(struct platform_device *pdev) csi->sd.dev = &pdev->dev; csi->sd.owner = THIS_MODULE; csi->sd.flags = V4L2_SUBDEV_FL_HAS_DEVNODE; - csi->sd.grp_id = IMX_MEDIA_GRP_ID_CSI; snprintf(csi->sd.name, sizeof(csi->sd.name), "csi"); for (i = 0; i < IMX7_CSI_PADS_NUM; i++)