summaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorGerrit Code Review <gerrit2@git-master.nvidia.com>2010-01-22 20:30:05 +0200
committerGerrit Code Review <gerrit2@git-master.nvidia.com>2010-01-22 20:30:05 +0200
commit14da3c0dbb2ed251c2679900ba5d29f096c03c60 (patch)
tree0b56fc8b49bceebfb5ec2f7edae70d79a729a22d /arch/arm
parente39a2445044b48ff179b272d681d1278267f1e3d (diff)
parent5b340d629f24131fd5cffee7efa277ba5e1bd400 (diff)
Merge change I1502ad81 into android-tegra-2.6.29
* changes: tegra: Update the UART Tx data path and added new system DMA API.
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-tegra/dma.c27
-rw-r--r--arch/arm/mach-tegra/include/mach/dma.h7
2 files changed, 25 insertions, 9 deletions
diff --git a/arch/arm/mach-tegra/dma.c b/arch/arm/mach-tegra/dma.c
index 4f337d06c5a7..bbd3691240ea 100644
--- a/arch/arm/mach-tegra/dma.c
+++ b/arch/arm/mach-tegra/dma.c
@@ -212,23 +212,40 @@ int tegra_dma_dequeue_req(int channel, struct tegra_dma_req *_req)
}
EXPORT_SYMBOL(tegra_dma_dequeue_req);
-int tegra_dma_is_empty(int channel)
+bool tegra_dma_is_empty(int channel)
{
unsigned long irq_flags;
struct tegra_dma_channel *ch = &dma_channels[channel];
- int is_empty;
+ bool is_empty;
spin_lock_irqsave(&ch->lock, irq_flags);
if (list_empty(&ch->list))
- is_empty = 1;
+ is_empty = true;
else
- is_empty = 0;
+ is_empty = false;
spin_unlock_irqrestore(&ch->lock, irq_flags);
-
return is_empty;
}
EXPORT_SYMBOL(tegra_dma_is_empty);
+bool tegra_dma_is_req_inflight(int channel, struct tegra_dma_req *_req)
+{
+ unsigned long irq_flags;
+ struct tegra_dma_channel *ch = &dma_channels[channel];
+ struct tegra_dma_req *req;
+
+ spin_lock_irqsave(&ch->lock, irq_flags);
+ list_for_each_entry (req, &ch->list, list) {
+ if (req == _req) {
+ spin_unlock_irqrestore(&ch->lock, irq_flags);
+ return true;
+ }
+ }
+ spin_unlock_irqrestore(&ch->lock, irq_flags);
+ return false;
+}
+EXPORT_SYMBOL(tegra_dma_is_req_inflight);
+
int tegra_dma_enqueue_req(int channel, struct tegra_dma_req *req)
{
unsigned long irq_flags;
diff --git a/arch/arm/mach-tegra/include/mach/dma.h b/arch/arm/mach-tegra/include/mach/dma.h
index c39be865bafc..508e2fcf8409 100644
--- a/arch/arm/mach-tegra/include/mach/dma.h
+++ b/arch/arm/mach-tegra/include/mach/dma.h
@@ -101,12 +101,11 @@ struct tegra_dma_req {
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.
- */
-int tegra_dma_is_empty(int channel);
void tegra_dma_flush(int channel);
+bool tegra_dma_is_req_inflight(int channel, struct tegra_dma_req *req);
+bool tegra_dma_is_empty(int channel);
+
int tegra_dma_allocate_channel(int mode);
void tegra_dma_free_channel(int channel);