Skip to content
Commit d48de6f1 authored by Elen Song's avatar Elen Song Committed by Vinod Koul
Browse files

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: default avatarElen Song <elen.song@atmel.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent d088c33b
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment