1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16#ifndef _COMEDI_ISADMA_H
17#define _COMEDI_ISADMA_H
18
19#include <linux/types.h>
20
21struct comedi_device;
22
23
24
25
26
27#define COMEDI_ISADMA_READ 0
28#define COMEDI_ISADMA_WRITE 1
29
30
31
32
33
34
35
36
37
38
39struct comedi_isadma_desc {
40 void *virt_addr;
41 dma_addr_t hw_addr;
42 unsigned int chan;
43 unsigned int maxsize;
44 unsigned int size;
45 char mode;
46};
47
48
49
50
51
52
53
54
55
56struct comedi_isadma {
57 struct comedi_isadma_desc *desc;
58 int n_desc;
59 int cur_dma;
60 unsigned int chan;
61 unsigned int chan2;
62};
63
64#if IS_ENABLED(CONFIG_ISA_DMA_API)
65
66void comedi_isadma_program(struct comedi_isadma_desc *desc);
67unsigned int comedi_isadma_disable(unsigned int dma_chan);
68unsigned int comedi_isadma_disable_on_sample(unsigned int dma_chan,
69 unsigned int size);
70unsigned int comedi_isadma_poll(struct comedi_isadma *dma);
71void comedi_isadma_set_mode(struct comedi_isadma_desc *desc, char dma_dir);
72
73struct comedi_isadma *comedi_isadma_alloc(struct comedi_device *dev,
74 int n_desc, unsigned int dma_chan1,
75 unsigned int dma_chan2,
76 unsigned int maxsize, char dma_dir);
77void comedi_isadma_free(struct comedi_isadma *dma);
78
79#else
80
81static inline void comedi_isadma_program(struct comedi_isadma_desc *desc)
82{
83}
84
85static inline unsigned int comedi_isadma_disable(unsigned int dma_chan)
86{
87 return 0;
88}
89
90static inline unsigned int
91comedi_isadma_disable_on_sample(unsigned int dma_chan, unsigned int size)
92{
93 return 0;
94}
95
96static inline unsigned int comedi_isadma_poll(struct comedi_isadma *dma)
97{
98 return 0;
99}
100
101static inline void comedi_isadma_set_mode(struct comedi_isadma_desc *desc,
102 char dma_dir)
103{
104}
105
106static inline struct comedi_isadma *
107comedi_isadma_alloc(struct comedi_device *dev, int n_desc,
108 unsigned int dma_chan1, unsigned int dma_chan2,
109 unsigned int maxsize, char dma_dir)
110{
111 return NULL;
112}
113
114static inline void comedi_isadma_free(struct comedi_isadma *dma)
115{
116}
117
118#endif
119
120#endif
121