diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2008-12-08 23:30:41 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-12-30 21:24:29 -0500 |
commit | e64e9db53ab78d20dff4cc1aec8a6b0e4e70ce8c (patch) | |
tree | 0679a6b79d5f0cd5dd5ef2dff1d8aabb92a8efa7 /drivers/acpi | |
parent | cf68b80b0e0cbc6a0d7bbb36b07ce94779ef5f1f (diff) |
ACPI: PCI: always use the PCI INTx pin values, not the _PRT ones
This patch changes pci_irq.c to always use PCI INTx pin encodings
instead of a mix of PCI and _PRT encodings.
The PCI INTx pin numbers from the PCI_INTERRUPT_PIN config register
are 0=device doesn't use interrupts, 1=INTA, ..., 4=INTD. But the
_PRT table uses 0=INTA, ..., 3=INTD.
This patch converts the _PRT encoding to the PCI encoding immediately
when we add a _PRT entry to the global list. All the rest of the
code can then use the PCI encoding consistently.
The point of this is to make the interrupt swizzling look the same
as on other architectures, so someday we can unify them.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/pci_irq.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c index 5ce1fcf77455..2c52cf0004ba 100644 --- a/drivers/acpi/pci_irq.c +++ b/drivers/acpi/pci_irq.c | |||
@@ -62,7 +62,7 @@ static DEFINE_SPINLOCK(acpi_prt_lock); | |||
62 | 62 | ||
63 | static inline char pin_name(int pin) | 63 | static inline char pin_name(int pin) |
64 | { | 64 | { |
65 | return 'A' + pin; | 65 | return 'A' + pin - 1; |
66 | } | 66 | } |
67 | 67 | ||
68 | /* -------------------------------------------------------------------------- | 68 | /* -------------------------------------------------------------------------- |
@@ -203,10 +203,15 @@ acpi_pci_irq_add_entry(acpi_handle handle, | |||
203 | if (!entry) | 203 | if (!entry) |
204 | return -ENOMEM; | 204 | return -ENOMEM; |
205 | 205 | ||
206 | /* | ||
207 | * Note that the _PRT uses 0=INTA, 1=INTB, etc, while PCI uses | ||
208 | * 1=INTA, 2=INTB. We use the PCI encoding throughout, so convert | ||
209 | * it here. | ||
210 | */ | ||
206 | entry->id.segment = segment; | 211 | entry->id.segment = segment; |
207 | entry->id.bus = bus; | 212 | entry->id.bus = bus; |
208 | entry->id.device = (prt->address >> 16) & 0xFFFF; | 213 | entry->id.device = (prt->address >> 16) & 0xFFFF; |
209 | entry->pin = prt->pin; | 214 | entry->pin = prt->pin + 1; |
210 | 215 | ||
211 | do_prt_fixups(entry, prt); | 216 | do_prt_fixups(entry, prt); |
212 | 217 | ||
@@ -425,7 +430,7 @@ acpi_pci_irq_derive(struct pci_dev *dev, | |||
425 | * PCI interrupt routing entry (eg. yenta bridge and add-in card bridge). | 430 | * PCI interrupt routing entry (eg. yenta bridge and add-in card bridge). |
426 | */ | 431 | */ |
427 | while (irq < 0 && bridge->bus->self) { | 432 | while (irq < 0 && bridge->bus->self) { |
428 | pin = (pin + PCI_SLOT(bridge->devfn)) % 4; | 433 | pin = (((pin - 1) + PCI_SLOT(bridge->devfn)) % 4) + 1; |
429 | bridge = bridge->bus->self; | 434 | bridge = bridge->bus->self; |
430 | 435 | ||
431 | if ((bridge->class >> 8) == PCI_CLASS_BRIDGE_CARDBUS) { | 436 | if ((bridge->class >> 8) == PCI_CLASS_BRIDGE_CARDBUS) { |
@@ -437,8 +442,6 @@ acpi_pci_irq_derive(struct pci_dev *dev, | |||
437 | pci_name(bridge))); | 442 | pci_name(bridge))); |
438 | return -1; | 443 | return -1; |
439 | } | 444 | } |
440 | /* Pin is from 0 to 3 */ | ||
441 | bridge_pin--; | ||
442 | pin = bridge_pin; | 445 | pin = bridge_pin; |
443 | } | 446 | } |
444 | 447 | ||
@@ -483,7 +486,6 @@ int acpi_pci_irq_enable(struct pci_dev *dev) | |||
483 | pci_name(dev))); | 486 | pci_name(dev))); |
484 | return 0; | 487 | return 0; |
485 | } | 488 | } |
486 | pin--; | ||
487 | 489 | ||
488 | /* | 490 | /* |
489 | * First we check the PCI IRQ routing table (PRT) for an IRQ. PRT | 491 | * First we check the PCI IRQ routing table (PRT) for an IRQ. PRT |
@@ -566,7 +568,6 @@ void acpi_pci_irq_disable(struct pci_dev *dev) | |||
566 | pin = dev->pin; | 568 | pin = dev->pin; |
567 | if (!pin) | 569 | if (!pin) |
568 | return; | 570 | return; |
569 | pin--; | ||
570 | 571 | ||
571 | /* | 572 | /* |
572 | * First we check the PCI IRQ routing table (PRT) for an IRQ. | 573 | * First we check the PCI IRQ routing table (PRT) for an IRQ. |