Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4139487rwb; Mon, 31 Jul 2023 01:54:32 -0700 (PDT) X-Google-Smtp-Source: APBJJlELL8ARqfTlxWVlDVZkTgJHvArmoOdqzmf1sJahIFQn195cGnUat5kt4TS4LbnCl3kMubbS X-Received: by 2002:a05:6a20:54a7:b0:126:9081:2156 with SMTP id i39-20020a056a2054a700b0012690812156mr10301563pzk.4.1690793671835; Mon, 31 Jul 2023 01:54:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690793671; cv=none; d=google.com; s=arc-20160816; b=HFWQkPxqt3LlaMpw37jHfZluakXcHVHB0rh6BVxWsJezKwXlDgzhSth1gjw6WXqvjR ejbkgGy+ztMp+R7udCZWPIiruTdH/BY9r03fLJKzoue1mn+ABQy+QirgZfPJpBFOv4JJ +rIoMJg8tQx+oe4kzPaVIE6cJtc+5yIqeXigli9dqNT5cWM1wwbyw0usfW2ddtf7pECQ NDpDAa05i5zPgMK33CzcrUf2UAd29EPGd6bN9an/3bsNM3PJuLdOK9bQfDFZI0H1tCvK VX2D4J5sUYrgSMylTgZFr0EhZLIW0sOkbSQ3uLju9Fmhvgs14AvH1f0mrg5bdfNVn2YD m1HQ== 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=TOWtliwygNzBGb/ibCY8FAVxTe5ucabVCXVLqbPzG3A=; fh=V3yzwYxt4PgbnoX3kc2m6CeiASFvGUTpa1ANjIQvoCg=; b=Lq4qgYl+lrbMsddjhh+nEOAaIRm89xpIPfcoHOiVqA69kCwpopBn11fGAKePAem9VE F2C3nx8k19w0GxtoVN5iEDHp51aUUdTEwGxW48GzmLvEgHwrjYWH6NxrmbRvPADiBKng fww6cgAAvs9TRtArmDZ1yIQQpatkrLUNlX0h+qRNLru6RB46nQe1VRnMUmredegNbgM3 frECd29gjGa9sKcgfBRHaKIkvOPsoss65HYo1ccpODhhyuFLH6qnSc/ezpOEuV+sFebe R+ySSS6GX2+R7Xj5UV8Yl4ADJ1nDmubwKW7frraGJRfke3p0y1h0rvxoLAwbbEeP9fVs bLQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=fIaJGn2u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c15-20020a056a000acf00b0067a0b355523si7131918pfl.116.2023.07.31.01.54.20; Mon, 31 Jul 2023 01:54:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=fIaJGn2u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232051AbjGaIa7 (ORCPT + 99 others); Mon, 31 Jul 2023 04:30:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230523AbjGaIao (ORCPT ); Mon, 31 Jul 2023 04:30:44 -0400 Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F58518E; Mon, 31 Jul 2023 01:29:59 -0700 (PDT) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 36V8TqJ3048214; Mon, 31 Jul 2023 03:29:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1690792192; bh=TOWtliwygNzBGb/ibCY8FAVxTe5ucabVCXVLqbPzG3A=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=fIaJGn2unbPw1Mt23rzSRB9Xi/xzDurGKkWRWJl2eeau5u5D4skECMlckWefBU/u7 XjQiKNYmuxFGLMQHN+moB7U5Gx+i94eX9bIXy17oIUCfW1l+Z2Pq4UogZIQsohujPU sWaP7l9EsvZh7NCBBg7boCX7691xyKtgXgcLsrlE= Received: from DLEE103.ent.ti.com (dlee103.ent.ti.com [157.170.170.33]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 36V8Tqg9106791 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 31 Jul 2023 03:29:52 -0500 Received: from DLEE100.ent.ti.com (157.170.170.30) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 31 Jul 2023 03:29:51 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE100.ent.ti.com (157.170.170.30) 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; Mon, 31 Jul 2023 03:29:51 -0500 Received: from localhost (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 36V8TpWw016622; Mon, 31 Jul 2023 03:29:51 -0500 From: Jai Luthra To: Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sakari Ailus , Laurent Pinchart , Tomi Valkeinen CC: , , , , Mauro Carvalho Chehab , Maxime Ripard , , Benoit Parrot , Vaishnav Achath , Vignesh Raghavendra , , , Subject: [PATCH v8 13/16] media: cadence: csi2rx: Add link validation Date: Mon, 31 Jul 2023 13:59:31 +0530 Message-ID: <20230731-upstream_csi-v8-13-fb7d3661c2c9@ti.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230731-upstream_csi-v8-0-fb7d3661c2c9@ti.com> References: <20230731-upstream_csi-v8-0-fb7d3661c2c9@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1422; i=j-luthra@ti.com; h=from:subject:message-id; bh=lSNQlPKlsyGFmQvca0Tc9mreF/svzWnzPl4bNCF+Gbw=; b=owEBbQKS/ZANAwAIAUPekfkkmnFFAcsmYgBkx2xuFFxXCi/8J1ntBEIvudOu6QOmI5HLZgulr QzzMndDLi2JAjMEAAEIAB0WIQRN4NgY5dV16NRar8VD3pH5JJpxRQUCZMdsbgAKCRBD3pH5JJpx RY8ND/9opPlc0xzjTFQ+5dHh0andZMH995yAV6YSP9Vn7g7jA/sVh41wZ+4dABSJ+SOgHDYzySX joGnF95eVSFz4LKXjkqcCo8Opzyem6zKhqhltK9C1WDIjkkpqgJa9qpDb6OynQ9NuG1xpK0Pm3u Nd3ALQBThfBCjjPbxjyU+uknE5PGi5PYE4AJGk17jwPdl0p2VS0SySenjQjuFwGuwFLoh4dOJZf QA2ZqMY0ETpL7jj91OEiv786R5Mgh6pH6qhgIb1tFpNLcHP+ILcfr4TOGzMJGh9Eo/Sq5euaeYm yTiX2MFTEX5VRGPmiNMhxTDkwUKxSRLcJ3G+QGisJ/eyLkQDO36peXpv8iFUGNnrE/98XNrqbBU Xv4Qmk+rzdCnJaLvWfK1eNrNxeB4TlZRnAA0qNfeJBLcSR+7Mm8i8xl1atEeK2pYS4HCylET8y6 mcO2CyEiFST9+8O4FbvT2ejLdxJw8VJi+DRndcQvBwNl8O953MibGx0GC7pXn0E2T+jtqrT6TCn PnswgYqHCnytTUdlZV5QrKb3rixrTfYxdTmPOyjyYF2KS+wgasY8sJI8YiPZmnsVtqHkT0173PJ wiKVlodoY/xAOhQckAkOWTqD4r8SuJp/4RN5MlxFpA25V/YcRIdozOTtKwaSpEri6nMZXBCTRxq emb1kfpe2Pptyqg== X-Developer-Key: i=j-luthra@ti.com; a=openpgp; fpr=4DE0D818E5D575E8D45AAFC543DE91F9249A7145 Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pratyush Yadav Add media link validation to make sure incorrectly configured pipelines are caught. Signed-off-by: Pratyush Yadav Signed-off-by: Jai Luthra Reviewed-by: Laurent Pinchart --- v7->v8: No change 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 d82a8938932f..aec33d28a66f 100644 --- a/drivers/media/platform/cadence/cdns-csi2rx.c +++ b/drivers/media/platform/cadence/cdns-csi2rx.c @@ -463,6 +463,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) @@ -679,6 +683,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.41.0