Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp278900rdb; Thu, 22 Feb 2024 03:36:14 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVRdtgC97rCb8/jtcuFW+7aCwLECMoT7W7kMOpXWpg43VCqXU+5MvtQAjnqWj23sInO/Su0JtYWceO5JUL/kyiIVGaADabgWx89fNGb3A== X-Google-Smtp-Source: AGHT+IGI/X1yqJfwelYJyJpys+LRJY6k+w5OEgDlFBEWmhdZA40MsvTtDQTuMn76sYMYVuZKGJ28 X-Received: by 2002:a92:c548:0:b0:365:25c0:c82d with SMTP id a8-20020a92c548000000b0036525c0c82dmr17628633ilj.28.1708601774576; Thu, 22 Feb 2024 03:36:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708601774; cv=pass; d=google.com; s=arc-20160816; b=jc7MziNLuS8WmFnQZZ9JE5irqKFtprCk8XUvTd/zqM1hDKTqhOk6sdoIWyd1yu/ZKb NMgeBPfdHyIyOpSNKZYfjv6+UkbmifC8oAbINzsgZk4PHdaVT1+Op4265Z5brn5Xjhuo 5dkYR9hErhUeAn36ldcr/QvP94TjvAPIUTJ8LihOVOHp/kaHtu23gI6ZH+HMi1MHPh1X zfZCwlG5dCqkwyojhNOhD7cbLUZCZLniQfxFf9i8H96RWsTnjPbqsB9Tx+gVPTWE/xbS U74zvEXGnMV7GcX5+ZAISUXRLqXYgiyvMbigGZr9U7oiEzsIH3muCf3WqSJr/kIlQSyZ 6dbg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=D1JcLO4nEUWK7guThesjK1pDOn36eFgs8+2V3wttK6k=; fh=7Ze5xPQXuwRxFNHD2ILqwMPZ5wjg3PcSuREjIh8VhDo=; b=WziGINmcv6gSQRdTiEij4vxkY3gDCy+Z7Y3CTpaAhytplTXoYvc3nuzqnK62eFdzJH ViqLPQaoyBPMGBC3Qx7inRanAQOar6HidhiTn1HiOqtzZzBdkxBbJ/eENXhbG/2d8ors NYOoqBlJYJodke41calobfXTinuNqIT8KEDua85S/Ss/wN1sabHi2UrJuv/qRMolG0w9 /Yac75wN5SPLVy50MfDyHmYVnYKYkyn9oy7mspY2cQJoXetEfGMZza4lNqVRvDJ4xpdp 0P623yHzyMTWPwn/dERhaMECrG5KGI3XX+bnxA9pMvM60EqVxBQFlTTZQqK4zbOl5eaB zDFQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=CYmtYY5x; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-76425-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76425-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d68-20020a633647000000b005dc50694bb3si9821508pga.718.2024.02.22.03.36.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 03:36:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76425-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=CYmtYY5x; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-76425-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76425-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id EC9FF281145 for ; Thu, 22 Feb 2024 11:36:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D8E0F4F208; Thu, 22 Feb 2024 11:33:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="CYmtYY5x" Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AC2B44D5A5; Thu, 22 Feb 2024 11:33:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.248 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708601621; cv=none; b=DFD40M4O3gjBAibccWAEf0oHkyObO4X4hRNWSUtcDg5xDx+KCSznxXD1j+1aIVxeTSDS7+Yo5opMV2MC/WBw3wrY9C/5pcio/tKBttbesaN+IPIH2gYaQufFb3EKbm0DxvUScLmMVWU2R7kICG8E2WTTJSgRb5HfrAAh6r3ZR1I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708601621; c=relaxed/simple; bh=OAFyGIfI4QNtZqZsii8PfuhldKXwI8qlEf3a30bhc4U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=cgbydQEWtel6lBNiwY6asafaVIngrXiUM8buFSVePh3Xfsdb8tX8xOzdBWjhK+KQnsX0HgzXX/SwzGyNStS5F4VyVtE00OzWLnaDPO4mkt0M1IgVNu7g+KlWk2Wp6ni3ferRqZW0+HUEZKMm/mvt9UyNy47E6YaJtIp3DV48cSM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=CYmtYY5x; arc=none smtp.client-ip=198.47.23.248 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 41MBXRN6018078; Thu, 22 Feb 2024 05:33:27 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1708601607; bh=D1JcLO4nEUWK7guThesjK1pDOn36eFgs8+2V3wttK6k=; h=From:Date:Subject:References:In-Reply-To:To:CC; b=CYmtYY5xhJEpgeHqjK8iEU5EeODd4qC7hDav5rv5m2zpcEUtCBC4xwy24wkEEoI6Q Id3pkVxl3WM3kj7uVm4DxDKMe7OmRrgtWj7C4IMO1hTABE6FLjLuRFRle4ITsJRUTV Ffi3ysN0biuDFLy4FY2YIzjlm8v//r1bBBE05qZ8= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 41MBXQG3059446 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 22 Feb 2024 05:33:27 -0600 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 22 Feb 2024 05:33:26 -0600 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DFLE100.ent.ti.com (10.64.6.21) 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; Thu, 22 Feb 2024 05:33:26 -0600 Received: from localhost (jluthra.dhcp.ti.com [172.24.227.217]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 41MBXPTo128738; Thu, 22 Feb 2024 05:33:26 -0600 From: Jai Luthra Date: Thu, 22 Feb 2024 17:01:27 +0530 Subject: [PATCH RFC 11/21] media: cadence: csi2rx: add get_frame_desc wrapper Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-ID: <20240222-multistream-v1-11-1837ed916eeb@ti.com> References: <20240222-multistream-v1-0-1837ed916eeb@ti.com> In-Reply-To: <20240222-multistream-v1-0-1837ed916eeb@ti.com> To: Tomi Valkeinen , Mauro Carvalho Chehab , Sakari Ailus , Hans Verkuil , Vaishnav Achath , Maxime Ripard , Rob Herring , Krzysztof Kozlowski , Conor Dooley CC: , , , Vignesh Raghavendra , Aradhya Bhatia , Devarsh Thakkar , Changhuang Liang , Jack Zhu , Julien Massot , Jayshri Pawar , Jai Luthra X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=2073; i=j-luthra@ti.com; h=from:subject:message-id; bh=UVjvXFZDdMcwPLK95L3EAt34fnv5iTWXgWYHYS6GVzQ=; b=owEBbQKS/ZANAwAIAUPekfkkmnFFAcsmYgBl1zDkR+ssg4gl30zSyVASKScmFXRmSLcX+zSte ZSKKYCvG+GJAjMEAAEIAB0WIQRN4NgY5dV16NRar8VD3pH5JJpxRQUCZdcw5AAKCRBD3pH5JJpx Rd1/EADDcvgw+Hz3E/hhe2SkvFpelMMmoxA0L9R4N5mHIxG4qikx7Nyt+T3bYcs3EK49nj1kD2r xfvbGT465MFEjXz3P6Uc/nRHQhuqGB8VpaEtQrlsmCw8jVr/VkDuKeN81CxhizFb/ZFzFuN6yfL UzvTYYKVae8EhsYYNVOUO0qat20bpviP6nbRYa9czF7ikD7Lzr3q3RWU4vGd6bqu///pLBub5Jz r5Aud8Xv4gbY+V75rJoQS6Eyo2y2rfvzpb7YfK/PvCE5djeM5f2h0WIRAq7Y/PGTYnTdXIfaWAp a4XmXNCnAM3r3oIySGHBTd4qS1ossYBgYyjh3/2w5lRa1b3rkxL6/KG6sjpHfyJLRjXkqDV4QO1 WJ2r9HMdXGXU8Y4UToBrKL/pM8qopVs5vhHgiLP1NVh96UQ9T376ogJue/p+gfJbsyPcqd++AfH 9LllgBiJPuwkU0I34FhF6OAPdyuuLzJEMppadUvFhVMALWeOok0icDKKoAdVYUBCPmfV+9srtZF X1CzfinQEnk5E9CaK1fjTqc4k7XJD0z4N+Ow8jwrB61SRsUChMTIpX7+qQBrWJW7xYKlRNhAXM8 SeEFfDCy9qDjCIF7MIBD+JmTVFqyxlN0DURi27wBL91GOW7uSK7ly/OJOA4hRaK2FjoysNDt435 LD8ObJXdme665Rw== X-Developer-Key: i=j-luthra@ti.com; a=openpgp; fpr=4DE0D818E5D575E8D45AAFC543DE91F9249A7145 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 From: Pratyush Yadav J721E wrapper CSI2RX driver needs to get the frame descriptor from the source to find out info about virtual channel. This driver itself does not touch the routing or virtual channels in any way. So simply pass the descriptor through from the source. Signed-off-by: Pratyush Yadav Signed-off-by: Jai Luthra --- drivers/media/platform/cadence/cdns-csi2rx.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c index e19993ed351c..989924dba9a9 100644 --- a/drivers/media/platform/cadence/cdns-csi2rx.c +++ b/drivers/media/platform/cadence/cdns-csi2rx.c @@ -139,6 +139,21 @@ static const struct csi2rx_fmt *csi2rx_get_fmt_by_code(u32 code) return NULL; } +static int csi2rx_get_frame_desc_from_source(struct csi2rx_priv *csi2rx, + struct v4l2_mbus_frame_desc *fd) +{ + struct media_pad *remote_pad; + + remote_pad = media_entity_remote_source_pad_unique(&csi2rx->subdev.entity); + if (!remote_pad) { + dev_err(csi2rx->dev, "No remote pad found for sink\n"); + return -ENODEV; + } + + return v4l2_subdev_call(csi2rx->source_subdev, pad, get_frame_desc, + remote_pad->index, fd); +} + static inline struct csi2rx_priv *v4l2_subdev_to_csi2rx(struct v4l2_subdev *subdev) { @@ -470,10 +485,19 @@ static int csi2rx_init_state(struct v4l2_subdev *subdev, return csi2rx_set_fmt(subdev, state, &format); } +static int csi2rx_get_frame_desc(struct v4l2_subdev *subdev, unsigned int pad, + struct v4l2_mbus_frame_desc *fd) +{ + struct csi2rx_priv *csi2rx = v4l2_subdev_to_csi2rx(subdev); + + return csi2rx_get_frame_desc_from_source(csi2rx, fd); +} + static const struct v4l2_subdev_pad_ops csi2rx_pad_ops = { .enum_mbus_code = csi2rx_enum_mbus_code, .get_fmt = v4l2_subdev_get_fmt, .set_fmt = csi2rx_set_fmt, + .get_frame_desc = csi2rx_get_frame_desc, }; static const struct v4l2_subdev_video_ops csi2rx_video_ops = { -- 2.43.0