mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 20:54:03 +02:00
dmaengine: dw-edma: Pass dma_slave_config to dw_edma_device_transfer()
Pass dma_slave_config to dw_edma_device_transfer() to support atomic configuration and descriptor preparation when a non-NULL config is provided to device_prep_config_sg(). Tested-by: Niklas Cassel <cassel@kernel.org> Reviewed-by: Manivannan Sadhasivam <mani@kernel.org> Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260521-dma_prep_config-v7-5-1f73f4899883@nxp.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
parent
bfb66d8098
commit
1af246e9d2
|
|
@ -267,6 +267,20 @@ static int dw_edma_device_config(struct dma_chan *dchan,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct dma_slave_config *
|
||||
dw_edma_device_get_config(struct dma_chan *dchan,
|
||||
struct dma_slave_config *config)
|
||||
{
|
||||
struct dw_edma_chan *chan;
|
||||
|
||||
if (config)
|
||||
return config;
|
||||
|
||||
chan = dchan2dw_edma_chan(dchan);
|
||||
|
||||
return &chan->config;
|
||||
}
|
||||
|
||||
static int dw_edma_device_pause(struct dma_chan *dchan)
|
||||
{
|
||||
struct dw_edma_chan *chan = dchan2dw_edma_chan(dchan);
|
||||
|
|
@ -385,7 +399,8 @@ dw_edma_device_tx_status(struct dma_chan *dchan, dma_cookie_t cookie,
|
|||
}
|
||||
|
||||
static struct dma_async_tx_descriptor *
|
||||
dw_edma_device_transfer(struct dw_edma_transfer *xfer)
|
||||
dw_edma_device_transfer(struct dw_edma_transfer *xfer,
|
||||
struct dma_slave_config *config)
|
||||
{
|
||||
struct dw_edma_chan *chan = dchan2dw_edma_chan(xfer->dchan);
|
||||
enum dma_transfer_direction dir = xfer->direction;
|
||||
|
|
@ -472,8 +487,8 @@ dw_edma_device_transfer(struct dw_edma_transfer *xfer)
|
|||
src_addr = xfer->xfer.il->src_start;
|
||||
dst_addr = xfer->xfer.il->dst_start;
|
||||
} else {
|
||||
src_addr = chan->config.src_addr;
|
||||
dst_addr = chan->config.dst_addr;
|
||||
src_addr = config->src_addr;
|
||||
dst_addr = config->dst_addr;
|
||||
}
|
||||
|
||||
if (dir == DMA_DEV_TO_MEM)
|
||||
|
|
@ -595,7 +610,7 @@ dw_edma_device_prep_config_sg(struct dma_chan *dchan, struct scatterlist *sgl,
|
|||
if (config && dw_edma_device_config(dchan, config))
|
||||
return NULL;
|
||||
|
||||
return dw_edma_device_transfer(&xfer);
|
||||
return dw_edma_device_transfer(&xfer, dw_edma_device_get_config(dchan, config));
|
||||
}
|
||||
|
||||
static struct dma_async_tx_descriptor *
|
||||
|
|
@ -614,7 +629,7 @@ dw_edma_device_prep_dma_cyclic(struct dma_chan *dchan, dma_addr_t paddr,
|
|||
xfer.flags = flags;
|
||||
xfer.type = EDMA_XFER_CYCLIC;
|
||||
|
||||
return dw_edma_device_transfer(&xfer);
|
||||
return dw_edma_device_transfer(&xfer, dw_edma_device_get_config(dchan, NULL));
|
||||
}
|
||||
|
||||
static struct dma_async_tx_descriptor *
|
||||
|
|
@ -630,7 +645,7 @@ dw_edma_device_prep_interleaved_dma(struct dma_chan *dchan,
|
|||
xfer.flags = flags;
|
||||
xfer.type = EDMA_XFER_INTERLEAVED;
|
||||
|
||||
return dw_edma_device_transfer(&xfer);
|
||||
return dw_edma_device_transfer(&xfer, dw_edma_device_get_config(dchan, NULL));
|
||||
}
|
||||
|
||||
static void dw_hdma_set_callback_result(struct virt_dma_desc *vd,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user