diff options
-rw-r--r-- | arch/arm/mach-tegra/dma.c | 22 | ||||
-rw-r--r-- | arch/arm/mach-tegra/include/mach/dma.h | 1 |
2 files changed, 22 insertions, 1 deletions
diff --git a/arch/arm/mach-tegra/dma.c b/arch/arm/mach-tegra/dma.c index 2f97a7655902..d525aec8f2a8 100644 --- a/arch/arm/mach-tegra/dma.c +++ b/arch/arm/mach-tegra/dma.c @@ -137,6 +137,24 @@ static void tegra_dma_update_hw_partial(struct tegra_dma_channel *ch, struct tegra_dma_req *req); static void tegra_dma_stop(struct tegra_dma_channel *ch); +void tegra_dma_flush(struct tegra_dma_channel *ch) +{ +} +EXPORT_SYMBOL(tegra_dma_flush); + +void tegra_dma_dequeue(struct tegra_dma_channel *ch) +{ + struct tegra_dma_req *req; + + if (tegra_dma_is_empty(ch)) + return; + + req = list_entry(ch->list.next, typeof(*req), node); + + tegra_dma_dequeue_req(ch, req); + return; +} + void tegra_dma_stop(struct tegra_dma_channel *ch) { u32 csr; @@ -232,7 +250,7 @@ int tegra_dma_dequeue_req(struct tegra_dma_channel *ch, } if (!found) { spin_unlock_irqrestore(&ch->lock, irq_flags); - return -EINVAL; + return 0; } if (!stop) @@ -268,6 +286,8 @@ skip_status: spin_unlock_irqrestore(&ch->lock, irq_flags); + /* Callback should be called without any lock */ + req->complete(req); return 0; } EXPORT_SYMBOL(tegra_dma_dequeue_req); diff --git a/arch/arm/mach-tegra/include/mach/dma.h b/arch/arm/mach-tegra/include/mach/dma.h index 60b669ae3948..d385b7a251be 100644 --- a/arch/arm/mach-tegra/include/mach/dma.h +++ b/arch/arm/mach-tegra/include/mach/dma.h @@ -142,6 +142,7 @@ int tegra_dma_enqueue_req(struct tegra_dma_channel *ch, struct tegra_dma_req *req); int tegra_dma_dequeue_req(struct tegra_dma_channel *ch, struct tegra_dma_req *req); +void tegra_dma_dequeue(struct tegra_dma_channel *ch); void tegra_dma_flush(struct tegra_dma_channel *ch); bool tegra_dma_is_req_inflight(struct tegra_dma_channel *ch, |