Search Linux Wireless

[PATCH] mt76x0: init: intrduce MT_H2M_* definitions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add MT_H2M_BBP_AGENT, MT_H2M_MAILBOX_CSR and MT_H2M_INT_SRC and
remove magic numbers

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@xxxxxxxxxx>
---
 drivers/net/wireless/mediatek/mt76/mt76x0/init.c  | 8 ++++----
 drivers/net/wireless/mediatek/mt76/mt76x02_regs.h | 3 +++
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/init.c b/drivers/net/wireless/mediatek/mt76/mt76x0/init.c
index edfd5d94d197..4b8314844d36 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x0/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x0/init.c
@@ -174,10 +174,10 @@ static void mt76x0_init_mac_registers(struct mt76x0_dev *dev)
 	mt76_wr(dev, MT_WMM_CTRL, reg);
 
 	/* TODO: Probably not needed */
-	mt76_wr(dev, 0x7028, 0);
-	mt76_wr(dev, 0x7010, 0);
-	mt76_wr(dev, 0x7024, 0);
-	msleep(10);
+	mt76_wr(dev, MT_H2M_BBP_AGENT, 0);
+	mt76_wr(dev, MT_H2M_MAILBOX_CSR, 0);
+	mt76_wr(dev, MT_H2M_INT_SRC, 0);
+	usleep_range(10000, 20000);
 }
 
 static int mt76x0_init_wcid_mem(struct mt76x0_dev *dev)
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_regs.h b/drivers/net/wireless/mediatek/mt76/mt76x02_regs.h
index f8003ee03a89..217bb0ac12fd 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_regs.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_regs.h
@@ -622,8 +622,11 @@
 
 #define MT_SRAM_BASE			0x4000
 
+#define MT_H2M_MAILBOX_CSR		0x7010
 #define MT_H2M_MAILBOX_CID		0x7014
 #define MT_H2M_MAILBOX_STATUS		0x701c
+#define MT_H2M_INT_SRC			0x7024
+#define MT_H2M_BBP_AGENT		0x7028
 
 #define MT_WCID_KEY_BASE		0x8000
 #define MT_WCID_KEY(_n)			(MT_WCID_KEY_BASE + (_n) * 32)
-- 
2.19.0




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux