]> git.karo-electronics.de Git - karo-tx-linux.git/commit
DMA: AT91: Get residual bytes in dma buffer
authorElen Song <elen.song@atmel.com>
Fri, 10 May 2013 03:01:46 +0000 (11:01 +0800)
committerVinod Koul <vinod.koul@intel.com>
Mon, 27 May 2013 03:50:30 +0000 (09:20 +0530)
commit7c407d3e54dcc0c79119553c8d5ef176c1d5bc3a
tree9b9379c8f72b40c76ea47c30861615ecd6e8ea63
parentf0e18e3c0df2b4ff3b508377a8442b1209202238
DMA: AT91: Get residual bytes in dma buffer

Add support for returning the residue for current transfer cookie by
reading the transfered buffer size(BTSIZE) in CTRLA register.

For a single buffer cookie, the descriptor length minus BTSIZE
can get the residue.

For a lli cookie, remain_desc will record remain descriptor length
when last descriptor finish, the remain_desc minus BTSIZE can get the
current residue.

If the cookie has completed successfully, the residue will be zero.
If the cookie is in progress, it will be the number of bytes yet to be transferred.
If get residue error, the cookie will be turn into error status.

Check dma fifo to see if data remain, let issue pending finish remain work if there is.
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