staging: comedi: ni_labpc_isadma: add labpc_have_dma_chan()
[platform/adaptation/renesas_rcar/renesas_kernel.git] / drivers / staging / comedi / drivers / ni_labpc_isadma.h
1 /*
2  * ni_labpc ISA DMA support.
3 */
4
5 #ifndef _NI_LABPC_ISADMA_H
6 #define _NI_LABPC_ISADMA_H
7
8 #define NI_LABPC_HAVE_ISA_DMA   IS_ENABLED(CONFIG_COMEDI_NI_LABPC_ISADMA)
9
10 #if NI_LABPC_HAVE_ISA_DMA
11
12 static inline bool labpc_have_dma_chan(struct comedi_device *dev)
13 {
14         struct labpc_private *devpriv = dev->private;
15
16         return (bool)devpriv->dma_chan;
17 }
18
19 int labpc_init_dma_chan(struct comedi_device *dev, unsigned int dma_chan);
20 void labpc_free_dma_chan(struct comedi_device *dev);
21
22 #else
23
24 static inline bool labpc_have_dma_chan(struct comedi_device *dev)
25 {
26         return false;
27 }
28
29 static inline int labpc_init_dma_chan(struct comedi_device *dev,
30                                       unsigned int dma_chan)
31 {
32         return -ENOTSUPP;
33 }
34
35 static inline void labpc_free_dma_chan(struct comedi_device *dev)
36 {
37 }
38
39 #endif
40
41 #endif /* _NI_LABPC_ISADMA_H */