rtw89: 8852c: implement chip_ops related to TX power
authorPing-Ke Shih <pkshih@realtek.com>
Thu, 21 Apr 2022 12:09:00 +0000 (20:09 +0800)
committerKalle Valo <kvalo@kernel.org>
Sun, 24 Apr 2022 11:30:35 +0000 (14:30 +0300)
commitaf0cac159b1c96633436b71a4a790d77a1d75858
tree13c6355bb39285c1581f14bce4b1074ebff0a241
parentcd89a47105dc697ee8a1e36f09147c2f0a03c830
rtw89: 8852c: implement chip_ops related to TX power

Three chip_ops are implemented in this patch. The ::set_txpwr_ctrl and
::init_txpwr_unit are called when we up interface and then configure TX
power registers to initial values. The ::set_txpwr_ctrl is to configure
'txpwr_ref' to make basic output TX power of OFDM and CCK rate to be the
same. The ::init_txpwr_unit is to initialize TSSI (a method to do TX power
compensation depends on thermal value) control and bandedge.

The ::set_txpwr is called once switching channel. First, it sets TX power
for each rate section (e.g. CCK, OFDM), and then sets TX power offset
between 1SS and 2SS rate. Finally, it sets TX power limit to prevent
power over regulation.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220421120903.73715-12-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/rtw8852c.c
drivers/net/wireless/realtek/rtw89/rtw8852c.h