aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bcma
diff options
context:
space:
mode:
authorNathan Hintz <nlhintz@hotmail.com>2013-01-10 11:54:09 -0500
committerJohn W. Linville <linville@tuxdriver.com>2013-01-11 14:49:59 -0500
commite2aa19fadd718d7dd920a3994118863861a4b61e (patch)
treedcef21d36c4ed2ab7cb02ecf9ca7585ebc3993ed /drivers/bcma
parent1a2d50329832c4b5c77be569f20eec303a0d07b8 (diff)
bcma: return the mips irq number in bcma_core_irq
The irq signal numbers that are send by the cpu are increased by 2 from the number programmed into the mips core by bcma. Return the irq number on which the irqs are send in bcma_core_irq() now. Signed-off-by: Nathan Hintz <nlhintz@hotmail.com> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/bcma')
-rw-r--r--drivers/bcma/driver_chipcommon.c2
-rw-r--r--drivers/bcma/driver_mips.c12
-rw-r--r--drivers/bcma/driver_pci_host.c4
3 files changed, 12 insertions, 6 deletions
diff --git a/drivers/bcma/driver_chipcommon.c b/drivers/bcma/driver_chipcommon.c
index e461ad25fda4..28fa50ad87be 100644
--- a/drivers/bcma/driver_chipcommon.c
+++ b/drivers/bcma/driver_chipcommon.c
@@ -329,7 +329,7 @@ void bcma_chipco_serial_init(struct bcma_drv_cc *cc)
329 return; 329 return;
330 } 330 }
331 331
332 irq = bcma_core_mips_irq(cc->core); 332 irq = bcma_core_irq(cc->core);
333 333
334 /* Determine the registers of the UARTs */ 334 /* Determine the registers of the UARTs */
335 cc->nr_serial_ports = (cc->capabilities & BCMA_CC_CAP_NRUART); 335 cc->nr_serial_ports = (cc->capabilities & BCMA_CC_CAP_NRUART);
diff --git a/drivers/bcma/driver_mips.c b/drivers/bcma/driver_mips.c
index 90f20a247725..a808404db4b1 100644
--- a/drivers/bcma/driver_mips.c
+++ b/drivers/bcma/driver_mips.c
@@ -85,7 +85,7 @@ static u32 bcma_core_mips_irqflag(struct bcma_device *dev)
85 * If disabled, 5 is returned. 85 * If disabled, 5 is returned.
86 * If not supported, 6 is returned. 86 * If not supported, 6 is returned.
87 */ 87 */
88unsigned int bcma_core_mips_irq(struct bcma_device *dev) 88static unsigned int bcma_core_mips_irq(struct bcma_device *dev)
89{ 89{
90 struct bcma_device *mdev = dev->bus->drv_mips.core; 90 struct bcma_device *mdev = dev->bus->drv_mips.core;
91 u32 irqflag; 91 u32 irqflag;
@@ -102,7 +102,13 @@ unsigned int bcma_core_mips_irq(struct bcma_device *dev)
102 102
103 return 5; 103 return 5;
104} 104}
105EXPORT_SYMBOL(bcma_core_mips_irq); 105
106unsigned int bcma_core_irq(struct bcma_device *dev)
107{
108 unsigned int mips_irq = bcma_core_mips_irq(dev);
109 return mips_irq <= 4 ? mips_irq + 2 : 0;
110}
111EXPORT_SYMBOL(bcma_core_irq);
106 112
107static void bcma_core_mips_set_irq(struct bcma_device *dev, unsigned int irq) 113static void bcma_core_mips_set_irq(struct bcma_device *dev, unsigned int irq)
108{ 114{
@@ -299,7 +305,7 @@ void bcma_core_mips_init(struct bcma_drv_mips *mcore)
299 break; 305 break;
300 default: 306 default:
301 list_for_each_entry(core, &bus->cores, list) { 307 list_for_each_entry(core, &bus->cores, list) {
302 core->irq = bcma_core_mips_irq(core) + 2; 308 core->irq = bcma_core_irq(core);
303 } 309 }
304 bcma_err(bus, 310 bcma_err(bus,
305 "Unknown device (0x%x) found, can not configure IRQs\n", 311 "Unknown device (0x%x) found, can not configure IRQs\n",
diff --git a/drivers/bcma/driver_pci_host.c b/drivers/bcma/driver_pci_host.c
index e6b5c89469dc..ef9f0938da77 100644
--- a/drivers/bcma/driver_pci_host.c
+++ b/drivers/bcma/driver_pci_host.c
@@ -577,7 +577,7 @@ int bcma_core_pci_plat_dev_init(struct pci_dev *dev)
577 pr_info("PCI: Fixing up device %s\n", pci_name(dev)); 577 pr_info("PCI: Fixing up device %s\n", pci_name(dev));
578 578
579 /* Fix up interrupt lines */ 579 /* Fix up interrupt lines */
580 dev->irq = bcma_core_mips_irq(pc_host->pdev->core) + 2; 580 dev->irq = bcma_core_irq(pc_host->pdev->core);
581 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq); 581 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
582 582
583 return 0; 583 return 0;
@@ -596,6 +596,6 @@ int bcma_core_pci_pcibios_map_irq(const struct pci_dev *dev)
596 596
597 pc_host = container_of(dev->bus->ops, struct bcma_drv_pci_host, 597 pc_host = container_of(dev->bus->ops, struct bcma_drv_pci_host,
598 pci_ops); 598 pci_ops);
599 return bcma_core_mips_irq(pc_host->pdev->core) + 2; 599 return bcma_core_irq(pc_host->pdev->core);
600} 600}
601EXPORT_SYMBOL(bcma_core_pci_pcibios_map_irq); 601EXPORT_SYMBOL(bcma_core_pci_pcibios_map_irq);