diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2019-02-28 19:54:31 +0300 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2019-05-01 14:03:55 +0300 |
commit | 9220f695c17b8b82ee97a38b5f11f85abdfde1e6 (patch) | |
tree | d62c1596808ac76fdc0a74003d2172ffc7172b92 /drivers/net/wireless/mediatek/mt76/mmio.c | |
parent | e3037485c68ec1a299ff41160d8fedbd4abc29b9 (diff) | |
download | linux-9220f695c17b8b82ee97a38b5f11f85abdfde1e6.tar.xz |
mt76: mmio: move mt76x02_set_irq_mask in mt76 module
Move mt76x02_set_irq_mask in mt76 module in order to be reused
adding support for mt7603 driver and remove duplicated code
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mmio.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mmio.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mmio.c b/drivers/net/wireless/mediatek/mt76/mmio.c index 1d6bbce76041..059f13bf9dff 100644 --- a/drivers/net/wireless/mediatek/mt76/mmio.c +++ b/drivers/net/wireless/mediatek/mt76/mmio.c @@ -70,6 +70,19 @@ static int mt76_mmio_rd_rp(struct mt76_dev *dev, u32 base, return 0; } +void mt76_set_irq_mask(struct mt76_dev *dev, u32 addr, + u32 clear, u32 set) +{ + unsigned long flags; + + spin_lock_irqsave(&dev->mmio.irq_lock, flags); + dev->mmio.irqmask &= ~clear; + dev->mmio.irqmask |= set; + mt76_mmio_wr(dev, addr, dev->mmio.irqmask); + spin_unlock_irqrestore(&dev->mmio.irq_lock, flags); +} +EXPORT_SYMBOL_GPL(mt76_set_irq_mask); + void mt76_mmio_init(struct mt76_dev *dev, void __iomem *regs) { static const struct mt76_bus_ops mt76_mmio_ops = { |