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