summaryrefslogtreecommitdiff
path: root/drivers/bcma/main.c
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2014-11-01 18:54:55 +0300
committerJohn W. Linville <linville@tuxdriver.com>2014-11-12 00:31:11 +0300
commit85eb92e81801d64686eb78928d500a4c83ee9623 (patch)
treeaab5da45bc8861ab3882658922a0aa974f39e0f8 /drivers/bcma/main.c
parent6164c202289f4718acf00c0dbe5f130b07330ab2 (diff)
downloadlinux-85eb92e81801d64686eb78928d500a4c83ee9623.tar.xz
bcma: make it possible to specify a IRQ num in bcma_core_irq()
This moves bcma_core_irq() to main.c and add a extra parameter with a number so that we can return different irq number for devices with more than one. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/bcma/main.c')
-rw-r--r--drivers/bcma/main.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index 9b229c9c35e5..6d1cf5701452 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -169,6 +169,28 @@ static void bcma_of_fill_device(struct platform_device *parent,
}
#endif /* CONFIG_OF */
+unsigned int bcma_core_irq(struct bcma_device *core, int num)
+{
+ struct bcma_bus *bus = core->bus;
+ unsigned int mips_irq;
+
+ switch (bus->hosttype) {
+ case BCMA_HOSTTYPE_PCI:
+ return bus->host_pci->irq;
+ case BCMA_HOSTTYPE_SOC:
+ if (bus->drv_mips.core && num == 0) {
+ mips_irq = bcma_core_mips_irq(core);
+ return mips_irq <= 4 ? mips_irq + 2 : 0;
+ }
+ break;
+ case BCMA_HOSTTYPE_SDIO:
+ return 0;
+ }
+
+ return 0;
+}
+EXPORT_SYMBOL(bcma_core_irq);
+
void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core)
{
core->dev.release = bcma_release_core_dev;