1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44#include <acpi/acpi.h>
45#include "accommon.h"
46#include "acresrc.h"
47
48#define _COMPONENT ACPI_RESOURCES
49ACPI_MODULE_NAME("rsirq")
50
51
52
53
54
55
56struct acpi_rsconvert_info acpi_rs_get_irq[9] = {
57 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_IRQ,
58 ACPI_RS_SIZE(struct acpi_resource_irq),
59 ACPI_RSC_TABLE_SIZE(acpi_rs_get_irq)},
60
61
62
63 {ACPI_RSC_BITMASK16, ACPI_RS_OFFSET(data.irq.interrupts[0]),
64 AML_OFFSET(irq.irq_mask),
65 ACPI_RS_OFFSET(data.irq.interrupt_count)},
66
67
68
69 {ACPI_RSC_SET8, ACPI_RS_OFFSET(data.irq.triggering),
70 ACPI_EDGE_SENSITIVE,
71 1},
72
73
74
75 {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.irq.descriptor_length),
76 AML_OFFSET(irq.descriptor_type),
77 0},
78
79
80
81 {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_AML_LENGTH, 0, 3},
82
83
84
85 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.triggering),
86 AML_OFFSET(irq.flags),
87 0},
88
89 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.polarity),
90 AML_OFFSET(irq.flags),
91 3},
92
93 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.sharable),
94 AML_OFFSET(irq.flags),
95 4},
96
97 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.wake_capable),
98 AML_OFFSET(irq.flags),
99 5}
100};
101
102
103
104
105
106
107
108struct acpi_rsconvert_info acpi_rs_set_irq[14] = {
109
110
111 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_IRQ,
112 sizeof(struct aml_resource_irq),
113 ACPI_RSC_TABLE_SIZE(acpi_rs_set_irq)},
114
115
116
117 {ACPI_RSC_BITMASK16, ACPI_RS_OFFSET(data.irq.interrupts[0]),
118 AML_OFFSET(irq.irq_mask),
119 ACPI_RS_OFFSET(data.irq.interrupt_count)},
120
121
122
123 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.triggering),
124 AML_OFFSET(irq.flags),
125 0},
126
127 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.polarity),
128 AML_OFFSET(irq.flags),
129 3},
130
131 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.sharable),
132 AML_OFFSET(irq.flags),
133 4},
134
135 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.wake_capable),
136 AML_OFFSET(irq.flags),
137 5},
138
139
140
141
142
143 {ACPI_RSC_EXIT_EQ, ACPI_RSC_COMPARE_VALUE,
144 ACPI_RS_OFFSET(data.irq.descriptor_length),
145 3},
146
147
148
149 {ACPI_RSC_LENGTH, 0, 0, sizeof(struct aml_resource_irq_noflags)},
150
151
152
153
154
155
156
157 {ACPI_RSC_EXIT_EQ, ACPI_RSC_COMPARE_VALUE,
158 ACPI_RS_OFFSET(data.irq.descriptor_length),
159 2},
160
161
162
163 {ACPI_RSC_LENGTH, 0, 0, sizeof(struct aml_resource_irq)},
164
165
166
167
168
169 {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_VALUE,
170 ACPI_RS_OFFSET(data.irq.triggering),
171 ACPI_EDGE_SENSITIVE},
172
173 {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_VALUE,
174 ACPI_RS_OFFSET(data.irq.polarity),
175 ACPI_ACTIVE_HIGH},
176
177 {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_VALUE,
178 ACPI_RS_OFFSET(data.irq.sharable),
179 ACPI_EXCLUSIVE},
180
181
182
183 {ACPI_RSC_LENGTH, 0, 0, sizeof(struct aml_resource_irq_noflags)}
184};
185
186
187
188
189
190
191
192struct acpi_rsconvert_info acpi_rs_convert_ext_irq[10] = {
193 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_EXTENDED_IRQ,
194 ACPI_RS_SIZE(struct acpi_resource_extended_irq),
195 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_ext_irq)},
196
197 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_EXTENDED_IRQ,
198 sizeof(struct aml_resource_extended_irq),
199 0},
200
201
202
203
204
205 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.producer_consumer),
206 AML_OFFSET(extended_irq.flags),
207 0},
208
209 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.triggering),
210 AML_OFFSET(extended_irq.flags),
211 1},
212
213 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.polarity),
214 AML_OFFSET(extended_irq.flags),
215 2},
216
217 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.sharable),
218 AML_OFFSET(extended_irq.flags),
219 3},
220
221 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.wake_capable),
222 AML_OFFSET(extended_irq.flags),
223 4},
224
225
226
227 {ACPI_RSC_COUNT, ACPI_RS_OFFSET(data.extended_irq.interrupt_count),
228 AML_OFFSET(extended_irq.interrupt_count),
229 sizeof(u32)},
230
231
232
233 {ACPI_RSC_MOVE32, ACPI_RS_OFFSET(data.extended_irq.interrupts[0]),
234 AML_OFFSET(extended_irq.interrupts[0]),
235 0},
236
237
238
239 {ACPI_RSC_SOURCEX, ACPI_RS_OFFSET(data.extended_irq.resource_source),
240 ACPI_RS_OFFSET(data.extended_irq.interrupts[0]),
241 sizeof(struct aml_resource_extended_irq)}
242};
243
244
245
246
247
248
249
250struct acpi_rsconvert_info acpi_rs_convert_dma[6] = {
251 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_DMA,
252 ACPI_RS_SIZE(struct acpi_resource_dma),
253 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_dma)},
254
255 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_DMA,
256 sizeof(struct aml_resource_dma),
257 0},
258
259
260
261 {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.dma.transfer),
262 AML_OFFSET(dma.flags),
263 0},
264
265 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.dma.bus_master),
266 AML_OFFSET(dma.flags),
267 2},
268
269 {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.dma.type),
270 AML_OFFSET(dma.flags),
271 5},
272
273
274
275 {ACPI_RSC_BITMASK, ACPI_RS_OFFSET(data.dma.channels[0]),
276 AML_OFFSET(dma.dma_channel_mask),
277 ACPI_RS_OFFSET(data.dma.channel_count)}
278};
279
280
281
282
283
284
285
286struct acpi_rsconvert_info acpi_rs_convert_fixed_dma[4] = {
287 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_FIXED_DMA,
288 ACPI_RS_SIZE(struct acpi_resource_fixed_dma),
289 ACPI_RSC_TABLE_SIZE(acpi_rs_convert_fixed_dma)},
290
291 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_FIXED_DMA,
292 sizeof(struct aml_resource_fixed_dma),
293 0},
294
295
296
297
298
299
300 {ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.fixed_dma.request_lines),
301 AML_OFFSET(fixed_dma.request_lines),
302 2},
303
304 {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.fixed_dma.width),
305 AML_OFFSET(fixed_dma.width),
306 1},
307};
308