]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
DMA: AT91: Get transfer width
authorElen Song <elen.song@atmel.com>
Fri, 10 May 2013 03:00:50 +0000 (11:00 +0800)
committerVinod Koul <vinod.koul@intel.com>
Fri, 5 Jul 2013 06:10:30 +0000 (11:40 +0530)
In one dma transfer, the data transfer width can be configured and it is limited by source or destination peripheral width,
tx_width will save the transfer width, but for memcpy, either source or destination transfer width is taken as tx_width.

Signed-off-by: Elen Song <elen.song@atmel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/at_hdmac.c
drivers/dma/at_hdmac_regs.h

index 9e1ad73a78cf2acd21ec22411217c2c1ce57defc..4c101a9dd3cb9268a2994f7011e0e3f86d5016fb 100644 (file)
@@ -615,6 +615,7 @@ atc_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
        /* First descriptor of the chain embedds additional information */
        first->txd.cookie = -EBUSY;
        first->len = len;
+       first->tx_width = src_width;
 
        /* set end-of-link to the last link descriptor of list*/
        set_desc_eol(desc);
@@ -761,6 +762,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
        /* First descriptor of the chain embedds additional information */
        first->txd.cookie = -EBUSY;
        first->len = total_len;
+       first->tx_width = reg_width;
 
        /* first link descriptor of list is responsible of flags */
        first->txd.flags = flags; /* client is in control of this ack */
@@ -919,6 +921,7 @@ atc_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
        /* First descriptor of the chain embedds additional information */
        first->txd.cookie = -EBUSY;
        first->len = buf_len;
+       first->tx_width = reg_width;
 
        return &first->txd;
 
index c604d26fd4d38cf48b437157a47450c49a076719..3679933fb646e1a718ab7044f8d1b5cf912952e1 100644 (file)
@@ -182,6 +182,7 @@ struct at_lli {
  * @txd: support for the async_tx api
  * @desc_node: node on the channed descriptors list
  * @len: total transaction bytecount
+ * @tx_width: transfer width
  */
 struct at_desc {
        /* FIRST values the hardware uses */
@@ -192,6 +193,7 @@ struct at_desc {
        struct dma_async_tx_descriptor  txd;
        struct list_head                desc_node;
        size_t                          len;
+       u32                             tx_width;
 };
 
 static inline struct at_desc *