wifi: rtw89: coex: move chip_ops::btc_bt_aci_imp to a generic code
authorChing-Te Ku <ku920601@realtek.com>
Wed, 5 Oct 2022 08:32:07 +0000 (16:32 +0800)
committerKalle Valo <kvalo@kernel.org>
Tue, 11 Oct 2022 16:45:19 +0000 (19:45 +0300)
This chunk is to set fixed BT LNA2 at level5 when WiFi/BT shared BTG RFC
to improve BT anti-interference ability from adjacent channel. Since all
chips use the same setting, remove chip_ops::btc_bt_aci_imp.

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/20221005083212.45683-2-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/coex.c
drivers/net/wireless/realtek/rtw89/core.h
drivers/net/wireless/realtek/rtw89/rtw8852a.c
drivers/net/wireless/realtek/rtw89/rtw8852c.c

index bbdfa9a..f21c733 100644 (file)
@@ -1809,13 +1809,18 @@ static void _set_rf_trx_para(struct rtw89_dev *rtwdev)
        struct rtw89_btc_dm *dm = &btc->dm;
        struct rtw89_btc_wl_info *wl = &btc->cx.wl;
        struct rtw89_btc_bt_info *bt = &btc->cx.bt;
+       struct rtw89_btc_bt_link_info *b = &bt->link_info;
        struct rtw89_btc_rf_trx_para para;
        u32 wl_stb_chg = 0;
        u8 level_id = 0;
 
        if (!dm->freerun) {
-               dm->trx_para_level = 0;
-               chip->ops->btc_bt_aci_imp(rtwdev);
+               /* fix LNA2 = level-5 for BT ACI issue at BTG */
+               if ((btc->dm.wl_btg_rx && b->profile_cnt.now != 0) ||
+                   dm->bt_only == 1)
+                       dm->trx_para_level = 1;
+               else
+                       dm->trx_para_level = 0;
        }
 
        level_id = (u8)dm->trx_para_level;
index 51af91b..b04e7a5 100644 (file)
@@ -2363,7 +2363,6 @@ struct rtw89_chip_ops {
        void (*btc_set_wl_pri)(struct rtw89_dev *rtwdev, u8 map, bool state);
        void (*btc_set_wl_txpwr_ctrl)(struct rtw89_dev *rtwdev, u32 txpwr_val);
        s8 (*btc_get_bt_rssi)(struct rtw89_dev *rtwdev, s8 val);
-       void (*btc_bt_aci_imp)(struct rtw89_dev *rtwdev);
        void (*btc_update_bt_cnt)(struct rtw89_dev *rtwdev);
        void (*btc_wl_s1_standby)(struct rtw89_dev *rtwdev, bool state);
        void (*btc_set_policy)(struct rtw89_dev *rtwdev, u16 policy_type);
index 5678683..b5aa869 100644 (file)
@@ -1871,19 +1871,6 @@ static struct rtw89_btc_fbtc_mreg rtw89_btc_8852a_mon_reg[] = {
 };
 
 static
-void rtw8852a_btc_bt_aci_imp(struct rtw89_dev *rtwdev)
-{
-       struct rtw89_btc *btc = &rtwdev->btc;
-       struct rtw89_btc_dm *dm = &btc->dm;
-       struct rtw89_btc_bt_info *bt = &btc->cx.bt;
-       struct rtw89_btc_bt_link_info *b = &bt->link_info;
-
-       /* fix LNA2 = level-5 for BT ACI issue at BTG */
-       if (btc->dm.wl_btg_rx && b->profile_cnt.now != 0)
-               dm->trx_para_level = 1;
-}
-
-static
 void rtw8852a_btc_update_bt_cnt(struct rtw89_dev *rtwdev)
 {
        struct rtw89_btc *btc = &rtwdev->btc;
@@ -2041,7 +2028,6 @@ static const struct rtw89_chip_ops rtw8852a_chip_ops = {
        .btc_set_wl_pri         = rtw8852a_btc_set_wl_pri,
        .btc_set_wl_txpwr_ctrl  = rtw8852a_btc_set_wl_txpwr_ctrl,
        .btc_get_bt_rssi        = rtw8852a_btc_get_bt_rssi,
-       .btc_bt_aci_imp         = rtw8852a_btc_bt_aci_imp,
        .btc_update_bt_cnt      = rtw8852a_btc_update_bt_cnt,
        .btc_wl_s1_standby      = rtw8852a_btc_wl_s1_standby,
        .btc_set_wl_rx_gain     = rtw8852a_btc_set_wl_rx_gain,
index a5bcd3f..00f564b 100644 (file)
@@ -2685,19 +2685,6 @@ static const struct rtw89_btc_fbtc_mreg rtw89_btc_8852c_mon_reg[] = {
 };
 
 static
-void rtw8852c_btc_bt_aci_imp(struct rtw89_dev *rtwdev)
-{
-       struct rtw89_btc *btc = &rtwdev->btc;
-       struct rtw89_btc_dm *dm = &btc->dm;
-       struct rtw89_btc_bt_info *bt = &btc->cx.bt;
-       struct rtw89_btc_bt_link_info *b = &bt->link_info;
-
-       /* fix LNA2 = level-5 for BT ACI issue at BTG */
-       if (btc->dm.wl_btg_rx && b->profile_cnt.now != 0)
-               dm->trx_para_level = 1;
-}
-
-static
 void rtw8852c_btc_update_bt_cnt(struct rtw89_dev *rtwdev)
 {
        /* Feature move to firmware */
@@ -2893,7 +2880,6 @@ static const struct rtw89_chip_ops rtw8852c_chip_ops = {
        .btc_set_wl_pri         = rtw8852c_btc_set_wl_pri,
        .btc_set_wl_txpwr_ctrl  = rtw8852c_btc_set_wl_txpwr_ctrl,
        .btc_get_bt_rssi        = rtw8852c_btc_get_bt_rssi,
-       .btc_bt_aci_imp         = rtw8852c_btc_bt_aci_imp,
        .btc_update_bt_cnt      = rtw8852c_btc_update_bt_cnt,
        .btc_wl_s1_standby      = rtw8852c_btc_wl_s1_standby,
        .btc_set_wl_rx_gain     = rtw8852c_btc_set_wl_rx_gain,