This source file includes following definitions.
- claim_dma_lock
- release_dma_lock
1
2 #ifndef __ASM_ARM_DMA_H
3 #define __ASM_ARM_DMA_H
4
5
6
7
8 #ifndef CONFIG_ZONE_DMA
9 #define MAX_DMA_ADDRESS 0xffffffffUL
10 #else
11 #define MAX_DMA_ADDRESS ({ \
12 extern phys_addr_t arm_dma_zone_size; \
13 arm_dma_zone_size && arm_dma_zone_size < (0x10000000 - PAGE_OFFSET) ? \
14 (PAGE_OFFSET + arm_dma_zone_size) : 0xffffffffUL; })
15 #endif
16
17 #ifdef CONFIG_ISA_DMA_API
18
19
20
21
22 #include <linux/spinlock.h>
23 #include <linux/scatterlist.h>
24
25 #include <mach/isa-dma.h>
26
27
28
29
30 #define DMA_MODE_MASK 0xcc
31
32 #define DMA_MODE_READ 0x44
33 #define DMA_MODE_WRITE 0x48
34 #define DMA_MODE_CASCADE 0xc0
35 #define DMA_AUTOINIT 0x10
36
37 extern raw_spinlock_t dma_spin_lock;
38
39 static inline unsigned long claim_dma_lock(void)
40 {
41 unsigned long flags;
42 raw_spin_lock_irqsave(&dma_spin_lock, flags);
43 return flags;
44 }
45
46 static inline void release_dma_lock(unsigned long flags)
47 {
48 raw_spin_unlock_irqrestore(&dma_spin_lock, flags);
49 }
50
51
52
53
54 #define clear_dma_ff(chan)
55
56
57
58
59
60
61 extern void set_dma_page(unsigned int chan, char pagenr);
62
63
64
65
66
67 extern int request_dma(unsigned int chan, const char * device_id);
68
69
70
71
72
73 extern void free_dma(unsigned int chan);
74
75
76
77
78
79
80 extern void enable_dma(unsigned int chan);
81
82
83
84
85
86
87 extern void disable_dma(unsigned int chan);
88
89
90
91 extern int dma_channel_active(unsigned int chan);
92
93
94
95
96
97
98
99 extern void set_dma_sg(unsigned int chan, struct scatterlist *sg, int nr_sg);
100
101
102
103
104
105
106
107 extern void __set_dma_addr(unsigned int chan, void *addr);
108 #define set_dma_addr(chan, addr) \
109 __set_dma_addr(chan, (void *)__bus_to_virt(addr))
110
111
112
113
114
115
116
117 extern void set_dma_count(unsigned int chan, unsigned long count);
118
119
120
121
122
123
124
125
126 extern void set_dma_mode(unsigned int chan, unsigned int mode);
127
128
129
130 extern void set_dma_speed(unsigned int chan, int cycle_ns);
131
132
133
134
135
136
137
138 extern int get_dma_residue(unsigned int chan);
139
140 #ifndef NO_DMA
141 #define NO_DMA 255
142 #endif
143
144 #endif
145
146 #ifdef CONFIG_PCI
147 extern int isa_dma_bridge_buggy;
148 #else
149 #define isa_dma_bridge_buggy (0)
150 #endif
151
152 #endif