wifi: rtw89: coex: Force to update TDMA parameter when radio state change
authorChing-Te Ku <ku920601@realtek.com>
Tue, 17 Jan 2023 11:41:04 +0000 (19:41 +0800)
committerKalle Valo <kvalo@kernel.org>
Mon, 13 Feb 2023 17:04:16 +0000 (19:04 +0200)
Force firmware to update TDMA parameter when enter/exit power saving.
The TDMA instant feature will make firmware force update TDMA parameter
immediately when the TDMA parameter H2C to firmware. Without this feature,
it will have a low fail rate trigger Bluetooth audio sound glitch when
Wi-Fi is under power saving. Or Wi-Fi fail to turn in to power save state.

Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230117114109.4298-4-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/coex.c

index ee6b5fff4928b7a305f5f71520806c9e4e63f1e1..5d6d6230344b08d1168c2ce92b0c3d218a608166 100644 (file)
@@ -3818,6 +3818,7 @@ static void _action_common(struct rtw89_dev *rtwdev)
                wl->scbd_change = false;
                btc->cx.cnt_wl[BTC_WCNT_SCBDUPDATE]++;
        }
+       btc->dm.tdma_instant_excute = 0;
 }
 
 static void _action_by_bt(struct rtw89_dev *rtwdev)
@@ -5347,6 +5348,11 @@ void rtw89_btc_ntfy_radio_state(struct rtw89_dev *rtwdev, enum btc_rfctrl rf_sta
        }
 
        btc->dm.cnt_dm[BTC_DCNT_BTCNT_FREEZE] = 0;
+       if (wl->status.map.lps_pre == BTC_LPS_OFF &&
+           wl->status.map.lps_pre != wl->status.map.lps)
+               btc->dm.tdma_instant_excute = 1;
+       else
+               btc->dm.tdma_instant_excute = 0;
 
        _run_coex(rtwdev, BTC_RSN_NTFY_RADIO_STATE);