]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
PCI hotplug: cpqphp: use config space PCI interrupt pin encoding
authorBjorn Helgaas <bjorn.helgaas@hp.com>
Tue, 9 Dec 2008 23:11:41 +0000 (16:11 -0700)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Wed, 7 Jan 2009 19:12:47 +0000 (11:12 -0800)
This patch changes cpqphp to use interrupt pin values just as they
come from PCI config space, i.e., 1=INTA, ..., 4=INTD.

pcibios_set_irq_routing() takes pin arguments in the range 0=INTA, ...,
3=INTD, so we'll adjust the pin just before calling it.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/hotplug/cpqphp_ctrl.c
drivers/pci/hotplug/cpqphp_pci.c

index a60a25290995e5f2c267f6a2f4da65e9122d858a..d94722149e02d7ef1481b95957803292518fa949 100644 (file)
@@ -2604,7 +2604,7 @@ static int configure_new_function(struct controller *ctrl, struct pci_func *func
                        for (cloop = 0; cloop < 4; cloop++) {
                                if (irqs.valid_INT & (0x01 << cloop)) {
                                        rc = cpqhp_set_irq(func->bus, func->device,
-                                                          0x0A + cloop, irqs.interrupt[cloop]);
+                                                          cloop + 1, irqs.interrupt[cloop]);
                                        if (rc)
                                                goto free_and_out;
                                }
@@ -2945,7 +2945,7 @@ static int configure_new_function(struct controller *ctrl, struct pci_func *func
                }
 
                if (!behind_bridge) {
-                       rc = cpqhp_set_irq(func->bus, func->device, temp_byte + 0x09, IRQ);
+                       rc = cpqhp_set_irq(func->bus, func->device, temp_byte, IRQ);
                        if (rc)
                                return 1;
                } else {
index df146be9d2e9f33cb6c6c8eff1d72b8de5e86bc3..6c0ed0fcb8eef91d290e05c8d3907cbeed4e295a 100644 (file)
@@ -171,7 +171,7 @@ int cpqhp_set_irq (u8 bus_num, u8 dev_num, u8 int_pin, u8 irq_num)
                fakebus->number = bus_num;
                dbg("%s: dev %d, bus %d, pin %d, num %d\n",
                    __func__, dev_num, bus_num, int_pin, irq_num);
-               rc = pcibios_set_irq_routing(fakedev, int_pin - 0x0a, irq_num);
+               rc = pcibios_set_irq_routing(fakedev, int_pin - 1, irq_num);
                kfree(fakedev);
                kfree(fakebus);
                dbg("%s: rc %d\n", __func__, rc);