summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mediatek/mt76/mt7615/mmio.c
diff options
context:
space:
mode:
authorLorenzo Bianconi <lorenzo@kernel.org>2020-03-17 17:41:22 +0100
committerFelix Fietkau <nbd@nbd.name>2020-03-17 17:47:56 +0100
commitf82282efc06c7c2490da7d1c474b31b98534d883 (patch)
tree1fba590256ed15eae708db249349160c60f61106 /drivers/net/wireless/mediatek/mt76/mt7615/mmio.c
parent94f83b66cd55e7248aa4e4afe0f177cc9702c4f5 (diff)
mt76: mt7615: add mt7663e support to mt7615_reg_map
Introduce mt7663e support to mt7615_reg_map routine in order to reuse it adding support for mt7663e driver Co-developed-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Co-developed-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt7615/mmio.c')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7615/mmio.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mmio.c b/drivers/net/wireless/mediatek/mt76/mt7615/mmio.c
index fb4a76270ad4..43c8b29020f5 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mmio.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mmio.c
@@ -30,9 +30,15 @@ const u32 mt7615e_reg_map[] = {
u32 mt7615_reg_map(struct mt7615_dev *dev, u32 addr)
{
- u32 base = addr & MT_MCU_PCIE_REMAP_2_BASE;
- u32 offset = addr & MT_MCU_PCIE_REMAP_2_OFFSET;
-
+ u32 base, offset;
+
+ if (is_mt7663(&dev->mt76)) {
+ base = addr & MT7663_MCU_PCIE_REMAP_2_BASE;
+ offset = addr & MT7663_MCU_PCIE_REMAP_2_OFFSET;
+ } else {
+ base = addr & MT_MCU_PCIE_REMAP_2_BASE;
+ offset = addr & MT_MCU_PCIE_REMAP_2_OFFSET;
+ }
mt76_wr(dev, MT_MCU_PCIE_REMAP_2, base);
return MT_PCIE_REMAP_BASE_2 + offset;