blob: 0494b402d2bda4aa45f2f6ad9817ce03086acf4c [file] [log] [blame]
developerc04f5402023-02-03 09:22:26 +08001From e4a095d551a5d2252887b88d064dee43fcb4149d Mon Sep 17 00:00:00 2001
developer83f60012023-01-19 13:58:51 +08002From: 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
developerc04f5402023-02-03 09:22:26 +080014index ec297e04..8485a154 100644
developer83f60012023-01-19 13:58:51 +080015--- a/mt7915/init.c
16+++ b/mt7915/init.c
developerc04f5402023-02-03 09:22:26 +080017@@ -202,6 +202,10 @@ static int mt7915_thermal_init(struct mt7915_phy *phy)
developer83f60012023-01-19 13:58:51 +080018 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
developerc04f5402023-02-03 09:22:26 +080028@@ -210,10 +214,6 @@ static int mt7915_thermal_init(struct mt7915_phy *phy)
developer83f60012023-01-19 13:58:51 +080029 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