developer | c04f540 | 2023-02-03 09:22:26 +0800 | [diff] [blame] | 1 | From e4a095d551a5d2252887b88d064dee43fcb4149d Mon Sep 17 00:00:00 2001 |
developer | 83f6001 | 2023-01-19 13:58:51 +0800 | [diff] [blame] | 2 | From: Howard Hsu <howard-yh.hsu@mediatek.com> |
| 3 | Date: Thu, 19 Jan 2023 11:03:44 +0800 |
| 4 | Subject: [PATCH] wifi: mt76: mt7915: rework mt7915_thermal_init() |
| 5 | |
| 6 | If the kernel configuration "CONFIG_HWMON" is not set to Y, the |
| 7 | critial/maximum high temperature will not be initialised to the correct |
| 8 | setting. Rework mt7915_thermal_init to fix this. |
| 9 | --- |
| 10 | mt7915/init.c | 8 ++++---- |
| 11 | 1 file changed, 4 insertions(+), 4 deletions(-) |
| 12 | |
| 13 | diff --git a/mt7915/init.c b/mt7915/init.c |
developer | c04f540 | 2023-02-03 09:22:26 +0800 | [diff] [blame] | 14 | index ec297e04..8485a154 100644 |
developer | 83f6001 | 2023-01-19 13:58:51 +0800 | [diff] [blame] | 15 | --- a/mt7915/init.c |
| 16 | +++ b/mt7915/init.c |
developer | c04f540 | 2023-02-03 09:22:26 +0800 | [diff] [blame] | 17 | @@ -202,6 +202,10 @@ static int mt7915_thermal_init(struct mt7915_phy *phy) |
developer | 83f6001 | 2023-01-19 13:58:51 +0800 | [diff] [blame] | 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 | |
developer | c04f540 | 2023-02-03 09:22:26 +0800 | [diff] [blame] | 28 | @@ -210,10 +214,6 @@ static int mt7915_thermal_init(struct mt7915_phy *phy) |
developer | 83f6001 | 2023-01-19 13:58:51 +0800 | [diff] [blame] | 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 | -- |
| 40 | 2.18.0 |
| 41 | |