aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp/pnpacpi
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/pnp/pnpacpi
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/pnp/pnpacpi')
-rw-r--r--drivers/pnp/pnpacpi/rsparser.c68
1 files changed, 40 insertions, 28 deletions
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: