From: Rafał Miłecki Date: Thu, 19 May 2011 12:08:22 +0000 (+0200) Subject: bcma: pci: implement interrupts control X-Git-Tag: v3.12-rc1~4755^2~12^2~42^2~561 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1de520f4767cb836828d074db533f93d0ca85998;p=kernel%2Fkernel-generic.git bcma: pci: implement interrupts control Signed-off-by: Rafał Miłecki Signed-off-by: John W. Linville --- diff --git a/drivers/bcma/driver_pci.c b/drivers/bcma/driver_pci.c index e757e4e..789d68b 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; +}