From patchwork Fri Aug 11 10:47:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jai Luthra X-Patchwork-Id: 13350578 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 77549C001DB for ; Fri, 11 Aug 2023 10:48:58 +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:References:In-Reply-To: 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: List-Owner; bh=6T407b+cJrH3VdSUS/5n9FiClg+Pnjuyr/sz7YueETI=; b=KvrbY4yLOf0bdG uXdkW6zOB6UWCfmoJHQFp1gFdPWq35IX98iFf12zEg0yWFJmMVP+VB7Y1kS9JqM8lbIFPw7gP2Iz6 YyB1j07F1hJyHCL3NYKzAN/hpJzORIHHqlDrtcoeeGrs0QIWLzmdbDmOGNNtgZp5FvLqav3FRRIA0 YUdSdtmF/yO5ea13eI2P7dPSx9S5dtbcEuECC/94ZgaCAumxOA/HkMLfYzL7CguNzTihtD/ZOQHNP Xl3vioCCY0BCKX//OojbtzOHr5ya2n3j4M+KrMjPf2+dkCxQYMWT6bzkkW5Nl1jG37iFb8BViIxbC 2JbgwQuSC9+mynnJ6mmA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qUPgy-00AKH8-0W; Fri, 11 Aug 2023 10:48:28 +0000 Received: from lelv0142.ext.ti.com ([198.47.23.249]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qUPgi-00AK8e-2E for linux-arm-kernel@lists.infradead.org; Fri, 11 Aug 2023 10:48:16 +0000 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 37BAlu4d088956; Fri, 11 Aug 2023 05:47:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1691750876; bh=VIQIUwUq7rF5LQLOhQKcBWMmcl7qk82frmPGJ6vtEfE=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=nAifa+kYFqfJVev6SboZMz6fv1vG11l6QFviI+/OkpYzCxIwdx5HzJ8Tp59nDnkgw 6SDImhvO/T1tcyNmvJYL0eAa3nJ14Fvj5/U/jrZNrjTUoztz3VqBbornPm5/ESElsi jMlv6aa9jPG+9MJqx56GIPMx8NAqQxHYj4YE+Aek= Received: from DFLE111.ent.ti.com (dfle111.ent.ti.com [10.64.6.32]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 37BAluPP014254 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 11 Aug 2023 05:47:56 -0500 Received: from DFLE114.ent.ti.com (10.64.6.35) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Fri, 11 Aug 2023 05:47:55 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Fri, 11 Aug 2023 05:47:55 -0500 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 37BAltma019971; Fri, 11 Aug 2023 05:47:55 -0500 From: Jai Luthra To: Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sakari Ailus , Tomi Valkeinen CC: , , , , Laurent Pinchart , Mauro Carvalho Chehab , Maxime Ripard , , Benoit Parrot , Vaishnav Achath , Vignesh Raghavendra , , , , , Martyn Welch , Julien Massot Subject: [PATCH v9 11/13] media: cadence: csi2rx: Add link validation Date: Fri, 11 Aug 2023 16:17:33 +0530 Message-ID: <20230811-upstream_csi-v9-11-8943f7a68a81@ti.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230811-upstream_csi-v9-0-8943f7a68a81@ti.com> References: <20230811-upstream_csi-v9-0-8943f7a68a81@ti.com> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1513; i=j-luthra@ti.com; h=from:subject:message-id; bh=Ro81cyobnEUDDNNUnAs+ie3mvGkg8wjHF7FIlL5x7AU=; b=owEBbQKS/ZANAwAIAUPekfkkmnFFAcsmYgBk1g8JETnp7fSxEYUawwNs8LP2bfE6jbcRsVAp8 QILPVxNHIWJAjMEAAEIAB0WIQRN4NgY5dV16NRar8VD3pH5JJpxRQUCZNYPCQAKCRBD3pH5JJpx RVJTEADUx96uguI0iqedm9PJxl+NYTjGbkn6PebuJi/B8h3C1Rknd42wGTuo5RYW8qAHNkDXDSk EBbMVlrbxyEn736eGXTjk6LcV+dGEQCRovqIXUaogAoI6Fn013k9s6bFzwxVQcjnp7ZCtyjHLH9 KmZlq/4yJl5WEEj44CypMvJjJhikQdgbbjohG8jcjaVFnuM8XZU9m3rHyZodrzfPlARONJbh6ig r2m8h+NxQ+1HP/ngiwHxPQuJHirrJxa2RMDyxEgVlNv1ITZJP9znqesEc04+0Ab4P41D6MTiwAJ OBTNs8Q6f7z6ATuQTFIjrWljSEAVyOkZ+2k7NBf91hpVK22IrAxMCdNClCy+dZObPvYO4csBzSC kWdL0CeIagmcpR8jnBmQIuNzPjyz431h8VrxSxtXzaHkoEVmXMQLOsqeJkbI6IgHBwbC3UPFaTx bmM/Qd4UfXGOG7RMk0Pn4L3prFYJl7YbjqtEGdvm2Dte7JXGkvb7xEbo32Vu88UjtlUBVYjIi5U 8fSED+wXDYIIYSlJDRnGThX5xFfLcELbth3UdLl7J20FqtbEy7eczuMUtrFCmYZYlkQP+21sMFs 9qFHNK4m95RReTVRmJd94at5KH0Hts2JcWRzxiksHZyZauqIp8DkQevwvVY8GgfcWKd6P4TdvGa B5O6RejEdHJvMuw== X-Developer-Key: i=j-luthra@ti.com; a=openpgp; fpr=4DE0D818E5D575E8D45AAFC543DE91F9249A7145 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230811_034812_866179_A735F9D3 X-CRM114-Status: GOOD ( 11.89 ) 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 From: Pratyush Yadav Add media link validation to make sure incorrectly configured pipelines are caught. Signed-off-by: Pratyush Yadav Reviewed-by: Laurent Pinchart Reviewed-by: Tomi Valkeinen Reviewed-by: Maxime Ripard Signed-off-by: Jai Luthra --- drivers/media/platform/cadence/cdns-csi2rx.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c index 0947b112a573..5eeeb398cdb5 100644 --- a/drivers/media/platform/cadence/cdns-csi2rx.c +++ b/drivers/media/platform/cadence/cdns-csi2rx.c @@ -458,6 +458,10 @@ static const struct v4l2_subdev_ops csi2rx_subdev_ops = { .pad = &csi2rx_pad_ops, }; +static const struct media_entity_operations csi2rx_media_ops = { + .link_validate = v4l2_subdev_link_validate, +}; + static int csi2rx_async_bound(struct v4l2_async_notifier *notifier, struct v4l2_subdev *s_subdev, struct v4l2_async_connection *asd) @@ -674,6 +678,7 @@ static int csi2rx_probe(struct platform_device *pdev) for (i = CSI2RX_PAD_SOURCE_STREAM0; i < CSI2RX_PAD_MAX; i++) csi2rx->pads[i].flags = MEDIA_PAD_FL_SOURCE; csi2rx->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; + csi2rx->subdev.entity.ops = &csi2rx_media_ops; ret = media_entity_pads_init(&csi2rx->subdev.entity, CSI2RX_PAD_MAX, csi2rx->pads);