diff options
author | Rod Whitby <rod@whitby.id.au> | 2005-11-11 02:52:43 +0000 |
---|---|---|
committer | OpenEmbedded Project <openembedded-devel@lists.openembedded.org> | 2005-11-11 02:52:43 +0000 |
commit | 6059496f64b860b42e3ea2f99eeaa9a23920a4c2 (patch) | |
tree | b64e1322b0b773e66880726437ab82a32acf845d /packages/linux/nas100d-kernel/2.6.14/nas100d-pci.c | |
parent | dbd1a76089b2b95b9c57fff7dd7d22c67a93a4e3 (diff) |
nas100d-kernel: updated arch patches and files courtesy of azummo
Diffstat (limited to 'packages/linux/nas100d-kernel/2.6.14/nas100d-pci.c')
-rw-r--r-- | packages/linux/nas100d-kernel/2.6.14/nas100d-pci.c | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/packages/linux/nas100d-kernel/2.6.14/nas100d-pci.c b/packages/linux/nas100d-kernel/2.6.14/nas100d-pci.c index 7a319179c3..8a8e472ed5 100644 --- a/packages/linux/nas100d-kernel/2.6.14/nas100d-pci.c +++ b/packages/linux/nas100d-kernel/2.6.14/nas100d-pci.c @@ -27,34 +27,44 @@ void __init nas100d_pci_preinit(void) set_irq_type(IRQ_NAS100D_PCI_INTA, IRQT_LOW); set_irq_type(IRQ_NAS100D_PCI_INTB, IRQT_LOW); set_irq_type(IRQ_NAS100D_PCI_INTC, IRQT_LOW); + set_irq_type(IRQ_NAS100D_PCI_INTD, IRQT_LOW); + set_irq_type(IRQ_NAS100D_PCI_INTE, IRQT_LOW); gpio_line_isr_clear(NAS100D_PCI_INTA_PIN); gpio_line_isr_clear(NAS100D_PCI_INTB_PIN); gpio_line_isr_clear(NAS100D_PCI_INTC_PIN); - - /* INTD is not configured as GPIO is used - * for the power input button. - */ + gpio_line_isr_clear(NAS100D_PCI_INTD_PIN); + gpio_line_isr_clear(NAS100D_PCI_INTE_PIN); ixp4xx_pci_preinit(); } static int __init nas100d_map_irq(struct pci_dev *dev, u8 slot, u8 pin) { - static int pci_irq_table[NAS100D_PCI_IRQ_LINES] = { - IRQ_NAS100D_PCI_INTA, - IRQ_NAS100D_PCI_INTB, - IRQ_NAS100D_PCI_INTC, - }; - - int irq = -1; + if (slot < 1 || slot > 3 || pin < 1 || pin > 3) + return -1; - if (slot >= 1 && slot <= NAS100D_PCI_MAX_DEV && - pin >= 1 && pin <= NAS100D_PCI_IRQ_LINES) { - irq = pci_irq_table[(slot + pin - 2) % NAS100D_PCI_IRQ_LINES]; + switch (slot) + { + case 1: + if (pin == 1) + return IRQ_NAS100D_PCI_INTA; + break; + case 2: + if (pin == 1) + return IRQ_NAS100D_PCI_INTB; + break; + case 3: + if (pin == 1) + return IRQ_NAS100D_PCI_INTB; + if (pin == 2) + return IRQ_NAS100D_PCI_INTC; + if (pin == 3) + return IRQ_NAS100D_PCI_INTD; + break; } - return irq; + return -1; } struct hw_pci __initdata nas100d_pci = { @@ -66,7 +76,7 @@ struct hw_pci __initdata nas100d_pci = { .map_irq = nas100d_map_irq, }; -int __init nas100d_pci_init(void) /* monkey see, monkey do */ +int __init nas100d_pci_init(void) { if (machine_is_nas100d()) pci_common_init(&nas100d_pci); |