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