Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp278698rdb; Thu, 22 Feb 2024 03:35:47 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUJyansl1FhSkYNxR2O5J8cEFKONgacFaUCea7h0Nw89jZcFjgJkarF5LKy9K7sZHYWm98ZwvdG1qu3E9VN+77v0of155zK42a21v3oSw== X-Google-Smtp-Source: AGHT+IHZHce6HOKOSfYyzlVMnrffwWYpM9X0u2BVaidSkDxXfKw9FyBzWSppmMtajzKd8/2b0S/r X-Received: by 2002:a05:620a:28c3:b0:787:90a4:7694 with SMTP id l3-20020a05620a28c300b0078790a47694mr4278118qkp.61.1708601746933; Thu, 22 Feb 2024 03:35:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708601746; cv=pass; d=google.com; s=arc-20160816; b=02pOPQZwUM57/S58nmzeEmaZN/8UbPJPu/vOKC1sq2h9d9vtbrFmtJ/pL66qZW4oN8 d7792hu6JvomhPikNA6uYW7eYLhApjjkcYeiETNUDjbLwqwZUyZXcl+HQLuKsVd5IJca nV0D2VHmXO+ImRcHihLQnUuMaXYTVl5Mg2yjkXpgRnkZYvIkSIWvgSl2zChOIm6TsXSQ lINQlkWoxVh3Ptn017ygoPK606Y/bfUBtSvcqjwOEiPmGlSubtw+qAbzNvn7ya6MUO9K +6gE6+8NqJdQhnU3oUQ4ujpIAXYjgy/eq3effX9VjpUsNbrXf/9F4xugybGzrOC/jgin KmfA== 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=hjMUTlmpymMtXih2bSHWH48S62epqs0t4UUSlAQaSfc=; fh=7Ze5xPQXuwRxFNHD2ILqwMPZ5wjg3PcSuREjIh8VhDo=; b=Oxv0YorrQDUgTZYzgNzXXslx6Z/lIDdKvtkPhvOlV2Tu+1ezqOjvZhflr7aoVVYaZX CtLvZ+JRZvjV3Jo5Ejh2uqP6i6uW1X7exX9sjpVFV3ZUhXACfZTlXZOZg8MW9fzr8QSy 2wGeYVXgCkpjy7IaojmvGXm2+BQkG3abbxwDOjC0F0ePXz3qIbcOqLIeR50EBu0KqrmJ mPkU36bIw8ZT7ddIIQOxge1iRJ4prKvPRqMSpRzthE1+bCVhpv5msncl1v3nHlniKzTa 8VbMm9TAozzmip0FHdb/+VD+VwT++EE48uwyDZ6KfQPSoo6lt31L3XS/SyFIE0AO/fId nguw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=HnHxeBrR; 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-76423-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76423-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id dz19-20020a05620a2b9300b0078763dd50dcsi10471930qkb.28.2024.02.22.03.35.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 03:35:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76423-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=HnHxeBrR; 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-76423-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76423-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 9A68B1C233E9 for ; Thu, 22 Feb 2024 11:35:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 467014E1C1; Thu, 22 Feb 2024 11:33:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="HnHxeBrR" Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (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 CFE494C615; Thu, 22 Feb 2024 11:33:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.142 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708601619; cv=none; b=GC+ik3t2K8vzNDGR3h+pVbwQsly2ieXRMmjXzT0A4r8A851D82rHaX/OhprOZ/yFcSet8AZdi8fR41Ie2riGHsrtQeJoUWENSBaQbOvSsyoKWwvjqRvLSXMWPn8uZm9s1jNQjzjGtqZ5IVMAbPhPAauiGD4QJavpDMncItLtcz4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708601619; c=relaxed/simple; bh=NkuknAzJS/tKWohPGjD0ggsJ9LC//lHX1riPoRArDVA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=igC8O3SHt+87TMyS7weeOsFpxp/1CqnFvmuVkQEMCkQI5XRxXh1UHc1vL9qQVSgyu3UxhF+8a1KPhFRZomjp9sIhdRIls2s9eDDoADfr3hpAitRQppHVXlIL8Zt0OQIrN0eVnZbnhA++7wqDUdOEp+pi01Ib1looqmwt4DQIQlM= 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=HnHxeBrR; arc=none smtp.client-ip=198.47.19.142 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 fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 41MBXJoU027794; Thu, 22 Feb 2024 05:33:19 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1708601599; bh=hjMUTlmpymMtXih2bSHWH48S62epqs0t4UUSlAQaSfc=; h=From:Date:Subject:References:In-Reply-To:To:CC; b=HnHxeBrRL1m60sAWYTmXMZm1gU+wEB5s002vTWa5hj68MRZi38olVoRpFU4VqUwbE nkxDhv5Su5+d4l6TMxDGSooU8LUErYZVN/7T1LqDhBF7in0r+0wfe/YEGDrJeADNP+ PSeYSo/0CKOxF7EYDuwE+MFXLQea+ssozng/Bl5A= Received: from DFLE111.ent.ti.com (dfle111.ent.ti.com [10.64.6.32]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 41MBXJIa014107 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 22 Feb 2024 05:33:19 -0600 Received: from DFLE110.ent.ti.com (10.64.6.31) 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; Thu, 22 Feb 2024 05:33:19 -0600 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DFLE110.ent.ti.com (10.64.6.31) 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:19 -0600 Received: from localhost (jluthra.dhcp.ti.com [172.24.227.217]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 41MBXI4I091205; Thu, 22 Feb 2024 05:33:18 -0600 From: Jai Luthra Date: Thu, 22 Feb 2024 17:01:23 +0530 Subject: [PATCH RFC 07/21] media: ti: j721e-csi2rx: allocate DMA channel based on context index 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-7-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=1393; i=j-luthra@ti.com; h=from:subject:message-id; bh=j/FVZDj0NTL0RooVFkoPWVyiLPQWJuy0qgzy23a+DCk=; b=owEBbQKS/ZANAwAIAUPekfkkmnFFAcsmYgBl1zDgjkgKNhaK9vvGfp6LiC19Sop3UFGjD99R6 Vw3ghcnJV2JAjMEAAEIAB0WIQRN4NgY5dV16NRar8VD3pH5JJpxRQUCZdcw4AAKCRBD3pH5JJpx RcBoEAC8/QUsQHYZ0+ro1rkl3HbyiG2cKH3JNb922sofqqly+8FiQQ1yGD6+QfdxUEY8Brfqd3J NQRl88JCwstd6E+F66sTTbFeoTHq5MtflkqdJLLzRr8kDQBhFYx+0+/P5sVqhAZtbJhJb7R4Lxi CmKRBz1NjPx5ATtvDK74+dEinWCx1Z9A6/YwnHF9dMdTTTlRtUIehaSVUZMCoFYfsXcw8vNEIw1 yiC9gIXVtyJHH/EUKFLxWKGSubCqlQJMG264SLVMSimMofCIPt808tbijPrMKWUlqwU0pegbzj+ UrNdR+rZl7yO4f/LX4GUxOLn3SyJY9vpFiIGiI6Vvxr6OXjdYoz2RSRpPnftQ1huIgrbtuU3qUD lH50g8AEzsC0iIkp9oPbTs2bg3mbo15/YDk8mmS79yN1ilWRmmq3fXs18fCFe1UNQkCByoxvdUG IQpAluicWKsyE8NmPBB2nmMCrQIMPF+7zLQLBm25dsAbtEddTzsAy/Bq8W/KgbTHHM+qy9HLmye UTqJaN/kuzLanNpFLYgi/cpzUT2oEIm3FLtr+myh6wDSf4MxPvrNite13goNMCN9UzcBwgbejnw XYKG9LPfDO6EEooK3vNXqCTRlcgBxJL5TB5+mW6xDOvgHx9HHNPyyPc0QdFN1XePE20/vssjC7K onTcapLpySzFOiA== X-Developer-Key: i=j-luthra@ti.com; a=openpgp; fpr=4DE0D818E5D575E8D45AAFC543DE91F9249A7145 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 From: Pratyush Yadav With multiple contexts, there needs to be a different DMA channel for each context. Earlier, the DMA channel name was hard coded to "rx0" for the sake of simplicity. Generate the DMA channel name based on its index and get the channel corresponding to the context. Signed-off-by: Pratyush Yadav Signed-off-by: Jai Luthra --- drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c index e42941d8c457..80d7066100bf 100644 --- a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c +++ b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c @@ -1051,6 +1051,7 @@ static int ti_csi2rx_init_dma(struct ti_csi2rx_ctx *ctx) struct dma_slave_config cfg = { .src_addr_width = DMA_SLAVE_BUSWIDTH_16_BYTES, }; + char name[32]; int ret; INIT_LIST_HEAD(&ctx->dma.queue); @@ -1059,7 +1060,8 @@ static int ti_csi2rx_init_dma(struct ti_csi2rx_ctx *ctx) ctx->dma.state = TI_CSI2RX_DMA_STOPPED; - ctx->dma.chan = dma_request_chan(ctx->csi->dev, "rx0"); + snprintf(name, sizeof(name), "rx%u", ctx->idx); + ctx->dma.chan = dma_request_chan(ctx->csi->dev, name); if (IS_ERR(ctx->dma.chan)) return PTR_ERR(ctx->dma.chan); -- 2.43.0