Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1400988pxb; Fri, 21 Jan 2022 17:44:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJz7nBMPwJbadAB9cGnRyQTK0XA1KG3Ahqwdr5I+KxUIExnl5NEQTC2MKYougRsF63qZZsuY X-Received: by 2002:a63:8a44:: with SMTP id y65mr4561788pgd.423.1642815873236; Fri, 21 Jan 2022 17:44:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642815873; cv=none; d=google.com; s=arc-20160816; b=GBzu+rlZk9VL/6VBW481uoqnY5IaYOXgkZYQ1QZLHuyk/JuHQgjh0EgjpBYmEngsXU YrFja3XODuRq11RfKySazBPkopeDQnXe8CE4S5cJlyvhmW2k3nyrWeDKZUpQpCPSaiQi /LGA5FhgJL6RmuLJLfYnglczQYIg68Dhkn28We4IUrnpjO6hxAo/VbJZ36fA/gkkYOV8 fIx9oyGlnCRWqzqPycZiPePzXkpXYSKIXgtxCBuhUQ8u+Qsq0p2oq+FkUKxFJ/ZBYzoa hlU2sU0ag/lxMAYai/qNkdOxYLrEe3QD+YOYsijFrudDqPF+OgGfzVBhreSj//jxDyI4 4/gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4Q48z0LqKBQT/5pCnIc2Po5RUq0oqV/Wkj7rWX9ppbU=; b=e0UmSxicNEmNKe+4pIQdCA6o4nq5q7I5L/DBTcJxLBCdxVHw4K9a3OyXy9YM8TAo6L Z7l0A2cFnf8CBwE1xPzpIm4yZ2uFVfi2oo3LPaiwUpWXAJJEJ85R4rz03J7QGhWjqL2C qyqHRN4sg9gSWheVvjhEfDm5YTOgb/tqJBoMIEd7SHSJpuiJLkXhODcBaYC1lJSaveNt 0gHrJYPgNklLp7Avp/HQ8wWYelGS/oE1tOyRHtgpbmeHu4yLrEWu2PQ/NP93xizoCF6e kT8Qi5/CVUxx1nIRFjTPnBx5FTMqQt2mRvL9sdQZNWM2DnpPOWxBNsR4fDZg5HZh0+ms DXIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=pULG3GCj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pg12si8529042pjb.115.2022.01.21.17.44.21; Fri, 21 Jan 2022 17:44:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=pULG3GCj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381241AbiAUOaX (ORCPT + 99 others); Fri, 21 Jan 2022 09:30:23 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:60350 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381148AbiAUO3u (ORCPT ); Fri, 21 Jan 2022 09:29:50 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 20LETiUN047933; Fri, 21 Jan 2022 08:29:44 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1642775384; bh=4Q48z0LqKBQT/5pCnIc2Po5RUq0oqV/Wkj7rWX9ppbU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=pULG3GCjpHIMH1oFNCB8DCS7ADrqGM4Si+7UU0rJa8bq2ioeVX27NKfX4nFADHtHV FZjzCOEmAwSgjrQGnF+vzVJK8W5RAfR6PrH5cw5vhWpl3+40LCjSEJ1iPnrp24vZqh gfYE2EhlpY3wlA1yDGa4yvKDjq0PcJQHWg6pa3EQ= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 20LETh9i048502 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 21 Jan 2022 08:29:44 -0600 Received: from DLEE107.ent.ti.com (157.170.170.37) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Fri, 21 Jan 2022 08:29:43 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Fri, 21 Jan 2022 08:29:43 -0600 Received: from pratyush-4F-325.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 20LET4Hu072129; Fri, 21 Jan 2022 08:29:40 -0600 From: Pratyush Yadav To: Mauro Carvalho Chehab CC: Pratyush Yadav , Laurent Pinchart , Nikhil Devshatwar , Tomi Valkeinen , Benoit Parrot , Maxime Ripard , Rob Herring , Sakari Ailus , =?UTF-8?q?Niklas=20S=C3=B6derlund?= , , , Subject: [PATCH v6 09/14] media: cadence: csi2rx: Add link validation Date: Fri, 21 Jan 2022 19:58:59 +0530 Message-ID: <20220121142904.4091481-10-p.yadav@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220121142904.4091481-1-p.yadav@ti.com> References: <20220121142904.4091481-1-p.yadav@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add media link validation to make sure incorrectly configured pipelines are caught. Signed-off-by: Pratyush Yadav Reviewed-by: Laurent Pinchart --- Changes in v6: - Drop transcoding from the commit message. - Make csi2rx_media_ops const. - Add Laurent's R-by. Changes in v5: - New in v5. 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 28fb2078d10d..08866bc64c33 100644 --- a/drivers/media/platform/cadence/cdns-csi2rx.c +++ b/drivers/media/platform/cadence/cdns-csi2rx.c @@ -479,6 +479,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_subdev *asd) @@ -678,6 +682,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); -- 2.34.1