diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2011-05-19 08:08:22 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-06-01 15:11:01 -0400 |
commit | 1de520f4767cb836828d074db533f93d0ca85998 (patch) | |
tree | 50a36249cd4bca3e46e4d1c991b66226716f6c89 /drivers/bcma | |
parent | 33e6ef4e82f1de4f9a98a86633412390a322e2e8 (diff) |
bcma: pci: implement interrupts control
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/bcma')
-rw-r--r-- | drivers/bcma/driver_pci.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/bcma/driver_pci.c b/drivers/bcma/driver_pci.c index e757e4e3c7e2..789d68b4858b 100644 --- a/drivers/bcma/driver_pci.c +++ b/drivers/bcma/driver_pci.c | |||
@@ -161,3 +161,26 @@ void bcma_core_pci_init(struct bcma_drv_pci *pc) | |||
161 | { | 161 | { |
162 | bcma_pcicore_serdes_workaround(pc); | 162 | bcma_pcicore_serdes_workaround(pc); |
163 | } | 163 | } |
164 | |||
165 | int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core, | ||
166 | bool enable) | ||
167 | { | ||
168 | struct pci_dev *pdev = pc->core->bus->host_pci; | ||
169 | u32 coremask, tmp; | ||
170 | int err; | ||
171 | |||
172 | err = pci_read_config_dword(pdev, BCMA_PCI_IRQMASK, &tmp); | ||
173 | if (err) | ||
174 | goto out; | ||
175 | |||
176 | coremask = BIT(core->core_index) << 8; | ||
177 | if (enable) | ||
178 | tmp |= coremask; | ||
179 | else | ||
180 | tmp &= ~coremask; | ||
181 | |||
182 | err = pci_write_config_dword(pdev, BCMA_PCI_IRQMASK, tmp); | ||
183 | |||
184 | out: | ||
185 | return err; | ||
186 | } | ||