From patchwork Tue Mar 14 11:55:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaishnav Achath X-Patchwork-Id: 69535 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1719015wrd; Tue, 14 Mar 2023 05:12:42 -0700 (PDT) X-Google-Smtp-Source: AK7set9nqBnw4SG9SUP5ga3JMDHoUrSyUYFULM3LEMgZzpHq/gBmy/ZhDrhOnzs/ZqI64hgD/y0t X-Received: by 2002:a05:6e02:e0b:b0:316:b0b2:beff with SMTP id a11-20020a056e020e0b00b00316b0b2beffmr1763237ilk.4.1678795962162; Tue, 14 Mar 2023 05:12:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678795962; cv=none; d=google.com; s=arc-20160816; b=P0yVIo86org1EUM/+qacpFL8azOvt9p8PFcJN0r1Ic4Nu+KVyq3ZLjbgDFQO2EGxqX L6Rkf/s8pG7quVSpMEpK/4Q2QOLgBqjZapitG0fSUab8vReG8EyY1shCHfjG4H92e12G jmRqDiMA0d7jJZIL/p4km7XH75lc6W1ytlsOlNdKMNS9GIZ3r2+yBsF6AFrqfPqPXvX7 dU4udfBHKrtyJvGZiPC37q2nFMsx2Tj2Kuoe2vkJ58MKN6Yjmjzz5F9bLGP1vW8mEo6t qUQL70S1J3riTlaom1deyK7O9Uq6nO/cm68tntxNANZmr2FOpX/v8kxR0IUu6oEg9xnM f/gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=PSh3JOfebxzHh7OMYrBExmtN8GkKJtYIG5XeSZ5WRJ8=; b=FVTq7LVfJX7UBJ0cAIIgjusksHMPdvPybgYSGS7KajhkWbT72EkOzwiunRzXGmbiq2 +HZwZ9ygPS3A8KqGCj0vjdJLV4zqyjYjbcDP2lNYGCx/dVxu0r5LVlWVBRXHy959blH4 zGOVITzuIZFYKF9Q+A6I3uq7VNo1q089D4+NElvuMXVaeDvcdk8Jnx2jK6MtvO7gaSkT 87fC7puFOxfKS535TDo/3J4/cqq2dV3WID+20/MYWW3UEoIg9YoAiuCA/XU4dcvuOxiC SziWgUY6a+lyH7f3G4j+6mvhOlvGTfvGiK5o3iJUptajiYZINmQhKHX7UNBaEDMYw2+K nQXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="Su7nFBh/"; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j18-20020a056e02219200b0031402bfcb5esi2570749ila.3.2023.03.14.05.12.27; Tue, 14 Mar 2023 05:12:42 -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="Su7nFBh/"; 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 S231715AbjCNL44 (ORCPT + 99 others); Tue, 14 Mar 2023 07:56:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231664AbjCNL40 (ORCPT ); Tue, 14 Mar 2023 07:56:26 -0400 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22349A02A1; Tue, 14 Mar 2023 04:56:06 -0700 (PDT) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 32EBtaYc051532; Tue, 14 Mar 2023 06:55:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1678794936; bh=PSh3JOfebxzHh7OMYrBExmtN8GkKJtYIG5XeSZ5WRJ8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Su7nFBh/KSWTs/gEusIwMC03o1mZfShIYEvkjrsIqUp/RVF3zrgz1MBWuLWmkC66u LGWGfjhUFKCVZ9+5nsD6tkY3+iITTccZalS8EqCa4AyvGbYUxmDPZ7ybHw+Mr17jIf IyENeFY2VCjPh5Va+/khHY9e6YdtSZM5yNmJTVtE= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 32EBtaXV003130 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 14 Mar 2023 06:55:36 -0500 Received: from DLEE110.ent.ti.com (157.170.170.21) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Tue, 14 Mar 2023 06:55:36 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE110.ent.ti.com (157.170.170.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Tue, 14 Mar 2023 06:55:35 -0500 Received: from localhost (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 32EBtYXt072629; Tue, 14 Mar 2023 06:55:35 -0500 From: Vaishnav Achath To: , , , , , , , , CC: , , , , , , , , , , Subject: [PATCH v7 09/13] media: cadence: csi2rx: Add link validation Date: Tue, 14 Mar 2023 17:25:12 +0530 Message-ID: <20230314115516.667-10-vaishnav.a@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230314115516.667-1-vaishnav.a@ti.com> References: <20230314115516.667-1-vaishnav.a@ti.com> MIME-Version: 1.0 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, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760345154512111697?= X-GMAIL-MSGID: =?utf-8?q?1760345154512111697?= From: Pratyush Yadav Add media link validation to make sure incorrectly configured pipelines are caught. Signed-off-by: Pratyush Yadav Signed-off-by: Vaishnav Achath Reviewed-by: Laurent Pinchart --- (no changes since v6) 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 639ade97b998..026d95d60654 100644 --- a/drivers/media/platform/cadence/cdns-csi2rx.c +++ b/drivers/media/platform/cadence/cdns-csi2rx.c @@ -478,6 +478,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) @@ -677,6 +681,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);