aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pnp')
-rw-r--r--drivers/pnp/pnpacpi/rsparser.c408
1 files changed, 204 insertions, 204 deletions
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c
index 2424bd3620dc..c6db14d30ed6 100644
--- a/drivers/pnp/pnpacpi/rsparser.c
+++ b/drivers/pnp/pnpacpi/rsparser.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (c) 2004 Matthieu Castet <castet.matthieu@free.fr> 4 * Copyright (c) 2004 Matthieu Castet <castet.matthieu@free.fr>
5 * Copyright (c) 2004 Li Shaohua <shaohua.li@intel.com> 5 * Copyright (c) 2004 Li Shaohua <shaohua.li@intel.com>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the 8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2, or (at your option) any 9 * Free Software Foundation; either version 2, or (at your option) any
@@ -32,17 +32,17 @@
32/* 32/*
33 * Allocated Resources 33 * Allocated Resources
34 */ 34 */
35static int irq_flags(int edge_level, int active_high_low) 35static int irq_flags(int triggering, int polarity)
36{ 36{
37 int flag; 37 int flag;
38 if (edge_level == ACPI_LEVEL_SENSITIVE) { 38 if (triggering == ACPI_LEVEL_SENSITIVE) {
39 if(active_high_low == ACPI_ACTIVE_LOW) 39 if(polarity == ACPI_ACTIVE_LOW)
40 flag = IORESOURCE_IRQ_LOWLEVEL; 40 flag = IORESOURCE_IRQ_LOWLEVEL;
41 else 41 else
42 flag = IORESOURCE_IRQ_HIGHLEVEL; 42 flag = IORESOURCE_IRQ_HIGHLEVEL;
43 } 43 }
44 else { 44 else {
45 if(active_high_low == ACPI_ACTIVE_LOW) 45 if(polarity == ACPI_ACTIVE_LOW)
46 flag = IORESOURCE_IRQ_LOWEDGE; 46 flag = IORESOURCE_IRQ_LOWEDGE;
47 else 47 else
48 flag = IORESOURCE_IRQ_HIGHEDGE; 48 flag = IORESOURCE_IRQ_HIGHEDGE;
@@ -50,31 +50,31 @@ static int irq_flags(int edge_level, int active_high_low)
50 return flag; 50 return flag;
51} 51}
52 52
53static void decode_irq_flags(int flag, int *edge_level, int *active_high_low) 53static void decode_irq_flags(int flag, int *triggering, int *polarity)
54{ 54{
55 switch (flag) { 55 switch (flag) {
56 case IORESOURCE_IRQ_LOWLEVEL: 56 case IORESOURCE_IRQ_LOWLEVEL:
57 *edge_level = ACPI_LEVEL_SENSITIVE; 57 *triggering = ACPI_LEVEL_SENSITIVE;
58 *active_high_low = ACPI_ACTIVE_LOW; 58 *polarity = ACPI_ACTIVE_LOW;
59 break; 59 break;
60 case IORESOURCE_IRQ_HIGHLEVEL: 60 case IORESOURCE_IRQ_HIGHLEVEL:
61 *edge_level = ACPI_LEVEL_SENSITIVE; 61 *triggering = ACPI_LEVEL_SENSITIVE;
62 *active_high_low = ACPI_ACTIVE_HIGH; 62 *polarity = ACPI_ACTIVE_HIGH;
63 break; 63 break;
64 case IORESOURCE_IRQ_LOWEDGE: 64 case IORESOURCE_IRQ_LOWEDGE:
65 *edge_level = ACPI_EDGE_SENSITIVE; 65 *triggering = ACPI_EDGE_SENSITIVE;
66 *active_high_low = ACPI_ACTIVE_LOW; 66 *polarity = ACPI_ACTIVE_LOW;
67 break; 67 break;
68 case IORESOURCE_IRQ_HIGHEDGE: 68 case IORESOURCE_IRQ_HIGHEDGE:
69 *edge_level = ACPI_EDGE_SENSITIVE; 69 *triggering = ACPI_EDGE_SENSITIVE;
70 *active_high_low = ACPI_ACTIVE_HIGH; 70 *polarity = ACPI_ACTIVE_HIGH;
71 break; 71 break;
72 } 72 }
73} 73}
74 74
75static void 75static void
76pnpacpi_parse_allocated_irqresource(struct pnp_resource_table * res, u32 gsi, 76pnpacpi_parse_allocated_irqresource(struct pnp_resource_table * res, u32 gsi,
77 int edge_level, int active_high_low) 77 int triggering, int polarity)
78{ 78{
79 int i = 0; 79 int i = 0;
80 int irq; 80 int irq;
@@ -89,7 +89,7 @@ pnpacpi_parse_allocated_irqresource(struct pnp_resource_table * res, u32 gsi,
89 return; 89 return;
90 90
91 res->irq_resource[i].flags = IORESOURCE_IRQ; // Also clears _UNSET flag 91 res->irq_resource[i].flags = IORESOURCE_IRQ; // Also clears _UNSET flag
92 irq = acpi_register_gsi(gsi, edge_level, active_high_low); 92 irq = acpi_register_gsi(gsi, triggering, polarity);
93 if (irq < 0) { 93 if (irq < 0) {
94 res->irq_resource[i].flags |= IORESOURCE_DISABLED; 94 res->irq_resource[i].flags |= IORESOURCE_DISABLED;
95 return; 95 return;
@@ -163,77 +163,77 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
163 struct pnp_resource_table * res_table = (struct pnp_resource_table *)data; 163 struct pnp_resource_table * res_table = (struct pnp_resource_table *)data;
164 int i; 164 int i;
165 165
166 switch (res->id) { 166 switch (res->type) {
167 case ACPI_RSTYPE_IRQ: 167 case ACPI_RESOURCE_TYPE_IRQ:
168 /* 168 /*
169 * Per spec, only one interrupt per descriptor is allowed in 169 * Per spec, only one interrupt per descriptor is allowed in
170 * _CRS, but some firmware violates this, so parse them all. 170 * _CRS, but some firmware violates this, so parse them all.
171 */ 171 */
172 for (i = 0; i < res->data.irq.number_of_interrupts; i++) { 172 for (i = 0; i < res->data.irq.interrupt_count; i++) {
173 pnpacpi_parse_allocated_irqresource(res_table, 173 pnpacpi_parse_allocated_irqresource(res_table,
174 res->data.irq.interrupts[i], 174 res->data.irq.interrupts[i],
175 res->data.irq.edge_level, 175 res->data.irq.triggering,
176 res->data.irq.active_high_low); 176 res->data.irq.polarity);
177 } 177 }
178 break; 178 break;
179 179
180 case ACPI_RSTYPE_EXT_IRQ: 180 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
181 for (i = 0; i < res->data.extended_irq.number_of_interrupts; i++) { 181 for (i = 0; i < res->data.extended_irq.interrupt_count; i++) {
182 pnpacpi_parse_allocated_irqresource(res_table, 182 pnpacpi_parse_allocated_irqresource(res_table,
183 res->data.extended_irq.interrupts[i], 183 res->data.extended_irq.interrupts[i],
184 res->data.extended_irq.edge_level, 184 res->data.extended_irq.triggering,
185 res->data.extended_irq.active_high_low); 185 res->data.extended_irq.polarity);
186 } 186 }
187 break; 187 break;
188 case ACPI_RSTYPE_DMA: 188 case ACPI_RESOURCE_TYPE_DMA:
189 if (res->data.dma.number_of_channels > 0) 189 if (res->data.dma.channel_count > 0)
190 pnpacpi_parse_allocated_dmaresource(res_table, 190 pnpacpi_parse_allocated_dmaresource(res_table,
191 res->data.dma.channels[0]); 191 res->data.dma.channels[0]);
192 break; 192 break;
193 case ACPI_RSTYPE_IO: 193 case ACPI_RESOURCE_TYPE_IO:
194 pnpacpi_parse_allocated_ioresource(res_table, 194 pnpacpi_parse_allocated_ioresource(res_table,
195 res->data.io.min_base_address, 195 res->data.io.minimum,
196 res->data.io.range_length); 196 res->data.io.address_length);
197 break; 197 break;
198 case ACPI_RSTYPE_FIXED_IO: 198 case ACPI_RESOURCE_TYPE_FIXED_IO:
199 pnpacpi_parse_allocated_ioresource(res_table, 199 pnpacpi_parse_allocated_ioresource(res_table,
200 res->data.fixed_io.base_address, 200 res->data.fixed_io.address,
201 res->data.fixed_io.range_length); 201 res->data.fixed_io.address_length);
202 break; 202 break;
203 case ACPI_RSTYPE_MEM24: 203 case ACPI_RESOURCE_TYPE_MEMORY24:
204 pnpacpi_parse_allocated_memresource(res_table, 204 pnpacpi_parse_allocated_memresource(res_table,
205 res->data.memory24.min_base_address, 205 res->data.memory24.minimum,
206 res->data.memory24.range_length); 206 res->data.memory24.address_length);
207 break; 207 break;
208 case ACPI_RSTYPE_MEM32: 208 case ACPI_RESOURCE_TYPE_MEMORY32:
209 pnpacpi_parse_allocated_memresource(res_table, 209 pnpacpi_parse_allocated_memresource(res_table,
210 res->data.memory32.min_base_address, 210 res->data.memory32.minimum,
211 res->data.memory32.range_length); 211 res->data.memory32.address_length);
212 break; 212 break;
213 case ACPI_RSTYPE_FIXED_MEM32: 213 case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
214 pnpacpi_parse_allocated_memresource(res_table, 214 pnpacpi_parse_allocated_memresource(res_table,
215 res->data.fixed_memory32.range_base_address, 215 res->data.fixed_memory32.address,
216 res->data.fixed_memory32.range_length); 216 res->data.fixed_memory32.address_length);
217 break; 217 break;
218 case ACPI_RSTYPE_ADDRESS16: 218 case ACPI_RESOURCE_TYPE_ADDRESS16:
219 pnpacpi_parse_allocated_memresource(res_table, 219 pnpacpi_parse_allocated_memresource(res_table,
220 res->data.address16.min_address_range, 220 res->data.address16.minimum,
221 res->data.address16.address_length); 221 res->data.address16.address_length);
222 break; 222 break;
223 case ACPI_RSTYPE_ADDRESS32: 223 case ACPI_RESOURCE_TYPE_ADDRESS32:
224 pnpacpi_parse_allocated_memresource(res_table, 224 pnpacpi_parse_allocated_memresource(res_table,
225 res->data.address32.min_address_range, 225 res->data.address32.minimum,
226 res->data.address32.address_length); 226 res->data.address32.address_length);
227 break; 227 break;
228 case ACPI_RSTYPE_ADDRESS64: 228 case ACPI_RESOURCE_TYPE_ADDRESS64:
229 pnpacpi_parse_allocated_memresource(res_table, 229 pnpacpi_parse_allocated_memresource(res_table,
230 res->data.address64.min_address_range, 230 res->data.address64.minimum,
231 res->data.address64.address_length); 231 res->data.address64.address_length);
232 break; 232 break;
233 case ACPI_RSTYPE_VENDOR: 233 case ACPI_RESOURCE_TYPE_VENDOR:
234 break; 234 break;
235 default: 235 default:
236 pnp_warn("PnPACPI: unknown resource type %d", res->id); 236 pnp_warn("PnPACPI: unknown resource type %d", res->type);
237 return AE_ERROR; 237 return AE_ERROR;
238 } 238 }
239 239
@@ -253,13 +253,13 @@ static void pnpacpi_parse_dma_option(struct pnp_option *option, struct acpi_reso
253 int i; 253 int i;
254 struct pnp_dma * dma; 254 struct pnp_dma * dma;
255 255
256 if (p->number_of_channels == 0) 256 if (p->channel_count == 0)
257 return; 257 return;
258 dma = kcalloc(1, sizeof(struct pnp_dma), GFP_KERNEL); 258 dma = kcalloc(1, sizeof(struct pnp_dma), GFP_KERNEL);
259 if (!dma) 259 if (!dma)
260 return; 260 return;
261 261
262 for(i = 0; i < p->number_of_channels; i++) 262 for(i = 0; i < p->channel_count; i++)
263 dma->map |= 1 << p->channels[i]; 263 dma->map |= 1 << p->channels[i];
264 dma->flags = 0; 264 dma->flags = 0;
265 if (p->bus_master) 265 if (p->bus_master)
@@ -309,37 +309,37 @@ static void pnpacpi_parse_irq_option(struct pnp_option *option,
309 int i; 309 int i;
310 struct pnp_irq * irq; 310 struct pnp_irq * irq;
311 311
312 if (p->number_of_interrupts == 0) 312 if (p->interrupt_count == 0)
313 return; 313 return;
314 irq = kcalloc(1, sizeof(struct pnp_irq), GFP_KERNEL); 314 irq = kcalloc(1, sizeof(struct pnp_irq), GFP_KERNEL);
315 if (!irq) 315 if (!irq)
316 return; 316 return;
317 317
318 for(i = 0; i < p->number_of_interrupts; i++) 318 for(i = 0; i < p->interrupt_count; i++)
319 if (p->interrupts[i]) 319 if (p->interrupts[i])
320 __set_bit(p->interrupts[i], irq->map); 320 __set_bit(p->interrupts[i], irq->map);
321 irq->flags = irq_flags(p->edge_level, p->active_high_low); 321 irq->flags = irq_flags(p->triggering, p->polarity);
322 322
323 pnp_register_irq_resource(option, irq); 323 pnp_register_irq_resource(option, irq);
324 return; 324 return;
325} 325}
326 326
327static void pnpacpi_parse_ext_irq_option(struct pnp_option *option, 327static void pnpacpi_parse_ext_irq_option(struct pnp_option *option,
328 struct acpi_resource_ext_irq *p) 328 struct acpi_resource_extended_irq *p)
329{ 329{
330 int i; 330 int i;
331 struct pnp_irq * irq; 331 struct pnp_irq * irq;
332 332
333 if (p->number_of_interrupts == 0) 333 if (p->interrupt_count == 0)
334 return; 334 return;
335 irq = kcalloc(1, sizeof(struct pnp_irq), GFP_KERNEL); 335 irq = kcalloc(1, sizeof(struct pnp_irq), GFP_KERNEL);
336 if (!irq) 336 if (!irq)
337 return; 337 return;
338 338
339 for(i = 0; i < p->number_of_interrupts; i++) 339 for(i = 0; i < p->interrupt_count; i++)
340 if (p->interrupts[i]) 340 if (p->interrupts[i])
341 __set_bit(p->interrupts[i], irq->map); 341 __set_bit(p->interrupts[i], irq->map);
342 irq->flags = irq_flags(p->edge_level, p->active_high_low); 342 irq->flags = irq_flags(p->triggering, p->polarity);
343 343
344 pnp_register_irq_resource(option, irq); 344 pnp_register_irq_resource(option, irq);
345 return; 345 return;
@@ -351,16 +351,16 @@ pnpacpi_parse_port_option(struct pnp_option *option,
351{ 351{
352 struct pnp_port * port; 352 struct pnp_port * port;
353 353
354 if (io->range_length == 0) 354 if (io->address_length == 0)
355 return; 355 return;
356 port = kcalloc(1, sizeof(struct pnp_port), GFP_KERNEL); 356 port = kcalloc(1, sizeof(struct pnp_port), GFP_KERNEL);
357 if (!port) 357 if (!port)
358 return; 358 return;
359 port->min = io->min_base_address; 359 port->min = io->minimum;
360 port->max = io->max_base_address; 360 port->max = io->maximum;
361 port->align = io->alignment; 361 port->align = io->alignment;
362 port->size = io->range_length; 362 port->size = io->address_length;
363 port->flags = ACPI_DECODE_16 == io->io_decode ? 363 port->flags = ACPI_DECODE_16 == io->io_decode ?
364 PNP_PORT_FLAG_16BITADDR : 0; 364 PNP_PORT_FLAG_16BITADDR : 0;
365 pnp_register_port_resource(option,port); 365 pnp_register_port_resource(option,port);
366 return; 366 return;
@@ -372,13 +372,13 @@ pnpacpi_parse_fixed_port_option(struct pnp_option *option,
372{ 372{
373 struct pnp_port * port; 373 struct pnp_port * port;
374 374
375 if (io->range_length == 0) 375 if (io->address_length == 0)
376 return; 376 return;
377 port = kcalloc(1, sizeof(struct pnp_port), GFP_KERNEL); 377 port = kcalloc(1, sizeof(struct pnp_port), GFP_KERNEL);
378 if (!port) 378 if (!port)
379 return; 379 return;
380 port->min = port->max = io->base_address; 380 port->min = port->max = io->address;
381 port->size = io->range_length; 381 port->size = io->address_length;
382 port->align = 0; 382 port->align = 0;
383 port->flags = PNP_PORT_FLAG_FIXED; 383 port->flags = PNP_PORT_FLAG_FIXED;
384 pnp_register_port_resource(option,port); 384 pnp_register_port_resource(option,port);
@@ -387,21 +387,21 @@ pnpacpi_parse_fixed_port_option(struct pnp_option *option,
387 387
388static void 388static void
389pnpacpi_parse_mem24_option(struct pnp_option *option, 389pnpacpi_parse_mem24_option(struct pnp_option *option,
390 struct acpi_resource_mem24 *p) 390 struct acpi_resource_memory24 *p)
391{ 391{
392 struct pnp_mem * mem; 392 struct pnp_mem * mem;
393 393
394 if (p->range_length == 0) 394 if (p->address_length == 0)
395 return; 395 return;
396 mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL); 396 mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL);
397 if (!mem) 397 if (!mem)
398 return; 398 return;
399 mem->min = p->min_base_address; 399 mem->min = p->minimum;
400 mem->max = p->max_base_address; 400 mem->max = p->maximum;
401 mem->align = p->alignment; 401 mem->align = p->alignment;
402 mem->size = p->range_length; 402 mem->size = p->address_length;
403 403
404 mem->flags = (ACPI_READ_WRITE_MEMORY == p->read_write_attribute) ? 404 mem->flags = (ACPI_READ_WRITE_MEMORY == p->write_protect) ?
405 IORESOURCE_MEM_WRITEABLE : 0; 405 IORESOURCE_MEM_WRITEABLE : 0;
406 406
407 pnp_register_mem_resource(option,mem); 407 pnp_register_mem_resource(option,mem);
@@ -410,21 +410,21 @@ pnpacpi_parse_mem24_option(struct pnp_option *option,
410 410
411static void 411static void
412pnpacpi_parse_mem32_option(struct pnp_option *option, 412pnpacpi_parse_mem32_option(struct pnp_option *option,
413 struct acpi_resource_mem32 *p) 413 struct acpi_resource_memory32 *p)
414{ 414{
415 struct pnp_mem * mem; 415 struct pnp_mem * mem;
416 416
417 if (p->range_length == 0) 417 if (p->address_length == 0)
418 return; 418 return;
419 mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL); 419 mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL);
420 if (!mem) 420 if (!mem)
421 return; 421 return;
422 mem->min = p->min_base_address; 422 mem->min = p->minimum;
423 mem->max = p->max_base_address; 423 mem->max = p->maximum;
424 mem->align = p->alignment; 424 mem->align = p->alignment;
425 mem->size = p->range_length; 425 mem->size = p->address_length;
426 426
427 mem->flags = (ACPI_READ_WRITE_MEMORY == p->read_write_attribute) ? 427 mem->flags = (ACPI_READ_WRITE_MEMORY == p->write_protect) ?
428 IORESOURCE_MEM_WRITEABLE : 0; 428 IORESOURCE_MEM_WRITEABLE : 0;
429 429
430 pnp_register_mem_resource(option,mem); 430 pnp_register_mem_resource(option,mem);
@@ -433,20 +433,20 @@ pnpacpi_parse_mem32_option(struct pnp_option *option,
433 433
434static void 434static void
435pnpacpi_parse_fixed_mem32_option(struct pnp_option *option, 435pnpacpi_parse_fixed_mem32_option(struct pnp_option *option,
436 struct acpi_resource_fixed_mem32 *p) 436 struct acpi_resource_fixed_memory32 *p)
437{ 437{
438 struct pnp_mem * mem; 438 struct pnp_mem * mem;
439 439
440 if (p->range_length == 0) 440 if (p->address_length == 0)
441 return; 441 return;
442 mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL); 442 mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL);
443 if (!mem) 443 if (!mem)
444 return; 444 return;
445 mem->min = mem->max = p->range_base_address; 445 mem->min = mem->max = p->address;
446 mem->size = p->range_length; 446 mem->size = p->address_length;
447 mem->align = 0; 447 mem->align = 0;
448 448
449 mem->flags = (ACPI_READ_WRITE_MEMORY == p->read_write_attribute) ? 449 mem->flags = (ACPI_READ_WRITE_MEMORY == p->write_protect) ?
450 IORESOURCE_MEM_WRITEABLE : 0; 450 IORESOURCE_MEM_WRITEABLE : 0;
451 451
452 pnp_register_mem_resource(option,mem); 452 pnp_register_mem_resource(option,mem);
@@ -463,7 +463,7 @@ pnpacpi_parse_address_option(struct pnp_option *option, struct acpi_resource *r)
463 463
464 status = acpi_resource_to_address64(r, p); 464 status = acpi_resource_to_address64(r, p);
465 if (!ACPI_SUCCESS(status)) { 465 if (!ACPI_SUCCESS(status)) {
466 pnp_warn("PnPACPI: failed to convert resource type %d", r->id); 466 pnp_warn("PnPACPI: failed to convert resource type %d", r->type);
467 return; 467 return;
468 } 468 }
469 469
@@ -474,17 +474,17 @@ pnpacpi_parse_address_option(struct pnp_option *option, struct acpi_resource *r)
474 mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL); 474 mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL);
475 if (!mem) 475 if (!mem)
476 return; 476 return;
477 mem->min = mem->max = p->min_address_range; 477 mem->min = mem->max = p->minimum;
478 mem->size = p->address_length; 478 mem->size = p->address_length;
479 mem->align = 0; 479 mem->align = 0;
480 mem->flags = (p->attribute.memory.read_write_attribute == 480 mem->flags = (p->info.mem.write_protect ==
481 ACPI_READ_WRITE_MEMORY) ? IORESOURCE_MEM_WRITEABLE : 0; 481 ACPI_READ_WRITE_MEMORY) ? IORESOURCE_MEM_WRITEABLE : 0;
482 pnp_register_mem_resource(option,mem); 482 pnp_register_mem_resource(option,mem);
483 } else if (p->resource_type == ACPI_IO_RANGE) { 483 } else if (p->resource_type == ACPI_IO_RANGE) {
484 port = kcalloc(1, sizeof(struct pnp_port), GFP_KERNEL); 484 port = kcalloc(1, sizeof(struct pnp_port), GFP_KERNEL);
485 if (!port) 485 if (!port)
486 return; 486 return;
487 port->min = port->max = p->min_address_range; 487 port->min = port->max = p->minimum;
488 port->size = p->address_length; 488 port->size = p->address_length;
489 port->align = 0; 489 port->align = 0;
490 port->flags = PNP_PORT_FLAG_FIXED; 490 port->flags = PNP_PORT_FLAG_FIXED;
@@ -498,7 +498,7 @@ struct acpipnp_parse_option_s {
498 struct pnp_dev *dev; 498 struct pnp_dev *dev;
499}; 499};
500 500
501static acpi_status pnpacpi_option_resource(struct acpi_resource *res, 501static acpi_status pnpacpi_option_resource(struct acpi_resource *res,
502 void *data) 502 void *data)
503{ 503{
504 int priority = 0; 504 int priority = 0;
@@ -506,40 +506,40 @@ static acpi_status pnpacpi_option_resource(struct acpi_resource *res,
506 struct pnp_dev *dev = parse_data->dev; 506 struct pnp_dev *dev = parse_data->dev;
507 struct pnp_option *option = parse_data->option; 507 struct pnp_option *option = parse_data->option;
508 508
509 switch (res->id) { 509 switch (res->type) {
510 case ACPI_RSTYPE_IRQ: 510 case ACPI_RESOURCE_TYPE_IRQ:
511 pnpacpi_parse_irq_option(option, &res->data.irq); 511 pnpacpi_parse_irq_option(option, &res->data.irq);
512 break; 512 break;
513 case ACPI_RSTYPE_EXT_IRQ: 513 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
514 pnpacpi_parse_ext_irq_option(option, 514 pnpacpi_parse_ext_irq_option(option,
515 &res->data.extended_irq); 515 &res->data.extended_irq);
516 break; 516 break;
517 case ACPI_RSTYPE_DMA: 517 case ACPI_RESOURCE_TYPE_DMA:
518 pnpacpi_parse_dma_option(option, &res->data.dma); 518 pnpacpi_parse_dma_option(option, &res->data.dma);
519 break; 519 break;
520 case ACPI_RSTYPE_IO: 520 case ACPI_RESOURCE_TYPE_IO:
521 pnpacpi_parse_port_option(option, &res->data.io); 521 pnpacpi_parse_port_option(option, &res->data.io);
522 break; 522 break;
523 case ACPI_RSTYPE_FIXED_IO: 523 case ACPI_RESOURCE_TYPE_FIXED_IO:
524 pnpacpi_parse_fixed_port_option(option, 524 pnpacpi_parse_fixed_port_option(option,
525 &res->data.fixed_io); 525 &res->data.fixed_io);
526 break; 526 break;
527 case ACPI_RSTYPE_MEM24: 527 case ACPI_RESOURCE_TYPE_MEMORY24:
528 pnpacpi_parse_mem24_option(option, &res->data.memory24); 528 pnpacpi_parse_mem24_option(option, &res->data.memory24);
529 break; 529 break;
530 case ACPI_RSTYPE_MEM32: 530 case ACPI_RESOURCE_TYPE_MEMORY32:
531 pnpacpi_parse_mem32_option(option, &res->data.memory32); 531 pnpacpi_parse_mem32_option(option, &res->data.memory32);
532 break; 532 break;
533 case ACPI_RSTYPE_FIXED_MEM32: 533 case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
534 pnpacpi_parse_fixed_mem32_option(option, 534 pnpacpi_parse_fixed_mem32_option(option,
535 &res->data.fixed_memory32); 535 &res->data.fixed_memory32);
536 break; 536 break;
537 case ACPI_RSTYPE_ADDRESS16: 537 case ACPI_RESOURCE_TYPE_ADDRESS16:
538 case ACPI_RSTYPE_ADDRESS32: 538 case ACPI_RESOURCE_TYPE_ADDRESS32:
539 case ACPI_RSTYPE_ADDRESS64: 539 case ACPI_RESOURCE_TYPE_ADDRESS64:
540 pnpacpi_parse_address_option(option, res); 540 pnpacpi_parse_address_option(option, res);
541 break; 541 break;
542 case ACPI_RSTYPE_START_DPF: 542 case ACPI_RESOURCE_TYPE_START_DEPENDENT:
543 switch (res->data.start_dpf.compatibility_priority) { 543 switch (res->data.start_dpf.compatibility_priority) {
544 case ACPI_GOOD_CONFIGURATION: 544 case ACPI_GOOD_CONFIGURATION:
545 priority = PNP_RES_PRIORITY_PREFERRED; 545 priority = PNP_RES_PRIORITY_PREFERRED;
@@ -562,7 +562,7 @@ static acpi_status pnpacpi_option_resource(struct acpi_resource *res,
562 return AE_ERROR; 562 return AE_ERROR;
563 parse_data->option = option; 563 parse_data->option = option;
564 break; 564 break;
565 case ACPI_RSTYPE_END_DPF: 565 case ACPI_RESOURCE_TYPE_END_DEPENDENT:
566 /*only one EndDependentFn is allowed*/ 566 /*only one EndDependentFn is allowed*/
567 if (!parse_data->option_independent) { 567 if (!parse_data->option_independent) {
568 pnp_warn("PnPACPI: more than one EndDependentFn"); 568 pnp_warn("PnPACPI: more than one EndDependentFn");
@@ -572,14 +572,14 @@ static acpi_status pnpacpi_option_resource(struct acpi_resource *res,
572 parse_data->option_independent = NULL; 572 parse_data->option_independent = NULL;
573 break; 573 break;
574 default: 574 default:
575 pnp_warn("PnPACPI: unknown resource type %d", res->id); 575 pnp_warn("PnPACPI: unknown resource type %d", res->type);
576 return AE_ERROR; 576 return AE_ERROR;
577 } 577 }
578 578
579 return AE_OK; 579 return AE_OK;
580} 580}
581 581
582acpi_status pnpacpi_parse_resource_option_data(acpi_handle handle, 582acpi_status pnpacpi_parse_resource_option_data(acpi_handle handle,
583 struct pnp_dev *dev) 583 struct pnp_dev *dev)
584{ 584{
585 acpi_status status; 585 acpi_status status;
@@ -590,7 +590,7 @@ acpi_status pnpacpi_parse_resource_option_data(acpi_handle handle,
590 return AE_ERROR; 590 return AE_ERROR;
591 parse_data.option_independent = parse_data.option; 591 parse_data.option_independent = parse_data.option;
592 parse_data.dev = dev; 592 parse_data.dev = dev;
593 status = acpi_walk_resources(handle, METHOD_NAME__PRS, 593 status = acpi_walk_resources(handle, METHOD_NAME__PRS,
594 pnpacpi_option_resource, &parse_data); 594 pnpacpi_option_resource, &parse_data);
595 595
596 return status; 596 return status;
@@ -603,18 +603,18 @@ static acpi_status pnpacpi_count_resources(struct acpi_resource *res,
603 void *data) 603 void *data)
604{ 604{
605 int *res_cnt = (int *)data; 605 int *res_cnt = (int *)data;
606 switch (res->id) { 606 switch (res->type) {
607 case ACPI_RSTYPE_IRQ: 607 case ACPI_RESOURCE_TYPE_IRQ:
608 case ACPI_RSTYPE_EXT_IRQ: 608 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
609 case ACPI_RSTYPE_DMA: 609 case ACPI_RESOURCE_TYPE_DMA:
610 case ACPI_RSTYPE_IO: 610 case ACPI_RESOURCE_TYPE_IO:
611 case ACPI_RSTYPE_FIXED_IO: 611 case ACPI_RESOURCE_TYPE_FIXED_IO:
612 case ACPI_RSTYPE_MEM24: 612 case ACPI_RESOURCE_TYPE_MEMORY24:
613 case ACPI_RSTYPE_MEM32: 613 case ACPI_RESOURCE_TYPE_MEMORY32:
614 case ACPI_RSTYPE_FIXED_MEM32: 614 case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
615 case ACPI_RSTYPE_ADDRESS16: 615 case ACPI_RESOURCE_TYPE_ADDRESS16:
616 case ACPI_RSTYPE_ADDRESS32: 616 case ACPI_RESOURCE_TYPE_ADDRESS32:
617 case ACPI_RSTYPE_ADDRESS64: 617 case ACPI_RESOURCE_TYPE_ADDRESS64:
618 (*res_cnt) ++; 618 (*res_cnt) ++;
619 default: 619 default:
620 return AE_OK; 620 return AE_OK;
@@ -626,19 +626,19 @@ static acpi_status pnpacpi_type_resources(struct acpi_resource *res,
626 void *data) 626 void *data)
627{ 627{
628 struct acpi_resource **resource = (struct acpi_resource **)data; 628 struct acpi_resource **resource = (struct acpi_resource **)data;
629 switch (res->id) { 629 switch (res->type) {
630 case ACPI_RSTYPE_IRQ: 630 case ACPI_RESOURCE_TYPE_IRQ:
631 case ACPI_RSTYPE_EXT_IRQ: 631 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
632 case ACPI_RSTYPE_DMA: 632 case ACPI_RESOURCE_TYPE_DMA:
633 case ACPI_RSTYPE_IO: 633 case ACPI_RESOURCE_TYPE_IO:
634 case ACPI_RSTYPE_FIXED_IO: 634 case ACPI_RESOURCE_TYPE_FIXED_IO:
635 case ACPI_RSTYPE_MEM24: 635 case ACPI_RESOURCE_TYPE_MEMORY24:
636 case ACPI_RSTYPE_MEM32: 636 case ACPI_RESOURCE_TYPE_MEMORY32:
637 case ACPI_RSTYPE_FIXED_MEM32: 637 case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
638 case ACPI_RSTYPE_ADDRESS16: 638 case ACPI_RESOURCE_TYPE_ADDRESS16:
639 case ACPI_RSTYPE_ADDRESS32: 639 case ACPI_RESOURCE_TYPE_ADDRESS32:
640 case ACPI_RSTYPE_ADDRESS64: 640 case ACPI_RESOURCE_TYPE_ADDRESS64:
641 (*resource)->id = res->id; 641 (*resource)->type = res->type;
642 (*resource)++; 642 (*resource)++;
643 default: 643 default:
644 return AE_OK; 644 return AE_OK;
@@ -647,14 +647,14 @@ static acpi_status pnpacpi_type_resources(struct acpi_resource *res,
647 return AE_OK; 647 return AE_OK;
648} 648}
649 649
650int pnpacpi_build_resource_template(acpi_handle handle, 650int pnpacpi_build_resource_template(acpi_handle handle,
651 struct acpi_buffer *buffer) 651 struct acpi_buffer *buffer)
652{ 652{
653 struct acpi_resource *resource; 653 struct acpi_resource *resource;
654 int res_cnt = 0; 654 int res_cnt = 0;
655 acpi_status status; 655 acpi_status status;
656 656
657 status = acpi_walk_resources(handle, METHOD_NAME__CRS, 657 status = acpi_walk_resources(handle, METHOD_NAME__CRS,
658 pnpacpi_count_resources, &res_cnt); 658 pnpacpi_count_resources, &res_cnt);
659 if (ACPI_FAILURE(status)) { 659 if (ACPI_FAILURE(status)) {
660 pnp_err("Evaluate _CRS failed"); 660 pnp_err("Evaluate _CRS failed");
@@ -668,7 +668,7 @@ int pnpacpi_build_resource_template(acpi_handle handle,
668 return -ENOMEM; 668 return -ENOMEM;
669 pnp_dbg("Res cnt %d", res_cnt); 669 pnp_dbg("Res cnt %d", res_cnt);
670 resource = (struct acpi_resource *)buffer->pointer; 670 resource = (struct acpi_resource *)buffer->pointer;
671 status = acpi_walk_resources(handle, METHOD_NAME__CRS, 671 status = acpi_walk_resources(handle, METHOD_NAME__CRS,
672 pnpacpi_type_resources, &resource); 672 pnpacpi_type_resources, &resource);
673 if (ACPI_FAILURE(status)) { 673 if (ACPI_FAILURE(status)) {
674 kfree(buffer->pointer); 674 kfree(buffer->pointer);
@@ -676,54 +676,54 @@ int pnpacpi_build_resource_template(acpi_handle handle,
676 return -EINVAL; 676 return -EINVAL;
677 } 677 }
678 /* resource will pointer the end resource now */ 678 /* resource will pointer the end resource now */
679 resource->id = ACPI_RSTYPE_END_TAG; 679 resource->type = ACPI_RESOURCE_TYPE_END_TAG;
680 680
681 return 0; 681 return 0;
682} 682}
683 683
684static void pnpacpi_encode_irq(struct acpi_resource *resource, 684static void pnpacpi_encode_irq(struct acpi_resource *resource,
685 struct resource *p) 685 struct resource *p)
686{ 686{
687 int edge_level, active_high_low; 687 int triggering, polarity;
688 688
689 decode_irq_flags(p->flags & IORESOURCE_BITS, &edge_level, 689 decode_irq_flags(p->flags & IORESOURCE_BITS, &triggering,
690 &active_high_low); 690 &polarity);
691 resource->id = ACPI_RSTYPE_IRQ; 691 resource->type = ACPI_RESOURCE_TYPE_IRQ;
692 resource->length = sizeof(struct acpi_resource); 692 resource->length = sizeof(struct acpi_resource);
693 resource->data.irq.edge_level = edge_level; 693 resource->data.irq.triggering = triggering;
694 resource->data.irq.active_high_low = active_high_low; 694 resource->data.irq.polarity = polarity;
695 if (edge_level == ACPI_EDGE_SENSITIVE) 695 if (triggering == ACPI_EDGE_SENSITIVE)
696 resource->data.irq.shared_exclusive = ACPI_EXCLUSIVE; 696 resource->data.irq.sharable = ACPI_EXCLUSIVE;
697 else 697 else
698 resource->data.irq.shared_exclusive = ACPI_SHARED; 698 resource->data.irq.sharable = ACPI_SHARED;
699 resource->data.irq.number_of_interrupts = 1; 699 resource->data.irq.interrupt_count = 1;
700 resource->data.irq.interrupts[0] = p->start; 700 resource->data.irq.interrupts[0] = p->start;
701} 701}
702 702
703static void pnpacpi_encode_ext_irq(struct acpi_resource *resource, 703static void pnpacpi_encode_ext_irq(struct acpi_resource *resource,
704 struct resource *p) 704 struct resource *p)
705{ 705{
706 int edge_level, active_high_low; 706 int triggering, polarity;
707 707
708 decode_irq_flags(p->flags & IORESOURCE_BITS, &edge_level, 708 decode_irq_flags(p->flags & IORESOURCE_BITS, &triggering,
709 &active_high_low); 709 &polarity);
710 resource->id = ACPI_RSTYPE_EXT_IRQ; 710 resource->type = ACPI_RESOURCE_TYPE_EXTENDED_IRQ;
711 resource->length = sizeof(struct acpi_resource); 711 resource->length = sizeof(struct acpi_resource);
712 resource->data.extended_irq.producer_consumer = ACPI_CONSUMER; 712 resource->data.extended_irq.producer_consumer = ACPI_CONSUMER;
713 resource->data.extended_irq.edge_level = edge_level; 713 resource->data.extended_irq.triggering = triggering;
714 resource->data.extended_irq.active_high_low = active_high_low; 714 resource->data.extended_irq.polarity = polarity;
715 if (edge_level == ACPI_EDGE_SENSITIVE) 715 if (triggering == ACPI_EDGE_SENSITIVE)
716 resource->data.irq.shared_exclusive = ACPI_EXCLUSIVE; 716 resource->data.irq.sharable = ACPI_EXCLUSIVE;
717 else 717 else
718 resource->data.irq.shared_exclusive = ACPI_SHARED; 718 resource->data.irq.sharable = ACPI_SHARED;
719 resource->data.extended_irq.number_of_interrupts = 1; 719 resource->data.extended_irq.interrupt_count = 1;
720 resource->data.extended_irq.interrupts[0] = p->start; 720 resource->data.extended_irq.interrupts[0] = p->start;
721} 721}
722 722
723static void pnpacpi_encode_dma(struct acpi_resource *resource, 723static void pnpacpi_encode_dma(struct acpi_resource *resource,
724 struct resource *p) 724 struct resource *p)
725{ 725{
726 resource->id = ACPI_RSTYPE_DMA; 726 resource->type = ACPI_RESOURCE_TYPE_DMA;
727 resource->length = sizeof(struct acpi_resource); 727 resource->length = sizeof(struct acpi_resource);
728 /* Note: pnp_assign_dma will copy pnp_dma->flags into p->flags */ 728 /* Note: pnp_assign_dma will copy pnp_dma->flags into p->flags */
729 if (p->flags & IORESOURCE_DMA_COMPATIBLE) 729 if (p->flags & IORESOURCE_DMA_COMPATIBLE)
@@ -741,75 +741,75 @@ static void pnpacpi_encode_dma(struct acpi_resource *resource,
741 else if (p->flags & IORESOURCE_DMA_16BIT) 741 else if (p->flags & IORESOURCE_DMA_16BIT)
742 resource->data.dma.transfer = ACPI_TRANSFER_16; 742 resource->data.dma.transfer = ACPI_TRANSFER_16;
743 resource->data.dma.bus_master = p->flags & IORESOURCE_DMA_MASTER; 743 resource->data.dma.bus_master = p->flags & IORESOURCE_DMA_MASTER;
744 resource->data.dma.number_of_channels = 1; 744 resource->data.dma.channel_count = 1;
745 resource->data.dma.channels[0] = p->start; 745 resource->data.dma.channels[0] = p->start;
746} 746}
747 747
748static void pnpacpi_encode_io(struct acpi_resource *resource, 748static void pnpacpi_encode_io(struct acpi_resource *resource,
749 struct resource *p) 749 struct resource *p)
750{ 750{
751 resource->id = ACPI_RSTYPE_IO; 751 resource->type = ACPI_RESOURCE_TYPE_IO;
752 resource->length = sizeof(struct acpi_resource); 752 resource->length = sizeof(struct acpi_resource);
753 /* Note: pnp_assign_port will copy pnp_port->flags into p->flags */ 753 /* Note: pnp_assign_port will copy pnp_port->flags into p->flags */
754 resource->data.io.io_decode = (p->flags & PNP_PORT_FLAG_16BITADDR)? 754 resource->data.io.io_decode = (p->flags & PNP_PORT_FLAG_16BITADDR)?
755 ACPI_DECODE_16 : ACPI_DECODE_10; 755 ACPI_DECODE_16 : ACPI_DECODE_10;
756 resource->data.io.min_base_address = p->start; 756 resource->data.io.minimum = p->start;
757 resource->data.io.max_base_address = p->end; 757 resource->data.io.maximum = p->end;
758 resource->data.io.alignment = 0; /* Correct? */ 758 resource->data.io.alignment = 0; /* Correct? */
759 resource->data.io.range_length = p->end - p->start + 1; 759 resource->data.io.address_length = p->end - p->start + 1;
760} 760}
761 761
762static void pnpacpi_encode_fixed_io(struct acpi_resource *resource, 762static void pnpacpi_encode_fixed_io(struct acpi_resource *resource,
763 struct resource *p) 763 struct resource *p)
764{ 764{
765 resource->id = ACPI_RSTYPE_FIXED_IO; 765 resource->type = ACPI_RESOURCE_TYPE_FIXED_IO;
766 resource->length = sizeof(struct acpi_resource); 766 resource->length = sizeof(struct acpi_resource);
767 resource->data.fixed_io.base_address = p->start; 767 resource->data.fixed_io.address = p->start;
768 resource->data.fixed_io.range_length = p->end - p->start + 1; 768 resource->data.fixed_io.address_length = p->end - p->start + 1;
769} 769}
770 770
771static void pnpacpi_encode_mem24(struct acpi_resource *resource, 771static void pnpacpi_encode_mem24(struct acpi_resource *resource,
772 struct resource *p) 772 struct resource *p)
773{ 773{
774 resource->id = ACPI_RSTYPE_MEM24; 774 resource->type = ACPI_RESOURCE_TYPE_MEMORY24;
775 resource->length = sizeof(struct acpi_resource); 775 resource->length = sizeof(struct acpi_resource);
776 /* Note: pnp_assign_mem will copy pnp_mem->flags into p->flags */ 776 /* Note: pnp_assign_mem will copy pnp_mem->flags into p->flags */
777 resource->data.memory24.read_write_attribute = 777 resource->data.memory24.write_protect =
778 (p->flags & IORESOURCE_MEM_WRITEABLE) ? 778 (p->flags & IORESOURCE_MEM_WRITEABLE) ?
779 ACPI_READ_WRITE_MEMORY : ACPI_READ_ONLY_MEMORY; 779 ACPI_READ_WRITE_MEMORY : ACPI_READ_ONLY_MEMORY;
780 resource->data.memory24.min_base_address = p->start; 780 resource->data.memory24.minimum = p->start;
781 resource->data.memory24.max_base_address = p->end; 781 resource->data.memory24.maximum = p->end;
782 resource->data.memory24.alignment = 0; 782 resource->data.memory24.alignment = 0;
783 resource->data.memory24.range_length = p->end - p->start + 1; 783 resource->data.memory24.address_length = p->end - p->start + 1;
784} 784}
785 785
786static void pnpacpi_encode_mem32(struct acpi_resource *resource, 786static void pnpacpi_encode_mem32(struct acpi_resource *resource,
787 struct resource *p) 787 struct resource *p)
788{ 788{
789 resource->id = ACPI_RSTYPE_MEM32; 789 resource->type = ACPI_RESOURCE_TYPE_MEMORY32;
790 resource->length = sizeof(struct acpi_resource); 790 resource->length = sizeof(struct acpi_resource);
791 resource->data.memory32.read_write_attribute = 791 resource->data.memory32.write_protect =
792 (p->flags & IORESOURCE_MEM_WRITEABLE) ? 792 (p->flags & IORESOURCE_MEM_WRITEABLE) ?
793 ACPI_READ_WRITE_MEMORY : ACPI_READ_ONLY_MEMORY; 793 ACPI_READ_WRITE_MEMORY : ACPI_READ_ONLY_MEMORY;
794 resource->data.memory32.min_base_address = p->start; 794 resource->data.memory32.minimum = p->start;
795 resource->data.memory32.max_base_address = p->end; 795 resource->data.memory32.maximum = p->end;
796 resource->data.memory32.alignment = 0; 796 resource->data.memory32.alignment = 0;
797 resource->data.memory32.range_length = p->end - p->start + 1; 797 resource->data.memory32.address_length = p->end - p->start + 1;
798} 798}
799 799
800static void pnpacpi_encode_fixed_mem32(struct acpi_resource *resource, 800static void pnpacpi_encode_fixed_mem32(struct acpi_resource *resource,
801 struct resource *p) 801 struct resource *p)
802{ 802{
803 resource->id = ACPI_RSTYPE_FIXED_MEM32; 803 resource->type = ACPI_RESOURCE_TYPE_FIXED_MEMORY32;
804 resource->length = sizeof(struct acpi_resource); 804 resource->length = sizeof(struct acpi_resource);
805 resource->data.fixed_memory32.read_write_attribute = 805 resource->data.fixed_memory32.write_protect =
806 (p->flags & IORESOURCE_MEM_WRITEABLE) ? 806 (p->flags & IORESOURCE_MEM_WRITEABLE) ?
807 ACPI_READ_WRITE_MEMORY : ACPI_READ_ONLY_MEMORY; 807 ACPI_READ_WRITE_MEMORY : ACPI_READ_ONLY_MEMORY;
808 resource->data.fixed_memory32.range_base_address = p->start; 808 resource->data.fixed_memory32.address = p->start;
809 resource->data.fixed_memory32.range_length = p->end - p->start + 1; 809 resource->data.fixed_memory32.address_length = p->end - p->start + 1;
810} 810}
811 811
812int pnpacpi_encode_resources(struct pnp_resource_table *res_table, 812int pnpacpi_encode_resources(struct pnp_resource_table *res_table,
813 struct acpi_buffer *buffer) 813 struct acpi_buffer *buffer)
814{ 814{
815 int i = 0; 815 int i = 0;
@@ -820,58 +820,58 @@ int pnpacpi_encode_resources(struct pnp_resource_table *res_table,
820 820
821 pnp_dbg("res cnt %d", res_cnt); 821 pnp_dbg("res cnt %d", res_cnt);
822 while (i < res_cnt) { 822 while (i < res_cnt) {
823 switch(resource->id) { 823 switch(resource->type) {
824 case ACPI_RSTYPE_IRQ: 824 case ACPI_RESOURCE_TYPE_IRQ:
825 pnp_dbg("Encode irq"); 825 pnp_dbg("Encode irq");
826 pnpacpi_encode_irq(resource, 826 pnpacpi_encode_irq(resource,
827 &res_table->irq_resource[irq]); 827 &res_table->irq_resource[irq]);
828 irq++; 828 irq++;
829 break; 829 break;
830 830
831 case ACPI_RSTYPE_EXT_IRQ: 831 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
832 pnp_dbg("Encode ext irq"); 832 pnp_dbg("Encode ext irq");
833 pnpacpi_encode_ext_irq(resource, 833 pnpacpi_encode_ext_irq(resource,
834 &res_table->irq_resource[irq]); 834 &res_table->irq_resource[irq]);
835 irq++; 835 irq++;
836 break; 836 break;
837 case ACPI_RSTYPE_DMA: 837 case ACPI_RESOURCE_TYPE_DMA:
838 pnp_dbg("Encode dma"); 838 pnp_dbg("Encode dma");
839 pnpacpi_encode_dma(resource, 839 pnpacpi_encode_dma(resource,
840 &res_table->dma_resource[dma]); 840 &res_table->dma_resource[dma]);
841 dma ++; 841 dma ++;
842 break; 842 break;
843 case ACPI_RSTYPE_IO: 843 case ACPI_RESOURCE_TYPE_IO:
844 pnp_dbg("Encode io"); 844 pnp_dbg("Encode io");
845 pnpacpi_encode_io(resource, 845 pnpacpi_encode_io(resource,
846 &res_table->port_resource[port]); 846 &res_table->port_resource[port]);
847 port ++; 847 port ++;
848 break; 848 break;
849 case ACPI_RSTYPE_FIXED_IO: 849 case ACPI_RESOURCE_TYPE_FIXED_IO:
850 pnp_dbg("Encode fixed io"); 850 pnp_dbg("Encode fixed io");
851 pnpacpi_encode_fixed_io(resource, 851 pnpacpi_encode_fixed_io(resource,
852 &res_table->port_resource[port]); 852 &res_table->port_resource[port]);
853 port ++; 853 port ++;
854 break; 854 break;
855 case ACPI_RSTYPE_MEM24: 855 case ACPI_RESOURCE_TYPE_MEMORY24:
856 pnp_dbg("Encode mem24"); 856 pnp_dbg("Encode mem24");
857 pnpacpi_encode_mem24(resource, 857 pnpacpi_encode_mem24(resource,
858 &res_table->mem_resource[mem]); 858 &res_table->mem_resource[mem]);
859 mem ++; 859 mem ++;
860 break; 860 break;
861 case ACPI_RSTYPE_MEM32: 861 case ACPI_RESOURCE_TYPE_MEMORY32:
862 pnp_dbg("Encode mem32"); 862 pnp_dbg("Encode mem32");
863 pnpacpi_encode_mem32(resource, 863 pnpacpi_encode_mem32(resource,
864 &res_table->mem_resource[mem]); 864 &res_table->mem_resource[mem]);
865 mem ++; 865 mem ++;
866 break; 866 break;
867 case ACPI_RSTYPE_FIXED_MEM32: 867 case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
868 pnp_dbg("Encode fixed mem32"); 868 pnp_dbg("Encode fixed mem32");
869 pnpacpi_encode_fixed_mem32(resource, 869 pnpacpi_encode_fixed_mem32(resource,
870 &res_table->mem_resource[mem]); 870 &res_table->mem_resource[mem]);
871 mem ++; 871 mem ++;
872 break; 872 break;
873 default: /* other type */ 873 default: /* other type */
874 pnp_warn("unknown resource type %d", resource->id); 874 pnp_warn("unknown resource type %d", resource->type);
875 return -EINVAL; 875 return -EINVAL;
876 } 876 }
877 resource ++; 877 resource ++;