aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2008-04-28 18:34:04 -0400
committerLen Brown <len.brown@intel.com>2008-04-29 03:22:20 -0400
commitc1caf06ccfd3a4efd4b489f89bcdabd2362f31d0 (patch)
tree5571b9dc1b4b66c72ad64a406602d23112446f3e /drivers
parentcdef6254e17e98f1071ce1bfc8f2a87997c855d0 (diff)
PNP: add debug output to option registration
Add debug output to resource option registration functions (enabled by CONFIG_PNP_DEBUG). This uses dev_printk, so I had to add pnp_dev arguments at the same time. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Acked-By: Rene Herman <rene.herman@gmail.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pnp/isapnp/core.c50
-rw-r--r--drivers/pnp/pnpacpi/rsparser.c68
-rw-r--r--drivers/pnp/pnpbios/rsparser.c54
-rw-r--r--drivers/pnp/resource.c34
4 files changed, 130 insertions, 76 deletions
diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c
index 883577a93d6a..38ff64dce9c0 100644
--- a/drivers/pnp/isapnp/core.c
+++ b/drivers/pnp/isapnp/core.c
@@ -431,7 +431,8 @@ static struct pnp_dev *__init isapnp_parse_device(struct pnp_card *card,
431/* 431/*
432 * Add IRQ resource to resources list. 432 * Add IRQ resource to resources list.
433 */ 433 */
434static void __init isapnp_parse_irq_resource(struct pnp_option *option, 434static void __init isapnp_parse_irq_resource(struct pnp_dev *dev,
435 struct pnp_option *option,
435 int size) 436 int size)
436{ 437{
437 unsigned char tmp[3]; 438 unsigned char tmp[3];
@@ -448,13 +449,14 @@ static void __init isapnp_parse_irq_resource(struct pnp_option *option,
448 irq->flags = tmp[2]; 449 irq->flags = tmp[2];
449 else 450 else
450 irq->flags = IORESOURCE_IRQ_HIGHEDGE; 451 irq->flags = IORESOURCE_IRQ_HIGHEDGE;
451 pnp_register_irq_resource(option, irq); 452 pnp_register_irq_resource(dev, option, irq);
452} 453}
453 454
454/* 455/*
455 * Add DMA resource to resources list. 456 * Add DMA resource to resources list.
456 */ 457 */
457static void __init isapnp_parse_dma_resource(struct pnp_option *option, 458static void __init isapnp_parse_dma_resource(struct pnp_dev *dev,
459 struct pnp_option *option,
458 int size) 460 int size)
459{ 461{
460 unsigned char tmp[2]; 462 unsigned char tmp[2];
@@ -466,13 +468,14 @@ static void __init isapnp_parse_dma_resource(struct pnp_option *option,
466 return; 468 return;
467 dma->map = tmp[0]; 469 dma->map = tmp[0];
468 dma->flags = tmp[1]; 470 dma->flags = tmp[1];
469 pnp_register_dma_resource(option, dma); 471 pnp_register_dma_resource(dev, option, dma);
470} 472}
471 473
472/* 474/*
473 * Add port resource to resources list. 475 * Add port resource to resources list.
474 */ 476 */
475static void __init isapnp_parse_port_resource(struct pnp_option *option, 477static void __init isapnp_parse_port_resource(struct pnp_dev *dev,
478 struct pnp_option *option,
476 int size) 479 int size)
477{ 480{
478 unsigned char tmp[7]; 481 unsigned char tmp[7];
@@ -487,13 +490,14 @@ static void __init isapnp_parse_port_resource(struct pnp_option *option,
487 port->align = tmp[5]; 490 port->align = tmp[5];
488 port->size = tmp[6]; 491 port->size = tmp[6];
489 port->flags = tmp[0] ? PNP_PORT_FLAG_16BITADDR : 0; 492 port->flags = tmp[0] ? PNP_PORT_FLAG_16BITADDR : 0;
490 pnp_register_port_resource(option, port); 493 pnp_register_port_resource(dev, option, port);
491} 494}
492 495
493/* 496/*
494 * Add fixed port resource to resources list. 497 * Add fixed port resource to resources list.
495 */ 498 */
496static void __init isapnp_parse_fixed_port_resource(struct pnp_option *option, 499static void __init isapnp_parse_fixed_port_resource(struct pnp_dev *dev,
500 struct pnp_option *option,
497 int size) 501 int size)
498{ 502{
499 unsigned char tmp[3]; 503 unsigned char tmp[3];
@@ -507,13 +511,14 @@ static void __init isapnp_parse_fixed_port_resource(struct pnp_option *option,
507 port->size = tmp[2]; 511 port->size = tmp[2];
508 port->align = 0; 512 port->align = 0;
509 port->flags = PNP_PORT_FLAG_FIXED; 513 port->flags = PNP_PORT_FLAG_FIXED;
510 pnp_register_port_resource(option, port); 514 pnp_register_port_resource(dev, option, port);
511} 515}
512 516
513/* 517/*
514 * Add memory resource to resources list. 518 * Add memory resource to resources list.
515 */ 519 */
516static void __init isapnp_parse_mem_resource(struct pnp_option *option, 520static void __init isapnp_parse_mem_resource(struct pnp_dev *dev,
521 struct pnp_option *option,
517 int size) 522 int size)
518{ 523{
519 unsigned char tmp[9]; 524 unsigned char tmp[9];
@@ -528,13 +533,14 @@ static void __init isapnp_parse_mem_resource(struct pnp_option *option,
528 mem->align = (tmp[6] << 8) | tmp[5]; 533 mem->align = (tmp[6] << 8) | tmp[5];
529 mem->size = ((tmp[8] << 8) | tmp[7]) << 8; 534 mem->size = ((tmp[8] << 8) | tmp[7]) << 8;
530 mem->flags = tmp[0]; 535 mem->flags = tmp[0];
531 pnp_register_mem_resource(option, mem); 536 pnp_register_mem_resource(dev, option, mem);
532} 537}
533 538
534/* 539/*
535 * Add 32-bit memory resource to resources list. 540 * Add 32-bit memory resource to resources list.
536 */ 541 */
537static void __init isapnp_parse_mem32_resource(struct pnp_option *option, 542static void __init isapnp_parse_mem32_resource(struct pnp_dev *dev,
543 struct pnp_option *option,
538 int size) 544 int size)
539{ 545{
540 unsigned char tmp[17]; 546 unsigned char tmp[17];
@@ -551,13 +557,14 @@ static void __init isapnp_parse_mem32_resource(struct pnp_option *option,
551 mem->size = 557 mem->size =
552 (tmp[16] << 24) | (tmp[15] << 16) | (tmp[14] << 8) | tmp[13]; 558 (tmp[16] << 24) | (tmp[15] << 16) | (tmp[14] << 8) | tmp[13];
553 mem->flags = tmp[0]; 559 mem->flags = tmp[0];
554 pnp_register_mem_resource(option, mem); 560 pnp_register_mem_resource(dev, option, mem);
555} 561}
556 562
557/* 563/*
558 * Add 32-bit fixed memory resource to resources list. 564 * Add 32-bit fixed memory resource to resources list.
559 */ 565 */
560static void __init isapnp_parse_fixed_mem32_resource(struct pnp_option *option, 566static void __init isapnp_parse_fixed_mem32_resource(struct pnp_dev *dev,
567 struct pnp_option *option,
561 int size) 568 int size)
562{ 569{
563 unsigned char tmp[9]; 570 unsigned char tmp[9];
@@ -572,7 +579,7 @@ static void __init isapnp_parse_fixed_mem32_resource(struct pnp_option *option,
572 mem->size = (tmp[8] << 24) | (tmp[7] << 16) | (tmp[6] << 8) | tmp[5]; 579 mem->size = (tmp[8] << 24) | (tmp[7] << 16) | (tmp[6] << 8) | tmp[5];
573 mem->align = 0; 580 mem->align = 0;
574 mem->flags = tmp[0]; 581 mem->flags = tmp[0];
575 pnp_register_mem_resource(option, mem); 582 pnp_register_mem_resource(dev, option, mem);
576} 583}
577 584
578/* 585/*
@@ -656,13 +663,13 @@ static int __init isapnp_create_device(struct pnp_card *card,
656 case _STAG_IRQ: 663 case _STAG_IRQ:
657 if (size < 2 || size > 3) 664 if (size < 2 || size > 3)
658 goto __skip; 665 goto __skip;
659 isapnp_parse_irq_resource(option, size); 666 isapnp_parse_irq_resource(dev, option, size);
660 size = 0; 667 size = 0;
661 break; 668 break;
662 case _STAG_DMA: 669 case _STAG_DMA:
663 if (size != 2) 670 if (size != 2)
664 goto __skip; 671 goto __skip;
665 isapnp_parse_dma_resource(option, size); 672 isapnp_parse_dma_resource(dev, option, size);
666 size = 0; 673 size = 0;
667 break; 674 break;
668 case _STAG_STARTDEP: 675 case _STAG_STARTDEP:
@@ -682,17 +689,18 @@ static int __init isapnp_create_device(struct pnp_card *card,
682 if (size != 0) 689 if (size != 0)
683 goto __skip; 690 goto __skip;
684 priority = 0; 691 priority = 0;
692 dev_dbg(&dev->dev, "end dependent options\n");
685 break; 693 break;
686 case _STAG_IOPORT: 694 case _STAG_IOPORT:
687 if (size != 7) 695 if (size != 7)
688 goto __skip; 696 goto __skip;
689 isapnp_parse_port_resource(option, size); 697 isapnp_parse_port_resource(dev, option, size);
690 size = 0; 698 size = 0;
691 break; 699 break;
692 case _STAG_FIXEDIO: 700 case _STAG_FIXEDIO:
693 if (size != 3) 701 if (size != 3)
694 goto __skip; 702 goto __skip;
695 isapnp_parse_fixed_port_resource(option, size); 703 isapnp_parse_fixed_port_resource(dev, option, size);
696 size = 0; 704 size = 0;
697 break; 705 break;
698 case _STAG_VENDOR: 706 case _STAG_VENDOR:
@@ -700,7 +708,7 @@ static int __init isapnp_create_device(struct pnp_card *card,
700 case _LTAG_MEMRANGE: 708 case _LTAG_MEMRANGE:
701 if (size != 9) 709 if (size != 9)
702 goto __skip; 710 goto __skip;
703 isapnp_parse_mem_resource(option, size); 711 isapnp_parse_mem_resource(dev, option, size);
704 size = 0; 712 size = 0;
705 break; 713 break;
706 case _LTAG_ANSISTR: 714 case _LTAG_ANSISTR:
@@ -715,13 +723,13 @@ static int __init isapnp_create_device(struct pnp_card *card,
715 case _LTAG_MEM32RANGE: 723 case _LTAG_MEM32RANGE:
716 if (size != 17) 724 if (size != 17)
717 goto __skip; 725 goto __skip;
718 isapnp_parse_mem32_resource(option, size); 726 isapnp_parse_mem32_resource(dev, option, size);
719 size = 0; 727 size = 0;
720 break; 728 break;
721 case _LTAG_FIXEDMEM32RANGE: 729 case _LTAG_FIXEDMEM32RANGE:
722 if (size != 9) 730 if (size != 9)
723 goto __skip; 731 goto __skip;
724 isapnp_parse_fixed_mem32_resource(option, size); 732 isapnp_parse_fixed_mem32_resource(dev, option, size);
725 size = 0; 733 size = 0;
726 break; 734 break;
727 case _STAG_END: 735 case _STAG_END:
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c
index baaf60212779..32454aa07ebc 100644
--- a/drivers/pnp/pnpacpi/rsparser.c
+++ b/drivers/pnp/pnpacpi/rsparser.c
@@ -410,7 +410,8 @@ acpi_status pnpacpi_parse_allocated_resource(acpi_handle handle,
410 pnpacpi_allocated_resource, res); 410 pnpacpi_allocated_resource, res);
411} 411}
412 412
413static __init void pnpacpi_parse_dma_option(struct pnp_option *option, 413static __init void pnpacpi_parse_dma_option(struct pnp_dev *dev,
414 struct pnp_option *option,
414 struct acpi_resource_dma *p) 415 struct acpi_resource_dma *p)
415{ 416{
416 int i; 417 int i;
@@ -427,10 +428,11 @@ static __init void pnpacpi_parse_dma_option(struct pnp_option *option,
427 428
428 dma->flags = dma_flags(p->type, p->bus_master, p->transfer); 429 dma->flags = dma_flags(p->type, p->bus_master, p->transfer);
429 430
430 pnp_register_dma_resource(option, dma); 431 pnp_register_dma_resource(dev, option, dma);
431} 432}
432 433
433static __init void pnpacpi_parse_irq_option(struct pnp_option *option, 434static __init void pnpacpi_parse_irq_option(struct pnp_dev *dev,
435 struct pnp_option *option,
434 struct acpi_resource_irq *p) 436 struct acpi_resource_irq *p)
435{ 437{
436 int i; 438 int i;
@@ -447,10 +449,11 @@ static __init void pnpacpi_parse_irq_option(struct pnp_option *option,
447 __set_bit(p->interrupts[i], irq->map); 449 __set_bit(p->interrupts[i], irq->map);
448 irq->flags = irq_flags(p->triggering, p->polarity, p->sharable); 450 irq->flags = irq_flags(p->triggering, p->polarity, p->sharable);
449 451
450 pnp_register_irq_resource(option, irq); 452 pnp_register_irq_resource(dev, option, irq);
451} 453}
452 454
453static __init void pnpacpi_parse_ext_irq_option(struct pnp_option *option, 455static __init void pnpacpi_parse_ext_irq_option(struct pnp_dev *dev,
456 struct pnp_option *option,
454 struct acpi_resource_extended_irq *p) 457 struct acpi_resource_extended_irq *p)
455{ 458{
456 int i; 459 int i;
@@ -467,10 +470,11 @@ static __init void pnpacpi_parse_ext_irq_option(struct pnp_option *option,
467 __set_bit(p->interrupts[i], irq->map); 470 __set_bit(p->interrupts[i], irq->map);
468 irq->flags = irq_flags(p->triggering, p->polarity, p->sharable); 471 irq->flags = irq_flags(p->triggering, p->polarity, p->sharable);
469 472
470 pnp_register_irq_resource(option, irq); 473 pnp_register_irq_resource(dev, option, irq);
471} 474}
472 475
473static __init void pnpacpi_parse_port_option(struct pnp_option *option, 476static __init void pnpacpi_parse_port_option(struct pnp_dev *dev,
477 struct pnp_option *option,
474 struct acpi_resource_io *io) 478 struct acpi_resource_io *io)
475{ 479{
476 struct pnp_port *port; 480 struct pnp_port *port;
@@ -486,10 +490,11 @@ static __init void pnpacpi_parse_port_option(struct pnp_option *option,
486 port->size = io->address_length; 490 port->size = io->address_length;
487 port->flags = ACPI_DECODE_16 == io->io_decode ? 491 port->flags = ACPI_DECODE_16 == io->io_decode ?
488 PNP_PORT_FLAG_16BITADDR : 0; 492 PNP_PORT_FLAG_16BITADDR : 0;
489 pnp_register_port_resource(option, port); 493 pnp_register_port_resource(dev, option, port);
490} 494}
491 495
492static __init void pnpacpi_parse_fixed_port_option(struct pnp_option *option, 496static __init void pnpacpi_parse_fixed_port_option(struct pnp_dev *dev,
497 struct pnp_option *option,
493 struct acpi_resource_fixed_io *io) 498 struct acpi_resource_fixed_io *io)
494{ 499{
495 struct pnp_port *port; 500 struct pnp_port *port;
@@ -503,10 +508,11 @@ static __init void pnpacpi_parse_fixed_port_option(struct pnp_option *option,
503 port->size = io->address_length; 508 port->size = io->address_length;
504 port->align = 0; 509 port->align = 0;
505 port->flags = PNP_PORT_FLAG_FIXED; 510 port->flags = PNP_PORT_FLAG_FIXED;
506 pnp_register_port_resource(option, port); 511 pnp_register_port_resource(dev, option, port);
507} 512}
508 513
509static __init void pnpacpi_parse_mem24_option(struct pnp_option *option, 514static __init void pnpacpi_parse_mem24_option(struct pnp_dev *dev,
515 struct pnp_option *option,
510 struct acpi_resource_memory24 *p) 516 struct acpi_resource_memory24 *p)
511{ 517{
512 struct pnp_mem *mem; 518 struct pnp_mem *mem;
@@ -524,10 +530,11 @@ static __init void pnpacpi_parse_mem24_option(struct pnp_option *option,
524 mem->flags = (ACPI_READ_WRITE_MEMORY == p->write_protect) ? 530 mem->flags = (ACPI_READ_WRITE_MEMORY == p->write_protect) ?
525 IORESOURCE_MEM_WRITEABLE : 0; 531 IORESOURCE_MEM_WRITEABLE : 0;
526 532
527 pnp_register_mem_resource(option, mem); 533 pnp_register_mem_resource(dev, option, mem);
528} 534}
529 535
530static __init void pnpacpi_parse_mem32_option(struct pnp_option *option, 536static __init void pnpacpi_parse_mem32_option(struct pnp_dev *dev,
537 struct pnp_option *option,
531 struct acpi_resource_memory32 *p) 538 struct acpi_resource_memory32 *p)
532{ 539{
533 struct pnp_mem *mem; 540 struct pnp_mem *mem;
@@ -545,10 +552,11 @@ static __init void pnpacpi_parse_mem32_option(struct pnp_option *option,
545 mem->flags = (ACPI_READ_WRITE_MEMORY == p->write_protect) ? 552 mem->flags = (ACPI_READ_WRITE_MEMORY == p->write_protect) ?
546 IORESOURCE_MEM_WRITEABLE : 0; 553 IORESOURCE_MEM_WRITEABLE : 0;
547 554
548 pnp_register_mem_resource(option, mem); 555 pnp_register_mem_resource(dev, option, mem);
549} 556}
550 557
551static __init void pnpacpi_parse_fixed_mem32_option(struct pnp_option *option, 558static __init void pnpacpi_parse_fixed_mem32_option(struct pnp_dev *dev,
559 struct pnp_option *option,
552 struct acpi_resource_fixed_memory32 *p) 560 struct acpi_resource_fixed_memory32 *p)
553{ 561{
554 struct pnp_mem *mem; 562 struct pnp_mem *mem;
@@ -565,10 +573,11 @@ static __init void pnpacpi_parse_fixed_mem32_option(struct pnp_option *option,
565 mem->flags = (ACPI_READ_WRITE_MEMORY == p->write_protect) ? 573 mem->flags = (ACPI_READ_WRITE_MEMORY == p->write_protect) ?
566 IORESOURCE_MEM_WRITEABLE : 0; 574 IORESOURCE_MEM_WRITEABLE : 0;
567 575
568 pnp_register_mem_resource(option, mem); 576 pnp_register_mem_resource(dev, option, mem);
569} 577}
570 578
571static __init void pnpacpi_parse_address_option(struct pnp_option *option, 579static __init void pnpacpi_parse_address_option(struct pnp_dev *dev,
580 struct pnp_option *option,
572 struct acpi_resource *r) 581 struct acpi_resource *r)
573{ 582{
574 struct acpi_resource_address64 addr, *p = &addr; 583 struct acpi_resource_address64 addr, *p = &addr;
@@ -596,7 +605,7 @@ static __init void pnpacpi_parse_address_option(struct pnp_option *option,
596 mem->flags = (p->info.mem.write_protect == 605 mem->flags = (p->info.mem.write_protect ==
597 ACPI_READ_WRITE_MEMORY) ? IORESOURCE_MEM_WRITEABLE 606 ACPI_READ_WRITE_MEMORY) ? IORESOURCE_MEM_WRITEABLE
598 : 0; 607 : 0;
599 pnp_register_mem_resource(option, mem); 608 pnp_register_mem_resource(dev, option, mem);
600 } else if (p->resource_type == ACPI_IO_RANGE) { 609 } else if (p->resource_type == ACPI_IO_RANGE) {
601 port = kzalloc(sizeof(struct pnp_port), GFP_KERNEL); 610 port = kzalloc(sizeof(struct pnp_port), GFP_KERNEL);
602 if (!port) 611 if (!port)
@@ -605,7 +614,7 @@ static __init void pnpacpi_parse_address_option(struct pnp_option *option,
605 port->size = p->address_length; 614 port->size = p->address_length;
606 port->align = 0; 615 port->align = 0;
607 port->flags = PNP_PORT_FLAG_FIXED; 616 port->flags = PNP_PORT_FLAG_FIXED;
608 pnp_register_port_resource(option, port); 617 pnp_register_port_resource(dev, option, port);
609 } 618 }
610} 619}
611 620
@@ -625,11 +634,11 @@ static __init acpi_status pnpacpi_option_resource(struct acpi_resource *res,
625 634
626 switch (res->type) { 635 switch (res->type) {
627 case ACPI_RESOURCE_TYPE_IRQ: 636 case ACPI_RESOURCE_TYPE_IRQ:
628 pnpacpi_parse_irq_option(option, &res->data.irq); 637 pnpacpi_parse_irq_option(dev, option, &res->data.irq);
629 break; 638 break;
630 639
631 case ACPI_RESOURCE_TYPE_DMA: 640 case ACPI_RESOURCE_TYPE_DMA:
632 pnpacpi_parse_dma_option(option, &res->data.dma); 641 pnpacpi_parse_dma_option(dev, option, &res->data.dma);
633 break; 642 break;
634 643
635 case ACPI_RESOURCE_TYPE_START_DEPENDENT: 644 case ACPI_RESOURCE_TYPE_START_DEPENDENT:
@@ -664,14 +673,16 @@ static __init acpi_status pnpacpi_option_resource(struct acpi_resource *res,
664 } 673 }
665 parse_data->option = parse_data->option_independent; 674 parse_data->option = parse_data->option_independent;
666 parse_data->option_independent = NULL; 675 parse_data->option_independent = NULL;
676 dev_dbg(&dev->dev, "end dependent options\n");
667 break; 677 break;
668 678
669 case ACPI_RESOURCE_TYPE_IO: 679 case ACPI_RESOURCE_TYPE_IO:
670 pnpacpi_parse_port_option(option, &res->data.io); 680 pnpacpi_parse_port_option(dev, option, &res->data.io);
671 break; 681 break;
672 682
673 case ACPI_RESOURCE_TYPE_FIXED_IO: 683 case ACPI_RESOURCE_TYPE_FIXED_IO:
674 pnpacpi_parse_fixed_port_option(option, &res->data.fixed_io); 684 pnpacpi_parse_fixed_port_option(dev, option,
685 &res->data.fixed_io);
675 break; 686 break;
676 687
677 case ACPI_RESOURCE_TYPE_VENDOR: 688 case ACPI_RESOURCE_TYPE_VENDOR:
@@ -679,29 +690,30 @@ static __init acpi_status pnpacpi_option_resource(struct acpi_resource *res,
679 break; 690 break;
680 691
681 case ACPI_RESOURCE_TYPE_MEMORY24: 692 case ACPI_RESOURCE_TYPE_MEMORY24:
682 pnpacpi_parse_mem24_option(option, &res->data.memory24); 693 pnpacpi_parse_mem24_option(dev, option, &res->data.memory24);
683 break; 694 break;
684 695
685 case ACPI_RESOURCE_TYPE_MEMORY32: 696 case ACPI_RESOURCE_TYPE_MEMORY32:
686 pnpacpi_parse_mem32_option(option, &res->data.memory32); 697 pnpacpi_parse_mem32_option(dev, option, &res->data.memory32);
687 break; 698 break;
688 699
689 case ACPI_RESOURCE_TYPE_FIXED_MEMORY32: 700 case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
690 pnpacpi_parse_fixed_mem32_option(option, 701 pnpacpi_parse_fixed_mem32_option(dev, option,
691 &res->data.fixed_memory32); 702 &res->data.fixed_memory32);
692 break; 703 break;
693 704
694 case ACPI_RESOURCE_TYPE_ADDRESS16: 705 case ACPI_RESOURCE_TYPE_ADDRESS16:
695 case ACPI_RESOURCE_TYPE_ADDRESS32: 706 case ACPI_RESOURCE_TYPE_ADDRESS32:
696 case ACPI_RESOURCE_TYPE_ADDRESS64: 707 case ACPI_RESOURCE_TYPE_ADDRESS64:
697 pnpacpi_parse_address_option(option, res); 708 pnpacpi_parse_address_option(dev, option, res);
698 break; 709 break;
699 710
700 case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64: 711 case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64:
701 break; 712 break;
702 713
703 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: 714 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
704 pnpacpi_parse_ext_irq_option(option, &res->data.extended_irq); 715 pnpacpi_parse_ext_irq_option(dev, option,
716 &res->data.extended_irq);
705 break; 717 break;
706 718
707 case ACPI_RESOURCE_TYPE_GENERIC_REGISTER: 719 case ACPI_RESOURCE_TYPE_GENERIC_REGISTER:
diff --git a/drivers/pnp/pnpbios/rsparser.c b/drivers/pnp/pnpbios/rsparser.c
index 948a661280d7..70aa559b3f8c 100644
--- a/drivers/pnp/pnpbios/rsparser.c
+++ b/drivers/pnp/pnpbios/rsparser.c
@@ -263,7 +263,8 @@ len_err:
263 * Resource Configuration Options 263 * Resource Configuration Options
264 */ 264 */
265 265
266static __init void pnpbios_parse_mem_option(unsigned char *p, int size, 266static __init void pnpbios_parse_mem_option(struct pnp_dev *dev,
267 unsigned char *p, int size,
267 struct pnp_option *option) 268 struct pnp_option *option)
268{ 269{
269 struct pnp_mem *mem; 270 struct pnp_mem *mem;
@@ -276,10 +277,11 @@ static __init void pnpbios_parse_mem_option(unsigned char *p, int size,
276 mem->align = (p[9] << 8) | p[8]; 277 mem->align = (p[9] << 8) | p[8];
277 mem->size = ((p[11] << 8) | p[10]) << 8; 278 mem->size = ((p[11] << 8) | p[10]) << 8;
278 mem->flags = p[3]; 279 mem->flags = p[3];
279 pnp_register_mem_resource(option, mem); 280 pnp_register_mem_resource(dev, option, mem);
280} 281}
281 282
282static __init void pnpbios_parse_mem32_option(unsigned char *p, int size, 283static __init void pnpbios_parse_mem32_option(struct pnp_dev *dev,
284 unsigned char *p, int size,
283 struct pnp_option *option) 285 struct pnp_option *option)
284{ 286{
285 struct pnp_mem *mem; 287 struct pnp_mem *mem;
@@ -292,10 +294,11 @@ static __init void pnpbios_parse_mem32_option(unsigned char *p, int size,
292 mem->align = (p[15] << 24) | (p[14] << 16) | (p[13] << 8) | p[12]; 294 mem->align = (p[15] << 24) | (p[14] << 16) | (p[13] << 8) | p[12];
293 mem->size = (p[19] << 24) | (p[18] << 16) | (p[17] << 8) | p[16]; 295 mem->size = (p[19] << 24) | (p[18] << 16) | (p[17] << 8) | p[16];
294 mem->flags = p[3]; 296 mem->flags = p[3];
295 pnp_register_mem_resource(option, mem); 297 pnp_register_mem_resource(dev, option, mem);
296} 298}
297 299
298static __init void pnpbios_parse_fixed_mem32_option(unsigned char *p, int size, 300static __init void pnpbios_parse_fixed_mem32_option(struct pnp_dev *dev,
301 unsigned char *p, int size,
299 struct pnp_option *option) 302 struct pnp_option *option)
300{ 303{
301 struct pnp_mem *mem; 304 struct pnp_mem *mem;
@@ -307,11 +310,12 @@ static __init void pnpbios_parse_fixed_mem32_option(unsigned char *p, int size,
307 mem->size = (p[11] << 24) | (p[10] << 16) | (p[9] << 8) | p[8]; 310 mem->size = (p[11] << 24) | (p[10] << 16) | (p[9] << 8) | p[8];
308 mem->align = 0; 311 mem->align = 0;
309 mem->flags = p[3]; 312 mem->flags = p[3];
310 pnp_register_mem_resource(option, mem); 313 pnp_register_mem_resource(dev, option, mem);
311} 314}
312 315
313static __init void pnpbios_parse_irq_option(unsigned char *p, int size, 316static __init void pnpbios_parse_irq_option(struct pnp_dev *dev,
314 struct pnp_option *option) 317 unsigned char *p, int size,
318 struct pnp_option *option)
315{ 319{
316 struct pnp_irq *irq; 320 struct pnp_irq *irq;
317 unsigned long bits; 321 unsigned long bits;
@@ -325,11 +329,12 @@ static __init void pnpbios_parse_irq_option(unsigned char *p, int size,
325 irq->flags = p[3]; 329 irq->flags = p[3];
326 else 330 else
327 irq->flags = IORESOURCE_IRQ_HIGHEDGE; 331 irq->flags = IORESOURCE_IRQ_HIGHEDGE;
328 pnp_register_irq_resource(option, irq); 332 pnp_register_irq_resource(dev, option, irq);
329} 333}
330 334
331static __init void pnpbios_parse_dma_option(unsigned char *p, int size, 335static __init void pnpbios_parse_dma_option(struct pnp_dev *dev,
332 struct pnp_option *option) 336 unsigned char *p, int size,
337 struct pnp_option *option)
333{ 338{
334 struct pnp_dma *dma; 339 struct pnp_dma *dma;
335 340
@@ -338,10 +343,11 @@ static __init void pnpbios_parse_dma_option(unsigned char *p, int size,
338 return; 343 return;
339 dma->map = p[1]; 344 dma->map = p[1];
340 dma->flags = p[2]; 345 dma->flags = p[2];
341 pnp_register_dma_resource(option, dma); 346 pnp_register_dma_resource(dev, option, dma);
342} 347}
343 348
344static __init void pnpbios_parse_port_option(unsigned char *p, int size, 349static __init void pnpbios_parse_port_option(struct pnp_dev *dev,
350 unsigned char *p, int size,
345 struct pnp_option *option) 351 struct pnp_option *option)
346{ 352{
347 struct pnp_port *port; 353 struct pnp_port *port;
@@ -354,10 +360,11 @@ static __init void pnpbios_parse_port_option(unsigned char *p, int size,
354 port->align = p[6]; 360 port->align = p[6];
355 port->size = p[7]; 361 port->size = p[7];
356 port->flags = p[1] ? PNP_PORT_FLAG_16BITADDR : 0; 362 port->flags = p[1] ? PNP_PORT_FLAG_16BITADDR : 0;
357 pnp_register_port_resource(option, port); 363 pnp_register_port_resource(dev, option, port);
358} 364}
359 365
360static __init void pnpbios_parse_fixed_port_option(unsigned char *p, int size, 366static __init void pnpbios_parse_fixed_port_option(struct pnp_dev *dev,
367 unsigned char *p, int size,
361 struct pnp_option *option) 368 struct pnp_option *option)
362{ 369{
363 struct pnp_port *port; 370 struct pnp_port *port;
@@ -369,7 +376,7 @@ static __init void pnpbios_parse_fixed_port_option(unsigned char *p, int size,
369 port->size = p[3]; 376 port->size = p[3];
370 port->align = 0; 377 port->align = 0;
371 port->flags = PNP_PORT_FLAG_FIXED; 378 port->flags = PNP_PORT_FLAG_FIXED;
372 pnp_register_port_resource(option, port); 379 pnp_register_port_resource(dev, option, port);
373} 380}
374 381
375static __init unsigned char * 382static __init unsigned char *
@@ -403,37 +410,37 @@ pnpbios_parse_resource_option_data(unsigned char *p, unsigned char *end,
403 case LARGE_TAG_MEM: 410 case LARGE_TAG_MEM:
404 if (len != 9) 411 if (len != 9)
405 goto len_err; 412 goto len_err;
406 pnpbios_parse_mem_option(p, len, option); 413 pnpbios_parse_mem_option(dev, p, len, option);
407 break; 414 break;
408 415
409 case LARGE_TAG_MEM32: 416 case LARGE_TAG_MEM32:
410 if (len != 17) 417 if (len != 17)
411 goto len_err; 418 goto len_err;
412 pnpbios_parse_mem32_option(p, len, option); 419 pnpbios_parse_mem32_option(dev, p, len, option);
413 break; 420 break;
414 421
415 case LARGE_TAG_FIXEDMEM32: 422 case LARGE_TAG_FIXEDMEM32:
416 if (len != 9) 423 if (len != 9)
417 goto len_err; 424 goto len_err;
418 pnpbios_parse_fixed_mem32_option(p, len, option); 425 pnpbios_parse_fixed_mem32_option(dev, p, len, option);
419 break; 426 break;
420 427
421 case SMALL_TAG_IRQ: 428 case SMALL_TAG_IRQ:
422 if (len < 2 || len > 3) 429 if (len < 2 || len > 3)
423 goto len_err; 430 goto len_err;
424 pnpbios_parse_irq_option(p, len, option); 431 pnpbios_parse_irq_option(dev, p, len, option);
425 break; 432 break;
426 433
427 case SMALL_TAG_DMA: 434 case SMALL_TAG_DMA:
428 if (len != 2) 435 if (len != 2)
429 goto len_err; 436 goto len_err;
430 pnpbios_parse_dma_option(p, len, option); 437 pnpbios_parse_dma_option(dev, p, len, option);
431 break; 438 break;
432 439
433 case SMALL_TAG_PORT: 440 case SMALL_TAG_PORT:
434 if (len != 7) 441 if (len != 7)
435 goto len_err; 442 goto len_err;
436 pnpbios_parse_port_option(p, len, option); 443 pnpbios_parse_port_option(dev, p, len, option);
437 break; 444 break;
438 445
439 case SMALL_TAG_VENDOR: 446 case SMALL_TAG_VENDOR:
@@ -443,7 +450,7 @@ pnpbios_parse_resource_option_data(unsigned char *p, unsigned char *end,
443 case SMALL_TAG_FIXEDPORT: 450 case SMALL_TAG_FIXEDPORT:
444 if (len != 3) 451 if (len != 3)
445 goto len_err; 452 goto len_err;
446 pnpbios_parse_fixed_port_option(p, len, option); 453 pnpbios_parse_fixed_port_option(dev, p, len, option);
447 break; 454 break;
448 455
449 case SMALL_TAG_STARTDEP: 456 case SMALL_TAG_STARTDEP:
@@ -464,6 +471,7 @@ pnpbios_parse_resource_option_data(unsigned char *p, unsigned char *end,
464 printk(KERN_WARNING 471 printk(KERN_WARNING
465 "PnPBIOS: Missing SMALL_TAG_STARTDEP tag\n"); 472 "PnPBIOS: Missing SMALL_TAG_STARTDEP tag\n");
466 option = option_independent; 473 option = option_independent;
474 dev_dbg(&dev->dev, "end dependent options\n");
467 break; 475 break;
468 476
469 case SMALL_TAG_END: 477 case SMALL_TAG_END:
diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c
index e50ebcffb962..eee6d8eddcb4 100644
--- a/drivers/pnp/resource.c
+++ b/drivers/pnp/resource.c
@@ -53,6 +53,8 @@ struct pnp_option *pnp_register_independent_option(struct pnp_dev *dev)
53 if (dev->independent) 53 if (dev->independent)
54 dev_err(&dev->dev, "independent resource already registered\n"); 54 dev_err(&dev->dev, "independent resource already registered\n");
55 dev->independent = option; 55 dev->independent = option;
56
57 dev_dbg(&dev->dev, "new independent option\n");
56 return option; 58 return option;
57} 59}
58 60
@@ -70,12 +72,18 @@ struct pnp_option *pnp_register_dependent_option(struct pnp_dev *dev,
70 parent->next = option; 72 parent->next = option;
71 } else 73 } else
72 dev->dependent = option; 74 dev->dependent = option;
75
76 dev_dbg(&dev->dev, "new dependent option (priority %#x)\n", priority);
73 return option; 77 return option;
74} 78}
75 79
76int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data) 80int pnp_register_irq_resource(struct pnp_dev *dev, struct pnp_option *option,
81 struct pnp_irq *data)
77{ 82{
78 struct pnp_irq *ptr; 83 struct pnp_irq *ptr;
84#ifdef DEBUG
85 char buf[PNP_IRQ_NR]; /* hex-encoded, so this is overkill but safe */
86#endif
79 87
80 ptr = option->irq; 88 ptr = option->irq;
81 while (ptr && ptr->next) 89 while (ptr && ptr->next)
@@ -94,10 +102,17 @@ int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data)
94 pcibios_penalize_isa_irq(i, 0); 102 pcibios_penalize_isa_irq(i, 0);
95 } 103 }
96#endif 104#endif
105
106#ifdef DEBUG
107 bitmap_scnprintf(buf, sizeof(buf), data->map, PNP_IRQ_NR);
108 dev_dbg(&dev->dev, " irq bitmask %s flags %#x\n", buf,
109 data->flags);
110#endif
97 return 0; 111 return 0;
98} 112}
99 113
100int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data) 114int pnp_register_dma_resource(struct pnp_dev *dev, struct pnp_option *option,
115 struct pnp_dma *data)
101{ 116{
102 struct pnp_dma *ptr; 117 struct pnp_dma *ptr;
103 118
@@ -109,10 +124,13 @@ int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data)
109 else 124 else
110 option->dma = data; 125 option->dma = data;
111 126
127 dev_dbg(&dev->dev, " dma bitmask %#x flags %#x\n", data->map,
128 data->flags);
112 return 0; 129 return 0;
113} 130}
114 131
115int pnp_register_port_resource(struct pnp_option *option, struct pnp_port *data) 132int pnp_register_port_resource(struct pnp_dev *dev, struct pnp_option *option,
133 struct pnp_port *data)
116{ 134{
117 struct pnp_port *ptr; 135 struct pnp_port *ptr;
118 136
@@ -124,10 +142,14 @@ int pnp_register_port_resource(struct pnp_option *option, struct pnp_port *data)
124 else 142 else
125 option->port = data; 143 option->port = data;
126 144
145 dev_dbg(&dev->dev, " io "
146 "min %#x max %#x align %d size %d flags %#x\n",
147 data->min, data->max, data->align, data->size, data->flags);
127 return 0; 148 return 0;
128} 149}
129 150
130int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data) 151int pnp_register_mem_resource(struct pnp_dev *dev, struct pnp_option *option,
152 struct pnp_mem *data)
131{ 153{
132 struct pnp_mem *ptr; 154 struct pnp_mem *ptr;
133 155
@@ -138,6 +160,10 @@ int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data)
138 ptr->next = data; 160 ptr->next = data;
139 else 161 else
140 option->mem = data; 162 option->mem = data;
163
164 dev_dbg(&dev->dev, " mem "
165 "min %#x max %#x align %d size %d flags %#x\n",
166 data->min, data->max, data->align, data->size, data->flags);
141 return 0; 167 return 0;
142} 168}
143 169