dma: tegra: add accurate reporting of dma state
authorBen Dooks <ben.dooks@codethink.co.uk>
Wed, 31 Oct 2018 16:03:07 +0000 (16:03 +0000)
committerDmitry Osipenko <digetx@gmail.com>
Sat, 9 Feb 2019 19:15:52 +0000 (22:15 +0300)
commit79fa950bd01eba714ce34afebb6d3aa13e9ffbf6
tree30db5e6e0f0430731ee0e1791ed99bc9b1a28ba6
parent92c6329b85cc8490c61d4fc3e85c743a81294472
dma: tegra: add accurate reporting of dma state

The tx_status callback does not report the state of the transfer
beyond complete segments. This causes problems with users such as
ALSA when applications want to know accurately how much data has
been moved.

This patch addes a function tegra_dma_update_residual() to query
the hardware and modify the residual information accordinly. It
takes into account any hardware issues when trying to read the
state, such as delays between finishing a buffer and signalling
the interrupt.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
drivers/dma/tegra20-apb-dma.c