Skip to content

Commit 3ecca40

Browse files
Ping-Ke ShihKalle Valo
authored andcommitted
rtw89: 8852c: implement chip_ops::get_thermal
Read thermal value, and then we can use EWMA thermal value to do RF calibrations if the value is changed over a threshold. Signed-off-by: Ping-Ke Shih <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent af0cac1 commit 3ecca40

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/net/wireless/realtek/rtw89/rtw8852c.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2327,6 +2327,17 @@ static void rtw8852c_bb_cfg_txrx_path(struct rtw89_dev *rtwdev)
23272327
rtw8852c_ctrl_tx_path_tmac(rtwdev, RF_PATH_AB, RTW89_MAC_0);
23282328
}
23292329

2330+
static u8 rtw8852c_get_thermal(struct rtw89_dev *rtwdev, enum rtw89_rf_path rf_path)
2331+
{
2332+
rtw89_write_rf(rtwdev, rf_path, RR_TM, RR_TM_TRI, 0x1);
2333+
rtw89_write_rf(rtwdev, rf_path, RR_TM, RR_TM_TRI, 0x0);
2334+
rtw89_write_rf(rtwdev, rf_path, RR_TM, RR_TM_TRI, 0x1);
2335+
2336+
fsleep(200);
2337+
2338+
return rtw89_read_rf(rtwdev, rf_path, RR_TM, RR_TM_VAL);
2339+
}
2340+
23302341
static void rtw8852c_ctrl_btg(struct rtw89_dev *rtwdev, bool btg)
23312342
{
23322343
if (btg) {
@@ -2487,6 +2498,7 @@ static const struct rtw89_chip_ops rtw8852c_chip_ops = {
24872498
.set_txpwr = rtw8852c_set_txpwr,
24882499
.set_txpwr_ctrl = rtw8852c_set_txpwr_ctrl,
24892500
.init_txpwr_unit = rtw8852c_init_txpwr_unit,
2501+
.get_thermal = rtw8852c_get_thermal,
24902502
.read_rf = rtw89_phy_read_rf_v1,
24912503
.write_rf = rtw89_phy_write_rf_v1,
24922504
.set_txpwr_ul_tb_offset = rtw8852c_set_txpwr_ul_tb_offset,

0 commit comments

Comments
 (0)