DMA: Calculate how many data transferred by DMA

Youquan Song
2013-10-11T10:02:10Z

Currently, the DMA channel calculates its data transferred only at network
device driver. When other devices like UART or SPI etc, transfers data by DMA
mode, but it always shows 0 at /sys/class/dma/dma0chan*/bytes_transferred.
It will possibly mislead user that the DMA engine does not work.

This patch add a new function which will calculate how many the data has been
transferred after doing it by DMA mode. It can be used by other modules and
also simplify current duplicated code.

Add the interface when UART transfer data by Designware DMA engine. It will
calculate the data already tranferred in the DMA channel.

If the patch work, I will add the interface to other modules when needed.