]> git.karo-electronics.de Git - linux-beck.git/commitdiff
dma: add support for scatterlist to scatterlist copy
authorIra Snyder <iws@ovro.caltech.edu>
Thu, 30 Sep 2010 11:46:44 +0000 (11:46 +0000)
committerDan Williams <dan.j.williams@intel.com>
Thu, 7 Oct 2010 21:41:40 +0000 (14:41 -0700)
This adds support for scatterlist to scatterlist DMA transfers. A
similar interface is exposed by the fsldma driver (through the DMA_SLAVE
API) and by the ste_dma40 driver (through an exported function).

This patch paves the way for making this type of copy operation a part
of the generic DMAEngine API. Futher patches will add support in
individual drivers.

Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/dma/dmaengine.c
include/linux/dmaengine.h

index 9d31d5eb95c1ea47618b01ed61206eaf315a7925..db403b8ccabd855165d7535eb095291c4c8e95a3 100644 (file)
@@ -690,6 +690,8 @@ int dma_async_device_register(struct dma_device *device)
                !device->device_prep_dma_memset);
        BUG_ON(dma_has_cap(DMA_INTERRUPT, device->cap_mask) &&
                !device->device_prep_dma_interrupt);
+       BUG_ON(dma_has_cap(DMA_SG, device->cap_mask) &&
+               !device->device_prep_dma_sg);
        BUG_ON(dma_has_cap(DMA_SLAVE, device->cap_mask) &&
                !device->device_prep_slave_sg);
        BUG_ON(dma_has_cap(DMA_SLAVE, device->cap_mask) &&
index e2106495cc11383ad9a14d7ac119400b18a8f83a..2c9ee98f6c77db9553f9824613b6c65a944e544b 100644 (file)
@@ -64,6 +64,7 @@ enum dma_transaction_type {
        DMA_PQ_VAL,
        DMA_MEMSET,
        DMA_INTERRUPT,
+       DMA_SG,
        DMA_PRIVATE,
        DMA_ASYNC_TX,
        DMA_SLAVE,
@@ -473,6 +474,11 @@ struct dma_device {
                unsigned long flags);
        struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)(
                struct dma_chan *chan, unsigned long flags);
+       struct dma_async_tx_descriptor *(*device_prep_dma_sg)(
+               struct dma_chan *chan,
+               struct scatterlist *dst_sg, unsigned int dst_nents,
+               struct scatterlist *src_sg, unsigned int src_nents,
+               unsigned long flags);
 
        struct dma_async_tx_descriptor *(*device_prep_slave_sg)(
                struct dma_chan *chan, struct scatterlist *sgl,