From 1de520f4767cb836828d074db533f93d0ca85998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Thu, 19 May 2011 14:08:22 +0200 Subject: bcma: pci: implement interrupts control MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Miłecki Signed-off-by: John W. Linville --- drivers/bcma/driver_pci.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/bcma/driver_pci.c b/drivers/bcma/driver_pci.c index e757e4e3c7e..789d68b4858 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) { bcma_pcicore_serdes_workaround(pc); } + +int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core, + bool enable) +{ + struct pci_dev *pdev = pc->core->bus->host_pci; + u32 coremask, tmp; + int err; + + err = pci_read_config_dword(pdev, BCMA_PCI_IRQMASK, &tmp); + if (err) + goto out; + + coremask = BIT(core->core_index) << 8; + if (enable) + tmp |= coremask; + else + tmp &= ~coremask; + + err = pci_write_config_dword(pdev, BCMA_PCI_IRQMASK, tmp); + +out: + return err; +} -- cgit v1.2.3