summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/include/mach/dma.h
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2012-03-02 12:54:19 +0530
committerVarun Colbert <vcolbert@nvidia.com>2012-03-09 21:28:59 -0800
commit7988d9109fb6c274faf9e14dd9e8366c68214640 (patch)
tree9150a49b2e063b3dbd401938a74c42e731018e5e /arch/arm/mach-tegra/include/mach/dma.h
parentb0a97558c4ff738fefcc52c98faa8c417b1747d7 (diff)
ARM: tegra: dma: Return ERROR_STOPPED if dma stopped.
The dma will be stop in continuous mode with following reason: - There is no next request and dma restarted the same buffer as it was last transfer. - The buffer size was not enough and so latency to serve dma interrupt is more than buffer transfer time and hence buffer completed before interrupt served. In the above cases, dma actually transfer more than requested size. Returning correct transferred data in byte transferred and return request status as ERROR. Change-Id: I7046e0935b7261475a0f6ed49e40a6f1b86d72ec Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/86002 Reviewed-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/include/mach/dma.h')
-rw-r--r--arch/arm/mach-tegra/include/mach/dma.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/arch/arm/mach-tegra/include/mach/dma.h b/arch/arm/mach-tegra/include/mach/dma.h
index 055bd6a97499..0b0a5d9fd1d8 100644
--- a/arch/arm/mach-tegra/include/mach/dma.h
+++ b/arch/arm/mach-tegra/include/mach/dma.h
@@ -72,9 +72,33 @@ enum tegra_dma_mode {
TEGRA_DMA_MODE_ONESHOT = 8,
};
-enum tegra_dma_req_error {
+/*
+ * tegra_dma_req_status: Dma request status
+ * TEGRA_DMA_REQ_SUCCESS: The request has been successfully completed.
+ * The byte_transferred tells number of bytes transferred.
+ * TEGRA_DMA_REQ_ERROR_ABORTED: The request is aborted by client after
+ * calling tegra_dma_dequeue_req.
+ * The byte_transferred tells number of bytes transferred
+ * which may be more than request size due to buffer
+ * wrap-up in continuous mode.
+ * TEGRA_DMA_REQ_ERROR_STOPPED: Applicable in continuous mode.
+ * The request is stopped forcefully. This may be becasue of
+ * - due to non-available of next request.
+ * - not able to serve current interrupt before next buffer
+ * completed by dma. This can happen if buffer req size is
+ * not enough and it transfer completes before system actually
+ * serve the previous dma interrupts.
+ * The byte_transferred will not be accurate in this case. It will
+ * just give an idea that how much approximately have been
+ * transferred by dma.
+ * TEGRA_DMA_REQ_INFLIGHT: The request is configured in the dma register
+ * for transfer.
+ */
+
+enum tegra_dma_req_status {
TEGRA_DMA_REQ_SUCCESS = 0,
TEGRA_DMA_REQ_ERROR_ABORTED,
+ TEGRA_DMA_REQ_ERROR_STOPPED,
TEGRA_DMA_REQ_INFLIGHT,
};