]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: rtw88: Allow rtw_chip_info.ltecoex_addr to be NULL
authorBitterblue Smith <rtl8821cerfe2@gmail.com>
Wed, 23 Oct 2024 14:09:04 +0000 (17:09 +0300)
committerPing-Ke Shih <pkshih@realtek.com>
Tue, 29 Oct 2024 03:57:12 +0000 (11:57 +0800)
RTL8821A doesn't have this. Trying to use it results in error messages,
so don't try if ltecoex_addr is NULL.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/d1004817-1760-41d1-9136-3d799757c444@gmail.com
drivers/net/wireless/realtek/rtw88/coex.c

index a99776af56c27fe381058ec9f12bf50e52b30724..13096fa7025cae21cc6a4e55eec815a92f2823fd 100644 (file)
@@ -950,12 +950,18 @@ static void rtw_coex_coex_ctrl_owner(struct rtw_dev *rtwdev, bool wifi_control)
 
 static void rtw_coex_set_gnt_bt(struct rtw_dev *rtwdev, u8 state)
 {
+       if (!rtwdev->chip->ltecoex_addr)
+               return;
+
        rtw_coex_write_indirect_reg(rtwdev, LTE_COEX_CTRL, 0xc000, state);
        rtw_coex_write_indirect_reg(rtwdev, LTE_COEX_CTRL, 0x0c00, state);
 }
 
 static void rtw_coex_set_gnt_wl(struct rtw_dev *rtwdev, u8 state)
 {
+       if (!rtwdev->chip->ltecoex_addr)
+               return;
+
        rtw_coex_write_indirect_reg(rtwdev, LTE_COEX_CTRL, 0x3000, state);
        rtw_coex_write_indirect_reg(rtwdev, LTE_COEX_CTRL, 0x0300, state);
 }
@@ -3904,7 +3910,7 @@ void rtw_coex_display_coex_info(struct rtw_dev *rtwdev, struct seq_file *m)
        u8 sys_lte;
        u16 score_board_WB, score_board_BW;
        u32 wl_reg_6c0, wl_reg_6c4, wl_reg_6c8, wl_reg_778, wl_reg_6cc;
-       u32 lte_coex, bt_coex;
+       u32 lte_coex = 0, bt_coex = 0;
        int i;
 
        score_board_BW = rtw_coex_read_scbd(rtwdev);
@@ -3916,8 +3922,10 @@ void rtw_coex_display_coex_info(struct rtw_dev *rtwdev, struct seq_file *m)
        wl_reg_778 = rtw_read8(rtwdev, REG_BT_STAT_CTRL);
 
        sys_lte = rtw_read8(rtwdev, 0x73);
-       lte_coex = rtw_coex_read_indirect_reg(rtwdev, 0x38);
-       bt_coex = rtw_coex_read_indirect_reg(rtwdev, 0x54);
+       if (rtwdev->chip->ltecoex_addr) {
+               lte_coex = rtw_coex_read_indirect_reg(rtwdev, 0x38);
+               bt_coex = rtw_coex_read_indirect_reg(rtwdev, 0x54);
+       }
 
        if (!coex_stat->wl_under_ips &&
            (!coex_stat->wl_under_lps || coex_stat->wl_force_lps_ctrl) &&