diff options
author | Gary King <gking@nvidia.com> | 2009-12-16 15:53:01 -0800 |
---|---|---|
committer | Gary King <gking@nvidia.com> | 2009-12-16 19:27:46 -0800 |
commit | 7f3aed6eb9e2040475df4afacedd5bc1ffca5f3b (patch) | |
tree | 2635b384b014656776a9f7ed0de38cfd2e169dd6 /arch/arm/mach-tegra/include/mach | |
parent | 83c28f57eab1725bf4405d7f2002bbfbc9d65346 (diff) |
tegra: enhance system DMA API with per-request dequeing
remove some of the global status APIs from the public API set, add a per-
request dequeue instead.
move bytes_transferred out of the completion function parameters and into
the request structure.
Diffstat (limited to 'arch/arm/mach-tegra/include/mach')
-rw-r--r-- | arch/arm/mach-tegra/include/mach/dma.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/arch/arm/mach-tegra/include/mach/dma.h b/arch/arm/mach-tegra/include/mach/dma.h index 63414e6d4f90..01fedd06e7f5 100644 --- a/arch/arm/mach-tegra/include/mach/dma.h +++ b/arch/arm/mach-tegra/include/mach/dma.h @@ -30,13 +30,16 @@ enum tegra_dma_mode { TEGRA_DMA_MODE_ONESHOT = 4, }; +enum tegra_dma_req_error { + TEGRA_DMA_REQ_ERROR_ABOTRED, +}; + struct tegra_dma_req { struct list_head list; unsigned int modid; - int instace; + int instance; - void (*complete)(struct tegra_dma_req *req, int bytes_trasferred, - int err); + void (*complete)(struct tegra_dma_req *req, int err); /* 1 to copy to memory. * 0 to copy from the memory to device FIFO */ int to_memory; @@ -48,15 +51,17 @@ struct tegra_dma_req { unsigned int size; + /* Updated by the DMA driver on the conpletion of the request. */ + int bytes_transferred; + int status; + /* Client specific data */ void *data; }; -void tegra_dma_stop(int channel); -void tegra_dma_is_enabled(int channel); -void tegra_dma_start(int channel); - int tegra_dma_enqueue_req(int channel, struct tegra_dma_req *req); +int tegra_dma_dequeue_req(int channel, struct tegra_dma_req *req); +void tegra_dma_dequeue(int channel); /* Returns 1 if there are DMA is empty. */ |