[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240222-multistream-v1-7-1837ed916eeb@ti.com>
Date: Thu, 22 Feb 2024 17:01:23 +0530
From: Jai Luthra <j-luthra@...com>
To: Tomi Valkeinen <tomi.valkeinen@...asonboard.com>,
Mauro Carvalho Chehab
<mchehab@...nel.org>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Hans
Verkuil <hverkuil-cisco@...all.nl>,
Vaishnav Achath <vaishnav.a@...com>,
Maxime Ripard <mripard@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof
Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley
<conor+dt@...nel.org>
CC: <linux-media@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<devicetree@...r.kernel.org>, Vignesh Raghavendra <vigneshr@...com>,
Aradhya
Bhatia <a-bhatia1@...com>, Devarsh Thakkar <devarsht@...com>,
Changhuang
Liang <changhuang.liang@...rfivetech.com>,
Jack Zhu
<jack.zhu@...rfivetech.com>,
Julien Massot <julien.massot@...labora.com>,
Jayshri Pawar <jpawar@...ence.com>, Jai Luthra <j-luthra@...com>
Subject: [PATCH RFC 07/21] media: ti: j721e-csi2rx: allocate DMA channel
based on context index
From: Pratyush Yadav <p.yadav@...com>
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 <p.yadav@...com>
Signed-off-by: Jai Luthra <j-luthra@...com>
---
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
Powered by blists - more mailing lists