wifi: rtw89: mac: reset PHY-1 hardware when going to enable/disable
authorPing-Ke Shih <pkshih@realtek.com>
Fri, 9 Feb 2024 06:52:23 +0000 (14:52 +0800)
committerKalle Valo <kvalo@kernel.org>
Mon, 12 Feb 2024 15:39:13 +0000 (17:39 +0200)
When going to use PHY-1, reset the hardware to make it work properly.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240209065229.34515-6-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/mac_be.c

index fdbfb76..f3c8275 100644 (file)
@@ -1546,6 +1546,13 @@ static int preload_init_be(struct rtw89_dev *rtwdev, u8 mac_idx,
 
 static int dbcc_bb_ctrl_be(struct rtw89_dev *rtwdev, bool bb1_en)
 {
+       u32 set = B_BE_FEN_BB1PLAT_RSTB | B_BE_FEN_BB1_IP_RSTN;
+
+       if (bb1_en)
+               rtw89_write32_set(rtwdev, R_BE_FEN_RST_ENABLE, set);
+       else
+               rtw89_write32_clr(rtwdev, R_BE_FEN_RST_ENABLE, set);
+
        return 0;
 }