diff options
author | Lorenzo Bianconi <lorenzo.bianconi@redhat.com> | 2018-09-28 14:38:47 +0300 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2018-10-01 13:34:21 +0300 |
commit | 957068c23fe49ed564f62c64b86687a66dbdae05 (patch) | |
tree | a4535a164719e81d53c3b0b1c14612de0bd279de /drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c | |
parent | 208856493e420c3daa9147d7cf39ea5ec774df2b (diff) | |
download | linux-957068c23fe49ed564f62c64b86687a66dbdae05.tar.xz |
mt76: move mt76x02_set_irq_mask in mt76x02_mmio.c
Move mt76x02_set_irq_mask, mt76x02_irq_enable and mt76x02_irq_disable
in mt76x02-lib module in order to be reused by mt76x0 driver.
Moreover move irq_lock and irqmask in mt76_mmio data structure
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c b/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c index f471c3a0674a..1b0dc6b0ecf3 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c @@ -21,6 +21,18 @@ #include "mt76x02_dma.h" #include "mt76x02_regs.h" +void mt76x02_set_irq_mask(struct mt76_dev *dev, u32 clear, u32 set) +{ + unsigned long flags; + + spin_lock_irqsave(&dev->mmio.irq_lock, flags); + dev->mmio.irqmask &= ~clear; + dev->mmio.irqmask |= set; + __mt76_wr(dev, MT_INT_MASK_CSR, dev->mmio.irqmask); + spin_unlock_irqrestore(&dev->mmio.irq_lock, flags); +} +EXPORT_SYMBOL_GPL(mt76x02_set_irq_mask); + void mt76x02_dma_enable(struct mt76_dev *dev) { u32 val; |