Skip to content

Commit d088c33

Browse files
ElenSongVinod Koul
authored andcommitted
DMA: AT91: Get transfer width
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>
1 parent 6c22770 commit d088c33

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

‎drivers/dma/at_hdmac.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,7 @@ atc_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
615615
/* First descriptor of the chain embedds additional information */
616616
first->txd.cookie = -EBUSY;
617617
first->len = len;
618+
first->tx_width = src_width;
618619

619620
/* set end-of-link to the last link descriptor of list*/
620621
set_desc_eol(desc);
@@ -761,6 +762,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
761762
/* First descriptor of the chain embedds additional information */
762763
first->txd.cookie = -EBUSY;
763764
first->len = total_len;
765+
first->tx_width = reg_width;
764766

765767
/* first link descriptor of list is responsible of flags */
766768
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,
919921
/* First descriptor of the chain embedds additional information */
920922
first->txd.cookie = -EBUSY;
921923
first->len = buf_len;
924+
first->tx_width = reg_width;
922925

923926
return &first->txd;
924927

‎drivers/dma/at_hdmac_regs.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ struct at_lli {
182182
* @txd: support for the async_tx api
183183
* @desc_node: node on the channed descriptors list
184184
* @len: total transaction bytecount
185+
* @tx_width: transfer width
185186
*/
186187
struct at_desc {
187188
/* FIRST values the hardware uses */
@@ -192,6 +193,7 @@ struct at_desc {
192193
struct dma_async_tx_descriptor txd;
193194
struct list_head desc_node;
194195
size_t len;
196+
u32 tx_width;
195197
};
196198

197199
static inline struct at_desc *

0 commit comments

Comments
 (0)