blob: f5c250a495bebc1887d304f4065f76d0fae81664 [file] [log] [blame]
developer83f60012023-01-19 13:58:51 +08001From 6e2b8db65902a9ed9d0bb323b915657f14f9c740 Mon Sep 17 00:00:00 2001
2From: Howard Hsu <howard-yh.hsu@mediatek.com>
3Date: Thu, 19 Jan 2023 11:03:44 +0800
4Subject: [PATCH] wifi: mt76: mt7915: rework mt7915_thermal_init()
5
6If the kernel configuration "CONFIG_HWMON" is not set to Y, the
7critial/maximum high temperature will not be initialised to the correct
8setting. Rework mt7915_thermal_init to fix this.
9---
10 mt7915/init.c | 8 ++++----
11 1 file changed, 4 insertions(+), 4 deletions(-)
12
13diff --git a/mt7915/init.c b/mt7915/init.c
14index b23a2fb8..476c1238 100644
15--- a/mt7915/init.c
16+++ b/mt7915/init.c
17@@ -203,6 +203,10 @@ static int mt7915_thermal_init(struct mt7915_phy *phy)
18 phy->cdev = cdev;
19 }
20
21+ /* initialize critical/maximum high temperature */
22+ phy->throttle_temp[MT7915_CRIT_TEMP_IDX] = MT7915_CRIT_TEMP;
23+ phy->throttle_temp[MT7915_MAX_TEMP_IDX] = MT7915_MAX_TEMP;
24+
25 if (!IS_REACHABLE(CONFIG_HWMON))
26 return 0;
27
28@@ -211,10 +215,6 @@ static int mt7915_thermal_init(struct mt7915_phy *phy)
29 if (IS_ERR(hwmon))
30 return PTR_ERR(hwmon);
31
32- /* initialize critical/maximum high temperature */
33- phy->throttle_temp[MT7915_CRIT_TEMP_IDX] = MT7915_CRIT_TEMP;
34- phy->throttle_temp[MT7915_MAX_TEMP_IDX] = MT7915_MAX_TEMP;
35-
36 return 0;
37 }
38
39--
402.18.0
41