diff options
author | David S. Miller <davem@davemloft.net> | 2012-02-21 17:47:33 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-02-21 17:47:33 -0500 |
commit | 4b0d1a0b1fd7248d0fc341d00ed908c7373c7788 (patch) | |
tree | 7ba1dad63482c9a3d4461ec324aef9f909e73f49 /arch/mips | |
parent | 8de65c2aaa1faf8e57e1b29b4265b6a57fae4136 (diff) | |
parent | a9802d43f205faa2fff422502a1336a50b9615c3 (diff) |
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/pci/pci-bcm47xx.c | 49 |
1 files changed, 44 insertions, 5 deletions
diff --git a/arch/mips/pci/pci-bcm47xx.c b/arch/mips/pci/pci-bcm47xx.c index 400535a955d0..c682468010c5 100644 --- a/arch/mips/pci/pci-bcm47xx.c +++ b/arch/mips/pci/pci-bcm47xx.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/types.h> | 25 | #include <linux/types.h> |
26 | #include <linux/pci.h> | 26 | #include <linux/pci.h> |
27 | #include <linux/ssb/ssb.h> | 27 | #include <linux/ssb/ssb.h> |
28 | #include <linux/bcma/bcma.h> | ||
28 | #include <bcm47xx.h> | 29 | #include <bcm47xx.h> |
29 | 30 | ||
30 | int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) | 31 | int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) |
@@ -32,15 +33,12 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) | |||
32 | return 0; | 33 | return 0; |
33 | } | 34 | } |
34 | 35 | ||
35 | int pcibios_plat_dev_init(struct pci_dev *dev) | ||
36 | { | ||
37 | #ifdef CONFIG_BCM47XX_SSB | 36 | #ifdef CONFIG_BCM47XX_SSB |
37 | static int bcm47xx_pcibios_plat_dev_init_ssb(struct pci_dev *dev) | ||
38 | { | ||
38 | int res; | 39 | int res; |
39 | u8 slot, pin; | 40 | u8 slot, pin; |
40 | 41 | ||
41 | if (bcm47xx_bus_type != BCM47XX_BUS_TYPE_SSB) | ||
42 | return 0; | ||
43 | |||
44 | res = ssb_pcibios_plat_dev_init(dev); | 42 | res = ssb_pcibios_plat_dev_init(dev); |
45 | if (res < 0) { | 43 | if (res < 0) { |
46 | printk(KERN_ALERT "PCI: Failed to init device %s\n", | 44 | printk(KERN_ALERT "PCI: Failed to init device %s\n", |
@@ -60,6 +58,47 @@ int pcibios_plat_dev_init(struct pci_dev *dev) | |||
60 | } | 58 | } |
61 | 59 | ||
62 | dev->irq = res; | 60 | dev->irq = res; |
61 | return 0; | ||
62 | } | ||
63 | #endif | 63 | #endif |
64 | |||
65 | #ifdef CONFIG_BCM47XX_BCMA | ||
66 | static int bcm47xx_pcibios_plat_dev_init_bcma(struct pci_dev *dev) | ||
67 | { | ||
68 | int res; | ||
69 | |||
70 | res = bcma_core_pci_plat_dev_init(dev); | ||
71 | if (res < 0) { | ||
72 | printk(KERN_ALERT "PCI: Failed to init device %s\n", | ||
73 | pci_name(dev)); | ||
74 | return res; | ||
75 | } | ||
76 | |||
77 | res = bcma_core_pci_pcibios_map_irq(dev); | ||
78 | |||
79 | /* IRQ-0 and IRQ-1 are software interrupts. */ | ||
80 | if (res < 2) { | ||
81 | printk(KERN_ALERT "PCI: Failed to map IRQ of device %s\n", | ||
82 | pci_name(dev)); | ||
83 | return res; | ||
84 | } | ||
85 | |||
86 | dev->irq = res; | ||
64 | return 0; | 87 | return 0; |
65 | } | 88 | } |
89 | #endif | ||
90 | |||
91 | int pcibios_plat_dev_init(struct pci_dev *dev) | ||
92 | { | ||
93 | #ifdef CONFIG_BCM47XX_SSB | ||
94 | if (bcm47xx_bus_type == BCM47XX_BUS_TYPE_SSB) | ||
95 | return bcm47xx_pcibios_plat_dev_init_ssb(dev); | ||
96 | else | ||
97 | #endif | ||
98 | #ifdef CONFIG_BCM47XX_BCMA | ||
99 | if (bcm47xx_bus_type == BCM47XX_BUS_TYPE_BCMA) | ||
100 | return bcm47xx_pcibios_plat_dev_init_bcma(dev); | ||
101 | else | ||
102 | #endif | ||
103 | return 0; | ||
104 | } | ||