summaryrefslogtreecommitdiffstats
path: root/include/asm-arm/dma.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-arm/dma.h')
-rw-r--r--include/asm-arm/dma.h37
1 files changed, 36 insertions, 1 deletions
diff --git a/include/asm-arm/dma.h b/include/asm-arm/dma.h
index d8b9f1d3a..9fb7a0242 100644
--- a/include/asm-arm/dma.h
+++ b/include/asm-arm/dma.h
@@ -3,9 +3,24 @@
typedef unsigned int dmach_t;
+#include <linux/config.h>
+#include <linux/kernel.h>
#include <asm/irq.h>
+#include <asm/system.h>
+#include <asm/spinlock.h>
#include <asm/arch/dma.h>
+/*
+ * DMA modes - we have two, IN and OUT
+ */
+typedef unsigned int dmamode_t;
+
+#define DMA_MODE_MASK 1
+
+#define DMA_MODE_READ 0
+#define DMA_MODE_WRITE 1
+#define DMA_AUTOINIT 2
+
typedef struct {
unsigned long address;
unsigned long length;
@@ -13,6 +28,20 @@ typedef struct {
extern const char dma_str[];
+extern spinlock_t dma_spin_lock;
+
+extern __inline__ unsigned long claim_dma_lock(void)
+{
+ unsigned long flags;
+ spin_lock_irqsave(&dma_spin_lock, flags);
+ return flags;
+}
+
+extern __inline__ void release_dma_lock(unsigned long flags)
+{
+ spin_unlock_irqrestore(&dma_spin_lock, flags);
+}
+
/* Clear the 'DMA Pointer Flip Flop'.
* Write 0 for LSB/MSB, 1 for MSB/LSB access.
*
@@ -26,7 +55,7 @@ extern const char dma_str[];
* NOTE: This is an architecture specific function, and should
* be hidden from the drivers
*/
-static __inline__ void set_dma_page(dmach_t channel, char pagenr)
+extern __inline__ void set_dma_page(dmach_t channel, char pagenr)
{
printk(dma_str, "set_dma_page", channel);
}
@@ -102,4 +131,10 @@ extern int get_dma_residue(dmach_t channel);
#define NO_DMA 255
#endif
+#ifdef CONFIG_PCI_QUIRKS
+extern int isa_dma_bridge_buggy;
+#else
+#define isa_dma_bridge_buggy (0)
+#endif
+
#endif /* _ARM_DMA_H */