]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: ti: j721e-csi2rx: allocate DMA channel based on context index
authorPratyush Yadav <p.yadav@ti.com>
Wed, 20 May 2026 12:00:10 +0000 (17:30 +0530)
committerSakari Ailus <sakari.ailus@linux.intel.com>
Wed, 20 May 2026 12:28:37 +0000 (15:28 +0300)
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@ti.com>
Signed-off-by: Jai Luthra <j-luthra@ti.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Yemike Abhilash Chandra <y-abhilashchandra@ti.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Rishikesh Donadkar <r-donadkar@ti.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c

index 4adfae425f19281ae379186b101ae65198ade9b8..c781b312cea82de15c3c7fcdcf5a511c20823a63 100644 (file)
@@ -1036,9 +1036,11 @@ 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[5];
        int ret;
 
-       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);