xref: /linux/drivers/net/wireless/realtek/rtw89/rtw8852b_common.h (revision 9410645520e9b820069761f3450ef6661418e279)
15a72e198SPing-Ke Shih /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
25a72e198SPing-Ke Shih /* Copyright(c) 2024  Realtek Corporation
35a72e198SPing-Ke Shih  */
45a72e198SPing-Ke Shih 
55a72e198SPing-Ke Shih #ifndef __RTW89_8852BX_H__
65a72e198SPing-Ke Shih #define __RTW89_8852BX_H__
75a72e198SPing-Ke Shih 
85a72e198SPing-Ke Shih #include "core.h"
95a72e198SPing-Ke Shih 
105a72e198SPing-Ke Shih #define RF_PATH_NUM_8852BX 2
115a72e198SPing-Ke Shih #define BB_PATH_NUM_8852BX 2
125a72e198SPing-Ke Shih 
135a72e198SPing-Ke Shih enum rtw8852bx_pmac_mode {
145a72e198SPing-Ke Shih 	NONE_TEST,
155a72e198SPing-Ke Shih 	PKTS_TX,
165a72e198SPing-Ke Shih 	PKTS_RX,
175a72e198SPing-Ke Shih 	CONT_TX
185a72e198SPing-Ke Shih };
195a72e198SPing-Ke Shih 
205a72e198SPing-Ke Shih struct rtw8852bx_u_efuse {
215a72e198SPing-Ke Shih 	u8 rsvd[0x88];
225a72e198SPing-Ke Shih 	u8 mac_addr[ETH_ALEN];
235a72e198SPing-Ke Shih };
245a72e198SPing-Ke Shih 
255a72e198SPing-Ke Shih struct rtw8852bx_e_efuse {
265a72e198SPing-Ke Shih 	u8 mac_addr[ETH_ALEN];
275a72e198SPing-Ke Shih };
285a72e198SPing-Ke Shih 
295a72e198SPing-Ke Shih struct rtw8852bx_tssi_offset {
305a72e198SPing-Ke Shih 	u8 cck_tssi[TSSI_CCK_CH_GROUP_NUM];
315a72e198SPing-Ke Shih 	u8 bw40_tssi[TSSI_MCS_2G_CH_GROUP_NUM];
325a72e198SPing-Ke Shih 	u8 rsvd[7];
335a72e198SPing-Ke Shih 	u8 bw40_1s_tssi_5g[TSSI_MCS_5G_CH_GROUP_NUM];
345a72e198SPing-Ke Shih } __packed;
355a72e198SPing-Ke Shih 
365a72e198SPing-Ke Shih struct rtw8852bx_efuse {
375a72e198SPing-Ke Shih 	u8 rsvd[0x210];
385a72e198SPing-Ke Shih 	struct rtw8852bx_tssi_offset path_a_tssi;
395a72e198SPing-Ke Shih 	u8 rsvd1[10];
405a72e198SPing-Ke Shih 	struct rtw8852bx_tssi_offset path_b_tssi;
415a72e198SPing-Ke Shih 	u8 rsvd2[94];
425a72e198SPing-Ke Shih 	u8 channel_plan;
435a72e198SPing-Ke Shih 	u8 xtal_k;
445a72e198SPing-Ke Shih 	u8 rsvd3;
455a72e198SPing-Ke Shih 	u8 iqk_lck;
465a72e198SPing-Ke Shih 	u8 rsvd4[5];
475a72e198SPing-Ke Shih 	u8 reg_setting:2;
485a72e198SPing-Ke Shih 	u8 tx_diversity:1;
495a72e198SPing-Ke Shih 	u8 rx_diversity:2;
505a72e198SPing-Ke Shih 	u8 ac_mode:1;
515a72e198SPing-Ke Shih 	u8 module_type:2;
525a72e198SPing-Ke Shih 	u8 rsvd5;
535a72e198SPing-Ke Shih 	u8 shared_ant:1;
545a72e198SPing-Ke Shih 	u8 coex_type:3;
555a72e198SPing-Ke Shih 	u8 ant_iso:1;
565a72e198SPing-Ke Shih 	u8 radio_on_off:1;
575a72e198SPing-Ke Shih 	u8 rsvd6:2;
585a72e198SPing-Ke Shih 	u8 eeprom_version;
595a72e198SPing-Ke Shih 	u8 customer_id;
605a72e198SPing-Ke Shih 	u8 tx_bb_swing_2g;
615a72e198SPing-Ke Shih 	u8 tx_bb_swing_5g;
625a72e198SPing-Ke Shih 	u8 tx_cali_pwr_trk_mode;
635a72e198SPing-Ke Shih 	u8 trx_path_selection;
645a72e198SPing-Ke Shih 	u8 rfe_type;
655a72e198SPing-Ke Shih 	u8 country_code[2];
665a72e198SPing-Ke Shih 	u8 rsvd7[3];
675a72e198SPing-Ke Shih 	u8 path_a_therm;
685a72e198SPing-Ke Shih 	u8 path_b_therm;
695a72e198SPing-Ke Shih 	u8 rsvd8[2];
705a72e198SPing-Ke Shih 	u8 rx_gain_2g_ofdm;
715a72e198SPing-Ke Shih 	u8 rsvd9;
725a72e198SPing-Ke Shih 	u8 rx_gain_2g_cck;
735a72e198SPing-Ke Shih 	u8 rsvd10;
745a72e198SPing-Ke Shih 	u8 rx_gain_5g_low;
755a72e198SPing-Ke Shih 	u8 rsvd11;
765a72e198SPing-Ke Shih 	u8 rx_gain_5g_mid;
775a72e198SPing-Ke Shih 	u8 rsvd12;
785a72e198SPing-Ke Shih 	u8 rx_gain_5g_high;
795a72e198SPing-Ke Shih 	u8 rsvd13[35];
805a72e198SPing-Ke Shih 	u8 path_a_cck_pwr_idx[6];
815a72e198SPing-Ke Shih 	u8 path_a_bw40_1tx_pwr_idx[5];
825a72e198SPing-Ke Shih 	u8 path_a_ofdm_1tx_pwr_idx_diff:4;
835a72e198SPing-Ke Shih 	u8 path_a_bw20_1tx_pwr_idx_diff:4;
845a72e198SPing-Ke Shih 	u8 path_a_bw20_2tx_pwr_idx_diff:4;
855a72e198SPing-Ke Shih 	u8 path_a_bw40_2tx_pwr_idx_diff:4;
865a72e198SPing-Ke Shih 	u8 path_a_cck_2tx_pwr_idx_diff:4;
875a72e198SPing-Ke Shih 	u8 path_a_ofdm_2tx_pwr_idx_diff:4;
885a72e198SPing-Ke Shih 	u8 rsvd14[0xf2];
895a72e198SPing-Ke Shih 	union {
905a72e198SPing-Ke Shih 		struct rtw8852bx_u_efuse u;
915a72e198SPing-Ke Shih 		struct rtw8852bx_e_efuse e;
925a72e198SPing-Ke Shih 	};
935a72e198SPing-Ke Shih } __packed;
945a72e198SPing-Ke Shih 
955a72e198SPing-Ke Shih struct rtw8852bx_bb_pmac_info {
965a72e198SPing-Ke Shih 	u8 en_pmac_tx:1;
975a72e198SPing-Ke Shih 	u8 is_cck:1;
985a72e198SPing-Ke Shih 	u8 mode:3;
995a72e198SPing-Ke Shih 	u8 rsvd:3;
1005a72e198SPing-Ke Shih 	u16 tx_cnt;
1015a72e198SPing-Ke Shih 	u16 period;
1025a72e198SPing-Ke Shih 	u16 tx_time;
1035a72e198SPing-Ke Shih 	u8 duty_cycle;
1045a72e198SPing-Ke Shih };
1055a72e198SPing-Ke Shih 
1065a72e198SPing-Ke Shih struct rtw8852bx_bb_tssi_bak {
1075a72e198SPing-Ke Shih 	u8 tx_path;
1085a72e198SPing-Ke Shih 	u8 rx_path;
1095a72e198SPing-Ke Shih 	u32 p0_rfmode;
1105a72e198SPing-Ke Shih 	u32 p0_rfmode_ftm;
1115a72e198SPing-Ke Shih 	u32 p1_rfmode;
1125a72e198SPing-Ke Shih 	u32 p1_rfmode_ftm;
1135a72e198SPing-Ke Shih 	s16 tx_pwr; /* S9 */
1145a72e198SPing-Ke Shih };
1155a72e198SPing-Ke Shih 
1165a72e198SPing-Ke Shih struct rtw8852bx_info {
1175a72e198SPing-Ke Shih 	int (*mac_enable_bb_rf)(struct rtw89_dev *rtwdev);
1185a72e198SPing-Ke Shih 	int (*mac_disable_bb_rf)(struct rtw89_dev *rtwdev);
1195a72e198SPing-Ke Shih 	void (*bb_sethw)(struct rtw89_dev *rtwdev);
1205a72e198SPing-Ke Shih 	void (*bb_reset_all)(struct rtw89_dev *rtwdev, enum rtw89_phy_idx phy_idx);
1215a72e198SPing-Ke Shih 	void (*bb_cfg_txrx_path)(struct rtw89_dev *rtwdev);
1225a72e198SPing-Ke Shih 	void (*bb_cfg_tx_path)(struct rtw89_dev *rtwdev, u8 tx_path);
1235a72e198SPing-Ke Shih 	void (*bb_ctrl_rx_path)(struct rtw89_dev *rtwdev,
12450b3da25SZong-Zhe Yang 				enum rtw89_rf_path_bit rx_path,
12550b3da25SZong-Zhe Yang 				const struct rtw89_chan *chan);
1265a72e198SPing-Ke Shih 	void (*bb_set_plcp_tx)(struct rtw89_dev *rtwdev);
1275a72e198SPing-Ke Shih 	void (*bb_set_power)(struct rtw89_dev *rtwdev, s16 pwr_dbm,
1285a72e198SPing-Ke Shih 			     enum rtw89_phy_idx idx);
1295a72e198SPing-Ke Shih 	void (*bb_set_pmac_pkt_tx)(struct rtw89_dev *rtwdev, u8 enable,
1305a72e198SPing-Ke Shih 				   u16 tx_cnt, u16 period, u16 tx_time,
13150b3da25SZong-Zhe Yang 				   enum rtw89_phy_idx idx, const struct rtw89_chan *chan);
1325a72e198SPing-Ke Shih 	void (*bb_backup_tssi)(struct rtw89_dev *rtwdev, enum rtw89_phy_idx idx,
1335a72e198SPing-Ke Shih 			       struct rtw8852bx_bb_tssi_bak *bak);
1345a72e198SPing-Ke Shih 	void (*bb_restore_tssi)(struct rtw89_dev *rtwdev, enum rtw89_phy_idx idx,
1355a72e198SPing-Ke Shih 				const struct rtw8852bx_bb_tssi_bak *bak);
1365a72e198SPing-Ke Shih 	void (*bb_tx_mode_switch)(struct rtw89_dev *rtwdev,
1375a72e198SPing-Ke Shih 				  enum rtw89_phy_idx idx, u8 mode);
1385a72e198SPing-Ke Shih 	void (*set_channel_mac)(struct rtw89_dev *rtwdev,
1395a72e198SPing-Ke Shih 				const struct rtw89_chan *chan, u8 mac_idx);
1405a72e198SPing-Ke Shih 	void (*set_channel_bb)(struct rtw89_dev *rtwdev, const struct rtw89_chan *chan,
1415a72e198SPing-Ke Shih 			       enum rtw89_phy_idx phy_idx);
1425a72e198SPing-Ke Shih 	void (*ctrl_nbtg_bt_tx)(struct rtw89_dev *rtwdev, bool en,
1435a72e198SPing-Ke Shih 				enum rtw89_phy_idx phy_idx);
1445a72e198SPing-Ke Shih 	void (*ctrl_btg_bt_rx)(struct rtw89_dev *rtwdev, bool en,
1455a72e198SPing-Ke Shih 			       enum rtw89_phy_idx phy_idx);
1465a72e198SPing-Ke Shih 	void (*query_ppdu)(struct rtw89_dev *rtwdev,
1475a72e198SPing-Ke Shih 			   struct rtw89_rx_phy_ppdu *phy_ppdu,
1485a72e198SPing-Ke Shih 			   struct ieee80211_rx_status *status);
149*c9ac071eSEric Huang 	void (*convert_rpl_to_rssi)(struct rtw89_dev *rtwdev,
150*c9ac071eSEric Huang 				    struct rtw89_rx_phy_ppdu *phy_ppdu);
1515a72e198SPing-Ke Shih 	int (*read_efuse)(struct rtw89_dev *rtwdev, u8 *log_map,
1525a72e198SPing-Ke Shih 			  enum rtw89_efuse_block block);
1535a72e198SPing-Ke Shih 	int (*read_phycap)(struct rtw89_dev *rtwdev, u8 *phycap_map);
1545a72e198SPing-Ke Shih 	void (*power_trim)(struct rtw89_dev *rtwdev);
1555a72e198SPing-Ke Shih 	void (*set_txpwr)(struct rtw89_dev *rtwdev,
1565a72e198SPing-Ke Shih 			  const struct rtw89_chan *chan,
1575a72e198SPing-Ke Shih 			  enum rtw89_phy_idx phy_idx);
1585a72e198SPing-Ke Shih 	void (*set_txpwr_ctrl)(struct rtw89_dev *rtwdev,
1595a72e198SPing-Ke Shih 			       enum rtw89_phy_idx phy_idx);
1605a72e198SPing-Ke Shih 	int (*init_txpwr_unit)(struct rtw89_dev *rtwdev, enum rtw89_phy_idx phy_idx);
1615a72e198SPing-Ke Shih 	void (*set_txpwr_ul_tb_offset)(struct rtw89_dev *rtwdev,
1625a72e198SPing-Ke Shih 				       s8 pw_ofst, enum rtw89_mac_idx mac_idx);
1635a72e198SPing-Ke Shih 	u8 (*get_thermal)(struct rtw89_dev *rtwdev, enum rtw89_rf_path rf_path);
1642ab298cfSPing-Ke Shih 	void (*adc_cfg)(struct rtw89_dev *rtwdev, u8 bw, u8 path);
1650e557c5cSPing-Ke Shih 	void (*btc_init_cfg)(struct rtw89_dev *rtwdev);
1660e557c5cSPing-Ke Shih 	void (*btc_set_wl_pri)(struct rtw89_dev *rtwdev, u8 map, bool state);
1670e557c5cSPing-Ke Shih 	s8 (*btc_get_bt_rssi)(struct rtw89_dev *rtwdev, s8 val);
1680e557c5cSPing-Ke Shih 	void (*btc_update_bt_cnt)(struct rtw89_dev *rtwdev);
1690e557c5cSPing-Ke Shih 	void (*btc_wl_s1_standby)(struct rtw89_dev *rtwdev, bool state);
1700e557c5cSPing-Ke Shih 	void (*btc_set_wl_rx_gain)(struct rtw89_dev *rtwdev, u32 level);
1715a72e198SPing-Ke Shih };
1725a72e198SPing-Ke Shih 
1735a72e198SPing-Ke Shih extern const struct rtw8852bx_info rtw8852bx_info;
1745a72e198SPing-Ke Shih 
1755a72e198SPing-Ke Shih static inline
rtw8852bx_mac_enable_bb_rf(struct rtw89_dev * rtwdev)1765a72e198SPing-Ke Shih int rtw8852bx_mac_enable_bb_rf(struct rtw89_dev *rtwdev)
1775a72e198SPing-Ke Shih {
1785a72e198SPing-Ke Shih 	return rtw8852bx_info.mac_enable_bb_rf(rtwdev);
1795a72e198SPing-Ke Shih }
1805a72e198SPing-Ke Shih 
1815a72e198SPing-Ke Shih static inline
rtw8852bx_mac_disable_bb_rf(struct rtw89_dev * rtwdev)1825a72e198SPing-Ke Shih int rtw8852bx_mac_disable_bb_rf(struct rtw89_dev *rtwdev)
1835a72e198SPing-Ke Shih {
1845a72e198SPing-Ke Shih 	return rtw8852bx_info.mac_disable_bb_rf(rtwdev);
1855a72e198SPing-Ke Shih }
1865a72e198SPing-Ke Shih 
1875a72e198SPing-Ke Shih static inline
rtw8852bx_bb_sethw(struct rtw89_dev * rtwdev)1885a72e198SPing-Ke Shih void rtw8852bx_bb_sethw(struct rtw89_dev *rtwdev)
1895a72e198SPing-Ke Shih {
1905a72e198SPing-Ke Shih 	rtw8852bx_info.bb_sethw(rtwdev);
1915a72e198SPing-Ke Shih }
1925a72e198SPing-Ke Shih 
1935a72e198SPing-Ke Shih static inline
rtw8852bx_bb_reset_all(struct rtw89_dev * rtwdev,enum rtw89_phy_idx phy_idx)1945a72e198SPing-Ke Shih void rtw8852bx_bb_reset_all(struct rtw89_dev *rtwdev, enum rtw89_phy_idx phy_idx)
1955a72e198SPing-Ke Shih {
1965a72e198SPing-Ke Shih 	rtw8852bx_info.bb_reset_all(rtwdev, phy_idx);
1975a72e198SPing-Ke Shih }
1985a72e198SPing-Ke Shih 
1995a72e198SPing-Ke Shih static inline
rtw8852bx_bb_cfg_txrx_path(struct rtw89_dev * rtwdev)2005a72e198SPing-Ke Shih void rtw8852bx_bb_cfg_txrx_path(struct rtw89_dev *rtwdev)
2015a72e198SPing-Ke Shih {
2025a72e198SPing-Ke Shih 	rtw8852bx_info.bb_cfg_txrx_path(rtwdev);
2035a72e198SPing-Ke Shih }
2045a72e198SPing-Ke Shih 
2055a72e198SPing-Ke Shih static inline
rtw8852bx_bb_cfg_tx_path(struct rtw89_dev * rtwdev,u8 tx_path)2065a72e198SPing-Ke Shih void rtw8852bx_bb_cfg_tx_path(struct rtw89_dev *rtwdev, u8 tx_path)
2075a72e198SPing-Ke Shih {
2085a72e198SPing-Ke Shih 	rtw8852bx_info.bb_cfg_tx_path(rtwdev, tx_path);
2095a72e198SPing-Ke Shih }
2105a72e198SPing-Ke Shih 
2115a72e198SPing-Ke Shih static inline
rtw8852bx_bb_ctrl_rx_path(struct rtw89_dev * rtwdev,enum rtw89_rf_path_bit rx_path,const struct rtw89_chan * chan)2125a72e198SPing-Ke Shih void rtw8852bx_bb_ctrl_rx_path(struct rtw89_dev *rtwdev,
21350b3da25SZong-Zhe Yang 			       enum rtw89_rf_path_bit rx_path,
21450b3da25SZong-Zhe Yang 			       const struct rtw89_chan *chan)
2155a72e198SPing-Ke Shih {
21650b3da25SZong-Zhe Yang 	rtw8852bx_info.bb_ctrl_rx_path(rtwdev, rx_path, chan);
2175a72e198SPing-Ke Shih }
2185a72e198SPing-Ke Shih 
2195a72e198SPing-Ke Shih static inline
rtw8852bx_bb_set_plcp_tx(struct rtw89_dev * rtwdev)2205a72e198SPing-Ke Shih void rtw8852bx_bb_set_plcp_tx(struct rtw89_dev *rtwdev)
2215a72e198SPing-Ke Shih {
2225a72e198SPing-Ke Shih 	rtw8852bx_info.bb_set_plcp_tx(rtwdev);
2235a72e198SPing-Ke Shih }
2245a72e198SPing-Ke Shih 
2255a72e198SPing-Ke Shih static inline
rtw8852bx_bb_set_power(struct rtw89_dev * rtwdev,s16 pwr_dbm,enum rtw89_phy_idx idx)2265a72e198SPing-Ke Shih void rtw8852bx_bb_set_power(struct rtw89_dev *rtwdev, s16 pwr_dbm,
2275a72e198SPing-Ke Shih 			    enum rtw89_phy_idx idx)
2285a72e198SPing-Ke Shih {
2295a72e198SPing-Ke Shih 	rtw8852bx_info.bb_set_power(rtwdev, pwr_dbm, idx);
2305a72e198SPing-Ke Shih }
2315a72e198SPing-Ke Shih 
2325a72e198SPing-Ke Shih static inline
rtw8852bx_bb_set_pmac_pkt_tx(struct rtw89_dev * rtwdev,u8 enable,u16 tx_cnt,u16 period,u16 tx_time,enum rtw89_phy_idx idx,const struct rtw89_chan * chan)2335a72e198SPing-Ke Shih void rtw8852bx_bb_set_pmac_pkt_tx(struct rtw89_dev *rtwdev, u8 enable,
2345a72e198SPing-Ke Shih 				  u16 tx_cnt, u16 period, u16 tx_time,
23550b3da25SZong-Zhe Yang 				  enum rtw89_phy_idx idx, const struct rtw89_chan *chan)
2365a72e198SPing-Ke Shih {
23750b3da25SZong-Zhe Yang 	rtw8852bx_info.bb_set_pmac_pkt_tx(rtwdev, enable, tx_cnt, period, tx_time, idx,
23850b3da25SZong-Zhe Yang 					  chan);
2395a72e198SPing-Ke Shih }
2405a72e198SPing-Ke Shih 
2415a72e198SPing-Ke Shih static inline
rtw8852bx_bb_backup_tssi(struct rtw89_dev * rtwdev,enum rtw89_phy_idx idx,struct rtw8852bx_bb_tssi_bak * bak)2425a72e198SPing-Ke Shih void rtw8852bx_bb_backup_tssi(struct rtw89_dev *rtwdev, enum rtw89_phy_idx idx,
2435a72e198SPing-Ke Shih 			      struct rtw8852bx_bb_tssi_bak *bak)
2445a72e198SPing-Ke Shih {
2455a72e198SPing-Ke Shih 	rtw8852bx_info.bb_backup_tssi(rtwdev, idx, bak);
2465a72e198SPing-Ke Shih }
2475a72e198SPing-Ke Shih 
2485a72e198SPing-Ke Shih static inline
rtw8852bx_bb_restore_tssi(struct rtw89_dev * rtwdev,enum rtw89_phy_idx idx,const struct rtw8852bx_bb_tssi_bak * bak)2495a72e198SPing-Ke Shih void rtw8852bx_bb_restore_tssi(struct rtw89_dev *rtwdev, enum rtw89_phy_idx idx,
2505a72e198SPing-Ke Shih 			       const struct rtw8852bx_bb_tssi_bak *bak)
2515a72e198SPing-Ke Shih {
2525a72e198SPing-Ke Shih 	rtw8852bx_info.bb_restore_tssi(rtwdev, idx, bak);
2535a72e198SPing-Ke Shih }
2545a72e198SPing-Ke Shih 
2555a72e198SPing-Ke Shih static inline
rtw8852bx_bb_tx_mode_switch(struct rtw89_dev * rtwdev,enum rtw89_phy_idx idx,u8 mode)2565a72e198SPing-Ke Shih void rtw8852bx_bb_tx_mode_switch(struct rtw89_dev *rtwdev,
2575a72e198SPing-Ke Shih 				 enum rtw89_phy_idx idx, u8 mode)
2585a72e198SPing-Ke Shih {
2595a72e198SPing-Ke Shih 	rtw8852bx_info.bb_tx_mode_switch(rtwdev, idx, mode);
2605a72e198SPing-Ke Shih }
2615a72e198SPing-Ke Shih 
2625a72e198SPing-Ke Shih static inline
rtw8852bx_set_channel_mac(struct rtw89_dev * rtwdev,const struct rtw89_chan * chan,u8 mac_idx)2635a72e198SPing-Ke Shih void rtw8852bx_set_channel_mac(struct rtw89_dev *rtwdev,
2645a72e198SPing-Ke Shih 			       const struct rtw89_chan *chan, u8 mac_idx)
2655a72e198SPing-Ke Shih {
2665a72e198SPing-Ke Shih 	rtw8852bx_info.set_channel_mac(rtwdev, chan, mac_idx);
2675a72e198SPing-Ke Shih }
2685a72e198SPing-Ke Shih 
2695a72e198SPing-Ke Shih static inline
rtw8852bx_set_channel_bb(struct rtw89_dev * rtwdev,const struct rtw89_chan * chan,enum rtw89_phy_idx phy_idx)2705a72e198SPing-Ke Shih void rtw8852bx_set_channel_bb(struct rtw89_dev *rtwdev, const struct rtw89_chan *chan,
2715a72e198SPing-Ke Shih 			      enum rtw89_phy_idx phy_idx)
2725a72e198SPing-Ke Shih {
2735a72e198SPing-Ke Shih 	rtw8852bx_info.set_channel_bb(rtwdev, chan, phy_idx);
2745a72e198SPing-Ke Shih }
2755a72e198SPing-Ke Shih 
2765a72e198SPing-Ke Shih static inline
rtw8852bx_ctrl_nbtg_bt_tx(struct rtw89_dev * rtwdev,bool en,enum rtw89_phy_idx phy_idx)2775a72e198SPing-Ke Shih void rtw8852bx_ctrl_nbtg_bt_tx(struct rtw89_dev *rtwdev, bool en,
2785a72e198SPing-Ke Shih 			       enum rtw89_phy_idx phy_idx)
2795a72e198SPing-Ke Shih {
2805a72e198SPing-Ke Shih 	rtw8852bx_info.ctrl_nbtg_bt_tx(rtwdev, en, phy_idx);
2815a72e198SPing-Ke Shih }
2825a72e198SPing-Ke Shih 
2835a72e198SPing-Ke Shih static inline
rtw8852bx_ctrl_btg_bt_rx(struct rtw89_dev * rtwdev,bool en,enum rtw89_phy_idx phy_idx)2845a72e198SPing-Ke Shih void rtw8852bx_ctrl_btg_bt_rx(struct rtw89_dev *rtwdev, bool en,
2855a72e198SPing-Ke Shih 			      enum rtw89_phy_idx phy_idx)
2865a72e198SPing-Ke Shih {
2875a72e198SPing-Ke Shih 	rtw8852bx_info.ctrl_btg_bt_rx(rtwdev, en, phy_idx);
2885a72e198SPing-Ke Shih }
2895a72e198SPing-Ke Shih 
2905a72e198SPing-Ke Shih static inline
rtw8852bx_query_ppdu(struct rtw89_dev * rtwdev,struct rtw89_rx_phy_ppdu * phy_ppdu,struct ieee80211_rx_status * status)2915a72e198SPing-Ke Shih void rtw8852bx_query_ppdu(struct rtw89_dev *rtwdev,
2925a72e198SPing-Ke Shih 			  struct rtw89_rx_phy_ppdu *phy_ppdu,
2935a72e198SPing-Ke Shih 			  struct ieee80211_rx_status *status)
2945a72e198SPing-Ke Shih {
2955a72e198SPing-Ke Shih 	rtw8852bx_info.query_ppdu(rtwdev, phy_ppdu, status);
2965a72e198SPing-Ke Shih }
2975a72e198SPing-Ke Shih 
2985a72e198SPing-Ke Shih static inline
rtw8852bx_convert_rpl_to_rssi(struct rtw89_dev * rtwdev,struct rtw89_rx_phy_ppdu * phy_ppdu)299*c9ac071eSEric Huang void rtw8852bx_convert_rpl_to_rssi(struct rtw89_dev *rtwdev,
300*c9ac071eSEric Huang 				   struct rtw89_rx_phy_ppdu *phy_ppdu)
301*c9ac071eSEric Huang {
302*c9ac071eSEric Huang 	rtw8852bx_info.convert_rpl_to_rssi(rtwdev, phy_ppdu);
303*c9ac071eSEric Huang }
304*c9ac071eSEric Huang 
305*c9ac071eSEric Huang static inline
rtw8852bx_read_efuse(struct rtw89_dev * rtwdev,u8 * log_map,enum rtw89_efuse_block block)3065a72e198SPing-Ke Shih int rtw8852bx_read_efuse(struct rtw89_dev *rtwdev, u8 *log_map,
3075a72e198SPing-Ke Shih 			 enum rtw89_efuse_block block)
3085a72e198SPing-Ke Shih {
3095a72e198SPing-Ke Shih 	return rtw8852bx_info.read_efuse(rtwdev, log_map, block);
3105a72e198SPing-Ke Shih }
3115a72e198SPing-Ke Shih 
3125a72e198SPing-Ke Shih static inline
rtw8852bx_read_phycap(struct rtw89_dev * rtwdev,u8 * phycap_map)3135a72e198SPing-Ke Shih int rtw8852bx_read_phycap(struct rtw89_dev *rtwdev, u8 *phycap_map)
3145a72e198SPing-Ke Shih {
3155a72e198SPing-Ke Shih 	return rtw8852bx_info.read_phycap(rtwdev, phycap_map);
3165a72e198SPing-Ke Shih }
3175a72e198SPing-Ke Shih 
3185a72e198SPing-Ke Shih static inline
rtw8852bx_power_trim(struct rtw89_dev * rtwdev)3195a72e198SPing-Ke Shih void rtw8852bx_power_trim(struct rtw89_dev *rtwdev)
3205a72e198SPing-Ke Shih {
3215a72e198SPing-Ke Shih 	rtw8852bx_info.power_trim(rtwdev);
3225a72e198SPing-Ke Shih }
3235a72e198SPing-Ke Shih 
3245a72e198SPing-Ke Shih static inline
rtw8852bx_set_txpwr(struct rtw89_dev * rtwdev,const struct rtw89_chan * chan,enum rtw89_phy_idx phy_idx)3255a72e198SPing-Ke Shih void rtw8852bx_set_txpwr(struct rtw89_dev *rtwdev,
3265a72e198SPing-Ke Shih 			 const struct rtw89_chan *chan,
3275a72e198SPing-Ke Shih 			 enum rtw89_phy_idx phy_idx)
3285a72e198SPing-Ke Shih {
3295a72e198SPing-Ke Shih 	rtw8852bx_info.set_txpwr(rtwdev, chan, phy_idx);
3305a72e198SPing-Ke Shih }
3315a72e198SPing-Ke Shih 
3325a72e198SPing-Ke Shih static inline
rtw8852bx_set_txpwr_ctrl(struct rtw89_dev * rtwdev,enum rtw89_phy_idx phy_idx)3335a72e198SPing-Ke Shih void rtw8852bx_set_txpwr_ctrl(struct rtw89_dev *rtwdev,
3345a72e198SPing-Ke Shih 			      enum rtw89_phy_idx phy_idx)
3355a72e198SPing-Ke Shih {
3365a72e198SPing-Ke Shih 	rtw8852bx_info.set_txpwr_ctrl(rtwdev, phy_idx);
3375a72e198SPing-Ke Shih }
3385a72e198SPing-Ke Shih 
3395a72e198SPing-Ke Shih static inline
rtw8852bx_init_txpwr_unit(struct rtw89_dev * rtwdev,enum rtw89_phy_idx phy_idx)3405a72e198SPing-Ke Shih int rtw8852bx_init_txpwr_unit(struct rtw89_dev *rtwdev, enum rtw89_phy_idx phy_idx)
3415a72e198SPing-Ke Shih {
3425a72e198SPing-Ke Shih 	return rtw8852bx_info.init_txpwr_unit(rtwdev, phy_idx);
3435a72e198SPing-Ke Shih }
3445a72e198SPing-Ke Shih 
3455a72e198SPing-Ke Shih static inline
rtw8852bx_set_txpwr_ul_tb_offset(struct rtw89_dev * rtwdev,s8 pw_ofst,enum rtw89_mac_idx mac_idx)3465a72e198SPing-Ke Shih void rtw8852bx_set_txpwr_ul_tb_offset(struct rtw89_dev *rtwdev,
3475a72e198SPing-Ke Shih 				      s8 pw_ofst, enum rtw89_mac_idx mac_idx)
3485a72e198SPing-Ke Shih {
3495a72e198SPing-Ke Shih 	rtw8852bx_info.set_txpwr_ul_tb_offset(rtwdev, pw_ofst, mac_idx);
3505a72e198SPing-Ke Shih }
3515a72e198SPing-Ke Shih 
3525a72e198SPing-Ke Shih static inline
rtw8852bx_get_thermal(struct rtw89_dev * rtwdev,enum rtw89_rf_path rf_path)3535a72e198SPing-Ke Shih u8 rtw8852bx_get_thermal(struct rtw89_dev *rtwdev, enum rtw89_rf_path rf_path)
3545a72e198SPing-Ke Shih {
3555a72e198SPing-Ke Shih 	return rtw8852bx_info.get_thermal(rtwdev, rf_path);
3565a72e198SPing-Ke Shih }
3575a72e198SPing-Ke Shih 
3582ab298cfSPing-Ke Shih static inline
rtw8852bx_adc_cfg(struct rtw89_dev * rtwdev,u8 bw,u8 path)3592ab298cfSPing-Ke Shih void rtw8852bx_adc_cfg(struct rtw89_dev *rtwdev, u8 bw, u8 path)
3602ab298cfSPing-Ke Shih {
3612ab298cfSPing-Ke Shih 	rtw8852bx_info.adc_cfg(rtwdev, bw, path);
3622ab298cfSPing-Ke Shih }
3632ab298cfSPing-Ke Shih 
3640e557c5cSPing-Ke Shih static inline
rtw8852bx_btc_init_cfg(struct rtw89_dev * rtwdev)3650e557c5cSPing-Ke Shih void rtw8852bx_btc_init_cfg(struct rtw89_dev *rtwdev)
3660e557c5cSPing-Ke Shih {
3670e557c5cSPing-Ke Shih 	rtw8852bx_info.btc_init_cfg(rtwdev);
3680e557c5cSPing-Ke Shih }
3690e557c5cSPing-Ke Shih 
3700e557c5cSPing-Ke Shih static inline
rtw8852bx_btc_set_wl_pri(struct rtw89_dev * rtwdev,u8 map,bool state)3710e557c5cSPing-Ke Shih void rtw8852bx_btc_set_wl_pri(struct rtw89_dev *rtwdev, u8 map, bool state)
3720e557c5cSPing-Ke Shih {
3730e557c5cSPing-Ke Shih 	rtw8852bx_info.btc_set_wl_pri(rtwdev, map, state);
3740e557c5cSPing-Ke Shih }
3750e557c5cSPing-Ke Shih 
3760e557c5cSPing-Ke Shih static inline
rtw8852bx_btc_get_bt_rssi(struct rtw89_dev * rtwdev,s8 val)3770e557c5cSPing-Ke Shih s8 rtw8852bx_btc_get_bt_rssi(struct rtw89_dev *rtwdev, s8 val)
3780e557c5cSPing-Ke Shih {
3790e557c5cSPing-Ke Shih 	return rtw8852bx_info.btc_get_bt_rssi(rtwdev, val);
3800e557c5cSPing-Ke Shih }
3810e557c5cSPing-Ke Shih 
3820e557c5cSPing-Ke Shih static inline
rtw8852bx_btc_update_bt_cnt(struct rtw89_dev * rtwdev)3830e557c5cSPing-Ke Shih void rtw8852bx_btc_update_bt_cnt(struct rtw89_dev *rtwdev)
3840e557c5cSPing-Ke Shih {
3850e557c5cSPing-Ke Shih 	rtw8852bx_info.btc_update_bt_cnt(rtwdev);
3860e557c5cSPing-Ke Shih }
3870e557c5cSPing-Ke Shih 
3880e557c5cSPing-Ke Shih static inline
rtw8852bx_btc_wl_s1_standby(struct rtw89_dev * rtwdev,bool state)3890e557c5cSPing-Ke Shih void rtw8852bx_btc_wl_s1_standby(struct rtw89_dev *rtwdev, bool state)
3900e557c5cSPing-Ke Shih {
3910e557c5cSPing-Ke Shih 	rtw8852bx_info.btc_wl_s1_standby(rtwdev, state);
3920e557c5cSPing-Ke Shih }
3930e557c5cSPing-Ke Shih 
3940e557c5cSPing-Ke Shih static inline
rtw8852bx_btc_set_wl_rx_gain(struct rtw89_dev * rtwdev,u32 level)3950e557c5cSPing-Ke Shih void rtw8852bx_btc_set_wl_rx_gain(struct rtw89_dev *rtwdev, u32 level)
3960e557c5cSPing-Ke Shih {
3970e557c5cSPing-Ke Shih 	rtw8852bx_info.btc_set_wl_rx_gain(rtwdev, level);
3980e557c5cSPing-Ke Shih }
3990e557c5cSPing-Ke Shih 
4005a72e198SPing-Ke Shih #endif
401