diff options
-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. |