mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
dmaengine: add dmaengine_get_max_xor() helper
Add a new inline helper dmaengine_get_max_xor() that returns the maximum number of XOR source buffers supported by the DMA channel's device. Returns 0 if the channel is NULL or does not support XOR operations. Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20261005-dmaengine_prep_dma_pq-v3-5-a4a241f26fa7@nxp.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
parent
bbc109e0e6
commit
bff69558d6
|
|
@ -1252,6 +1252,21 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_memcpy(
|
|||
len, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* dmaengine_get_max_xor - get the maximum number of XOR sources for a channel
|
||||
* @chan: DMA channel
|
||||
*
|
||||
* Returns the maximum number of source buffers supported by the XOR engine
|
||||
* behind @chan, or 0 if the channel does not support XOR operations.
|
||||
*/
|
||||
static inline unsigned int dmaengine_get_max_xor(struct dma_chan *chan)
|
||||
{
|
||||
if (!chan || !chan->device)
|
||||
return 0;
|
||||
|
||||
return chan->device->max_xor;
|
||||
}
|
||||
|
||||
/**
|
||||
* dmaengine_prep_dma_xor - prepare a DMA XOR operation
|
||||
* @chan: the channel to use for this operation
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user