[PATCH rtw-next 02/14] wifi: rtw89: 8922d: disable VCORE for thermal protection by default

Ping-Ke Shih <[email protected]>
Newsgroups org.kernel.vger.linux-wireless
Message-ID <[email protected]>
From: Chih-Wen Hsiao <[email protected]>

To ensure the stability of the thermal protection mechanism,
the primary approach is to reduce the transmit (TX) duty cycle;
the option to lower the voltage(VCORE) is disabled by default.

Signed-off-by: Chih-Wen Hsiao <[email protected]>
Signed-off-by: Ping-Ke Shih <[email protected]>
---
 drivers/net/wireless/realtek/rtw89/core.h     | 1 +
 drivers/net/wireless/realtek/rtw89/rtw8922d.c | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw89/core.h b/drivers/net/wireless/realtek/rtw89/core.h
index b1a0103aaf0c..a2f6e68987a9 100644
--- a/drivers/net/wireless/realtek/rtw89/core.h
+++ b/drivers/net/wireless/realtek/rtw89/core.h
@@ -6463,6 +6463,7 @@ enum rtw89_quirks {
 	RTW89_QUIRK_PCI_BER,
 	RTW89_QUIRK_THERMAL_PROT_120C,
 	RTW89_QUIRK_THERMAL_PROT_110C,
+	RTW89_QUIRK_THERMAL_PROT_VCORE,
 	RTW89_QUIRK_HW_INFO_SYSFS,
 	RTW89_QUIRK_DISABLE_2GHZ,
 	RTW89_QUIRK_LOW_LATENCY,
diff --git a/drivers/net/wireless/realtek/rtw89/rtw8922d.c b/drivers/net/wireless/realtek/rtw89/rtw8922d.c
index 142e693c87bf..a9737c674ecb 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8922d.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8922d.c
@@ -901,6 +901,9 @@ static int rtw8922d_read_sys(struct rtw89_dev *rtwdev, u8 *log_map)
 	u16 digk;
 	u8 vmin;
 
+	if (!test_bit(RTW89_QUIRK_THERMAL_PROT_VCORE, rtwdev->quirks))
+		return 0;
+
 	digk = log_map[0x200] | log_map[0x201] << 8;
 	hal->thermal_prot_vmax = u16_get_bits(digk, B_BE_PWMTUNE_MASK);
 
-- 
2.25.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.