This source file includes following definitions.
- acpi_dma_controller_register
- acpi_dma_controller_free
- devm_acpi_dma_controller_register
- devm_acpi_dma_controller_free
- acpi_dma_request_slave_chan_by_index
- acpi_dma_request_slave_chan_by_name
1
2
3
4
5
6
7
8
9
10
11 #ifndef __LINUX_ACPI_DMA_H
12 #define __LINUX_ACPI_DMA_H
13
14 #include <linux/list.h>
15 #include <linux/device.h>
16 #include <linux/err.h>
17 #include <linux/dmaengine.h>
18
19
20
21
22
23
24
25
26 struct acpi_dma_spec {
27 int chan_id;
28 int slave_id;
29 struct device *dev;
30 };
31
32
33
34
35
36
37
38
39
40
41 struct acpi_dma {
42 struct list_head dma_controllers;
43 struct device *dev;
44 struct dma_chan *(*acpi_dma_xlate)
45 (struct acpi_dma_spec *, struct acpi_dma *);
46 void *data;
47 unsigned short base_request_line;
48 unsigned short end_request_line;
49 };
50
51
52 struct acpi_dma_filter_info {
53 dma_cap_mask_t dma_cap;
54 dma_filter_fn filter_fn;
55 };
56
57 #ifdef CONFIG_DMA_ACPI
58
59 int acpi_dma_controller_register(struct device *dev,
60 struct dma_chan *(*acpi_dma_xlate)
61 (struct acpi_dma_spec *, struct acpi_dma *),
62 void *data);
63 int acpi_dma_controller_free(struct device *dev);
64 int devm_acpi_dma_controller_register(struct device *dev,
65 struct dma_chan *(*acpi_dma_xlate)
66 (struct acpi_dma_spec *, struct acpi_dma *),
67 void *data);
68 void devm_acpi_dma_controller_free(struct device *dev);
69
70 struct dma_chan *acpi_dma_request_slave_chan_by_index(struct device *dev,
71 size_t index);
72 struct dma_chan *acpi_dma_request_slave_chan_by_name(struct device *dev,
73 const char *name);
74
75 struct dma_chan *acpi_dma_simple_xlate(struct acpi_dma_spec *dma_spec,
76 struct acpi_dma *adma);
77 #else
78
79 static inline int acpi_dma_controller_register(struct device *dev,
80 struct dma_chan *(*acpi_dma_xlate)
81 (struct acpi_dma_spec *, struct acpi_dma *),
82 void *data)
83 {
84 return -ENODEV;
85 }
86 static inline int acpi_dma_controller_free(struct device *dev)
87 {
88 return -ENODEV;
89 }
90 static inline int devm_acpi_dma_controller_register(struct device *dev,
91 struct dma_chan *(*acpi_dma_xlate)
92 (struct acpi_dma_spec *, struct acpi_dma *),
93 void *data)
94 {
95 return -ENODEV;
96 }
97 static inline void devm_acpi_dma_controller_free(struct device *dev)
98 {
99 }
100
101 static inline struct dma_chan *acpi_dma_request_slave_chan_by_index(
102 struct device *dev, size_t index)
103 {
104 return ERR_PTR(-ENODEV);
105 }
106 static inline struct dma_chan *acpi_dma_request_slave_chan_by_name(
107 struct device *dev, const char *name)
108 {
109 return ERR_PTR(-ENODEV);
110 }
111
112 #define acpi_dma_simple_xlate NULL
113
114 #endif
115
116 #define acpi_dma_request_slave_channel acpi_dma_request_slave_chan_by_index
117
118 #endif