summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76/mt7915/pci.c
diff options
context:
space:
mode:
authorRyder Lee <ryder.lee@mediatek.com>2021-04-09 00:36:31 +0800
committerFelix Fietkau <nbd@nbd.name>2021-04-12 23:07:24 +0200
commit6d88629e158dc1a3f58a0f9b528fe0057d44e8f6 (patch)
tree8edfc3784fa666a35374774050143c7f5644968e /drivers/net/wireless/mediatek/mt76/mt7915/pci.c
parent0fda6d7bb5a29b241fba8d37b92567c6bec79655 (diff)
downloadlinux-6d88629e158dc1a3f58a0f9b528fe0057d44e8f6.tar.bz2
mt76: mt7915: add mmio.c
Add mmio.c in order to use mt76_bus_ops throughout the driver. It will be also shared with the future APSoC revision. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt7915/pci.c')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7915/pci.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/pci.c b/drivers/net/wireless/mediatek/mt76/mt7915/pci.c
index 13880cc9c9e8..75769595d1e1 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/pci.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/pci.c
@@ -201,7 +201,7 @@ static void mt7915_pci_init_hif2(struct mt7915_dev *dev)
}
/* master switch of PCIe tnterrupt enable */
- mt7915_l1_wr(dev, MT_PCIE1_MAC_INT_ENABLE, 0xff);
+ mt76_wr(dev, MT_PCIE1_MAC_INT_ENABLE, 0xff);
}
static int mt7915_pci_hif2_probe(struct pci_dev *pdev)
@@ -274,15 +274,12 @@ static int mt7915_pci_probe(struct pci_dev *pdev,
if (ret)
goto error;
- mt76_mmio_init(&dev->mt76, pcim_iomap_table(pdev)[0]);
- mdev->rev = (mt7915_l1_rr(dev, MT_HW_CHIPID) << 16) |
- (mt7915_l1_rr(dev, MT_HW_REV) & 0xff);
- dev_dbg(mdev->dev, "ASIC revision: %04x\n", mdev->rev);
-
- mt76_wr(dev, MT_INT_MASK_CSR, 0);
+ ret = mt7915_mmio_init(mdev, pcim_iomap_table(pdev)[0], pdev->irq);
+ if (ret)
+ goto error;
/* master switch of PCIe tnterrupt enable */
- mt7915_l1_wr(dev, MT_PCIE_MAC_INT_ENABLE, 0xff);
+ mt76_wr(dev, MT_PCIE_MAC_INT_ENABLE, 0xff);
ret = devm_request_irq(mdev->dev, pdev->irq, mt7915_irq_handler,
IRQF_SHARED, KBUILD_MODNAME, dev);