summaryrefslogtreecommitdiff
path: root/zephyr/program/skyrim/frostflow/src/thermal.c
diff options
context:
space:
mode:
authorPeter Marheine <pmarheine@chromium.org>2023-02-16 00:14:21 +0000
committerPeter Marheine <pmarheine@chromium.org>2023-02-16 00:14:21 +0000
commitf43d6df6f2860dbe8ec15aebdc28890771ad7897 (patch)
tree6877eff7016f9979e46017ea5221a16d36344304 /zephyr/program/skyrim/frostflow/src/thermal.c
parentdce247e97903a2464ff8884106bffa43587c1dcb (diff)
parent0849542c72359150a357945c010dca6b5a213633 (diff)
downloadchrome-ec-f43d6df6f2860dbe8ec15aebdc28890771ad7897.tar.gz
Merge remote-tracking branch cros/main into firmware-nissa-15217.B-mainfirmware-nissa-15217.126.B-main
Generated by: ./util/update_release_branch.py --zephyr --board nissa firmware- nissa-15217.B-main Relevant changes: git log --oneline dce247e979..0849542c72 -- zephyr/program/nissa util/getversion.sh 0849542c72 zephyr: add sleep property for keyboard factory test 5825d894b9 nissa: disable PLATFORM_EC_TCPC_INTERRUPT 25a400690f yavikso: Update fan table version 3 9263f14536 zephyr: remove shi node and add references to shi0 b40c6970d3 Craask: Charger limit for 65w adapter 6fd2d3ea6c zephyr: add comments for tcpc driver 00986ffb1c zephyr: move usbc interrupt handler to shim 2508094b14 yaviks: reduce RW image size (64KB) 55b6aaf52f yaviks: enable keyboard factory test 4786d1eac6 nissa: Add ocpc init function to Nissa boards 2ae1083638 zephyr: cros_kb: set KSI/KSO kbs mode by pinctrl driver d415f4665a yaviks: Fix OCPC Vsys overshooting 93f9d42a7c zephyr: config: drop few more redundant options BRANCH=None BUG=b:254148652 b:260762509 b:265220075 b:268273712 b:265763662 BUG=b:253557900 b:254148652 b:269212593 b:267404783 b:262352202 TEST=`make -j buildall` Force-Relevant-Builds: all Change-Id: I195dd82af114180b611f9afd1465a69f7f43d417 Signed-off-by: Peter Marheine <pmarheine@chromium.org>
Diffstat (limited to 'zephyr/program/skyrim/frostflow/src/thermal.c')
-rw-r--r--zephyr/program/skyrim/frostflow/src/thermal.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/zephyr/program/skyrim/frostflow/src/thermal.c b/zephyr/program/skyrim/frostflow/src/thermal.c
index 59110dd35e..101823cc26 100644
--- a/zephyr/program/skyrim/frostflow/src/thermal.c
+++ b/zephyr/program/skyrim/frostflow/src/thermal.c
@@ -12,7 +12,7 @@
#include "thermal.h"
#include "util.h"
-#define TEMP_AMB TEMP_SENSOR_ID(DT_NODELABEL(temp_amb))
+#define TEMP_MEM TEMP_SENSOR_ID(DT_NODELABEL(temp_sensor_memory))
struct fan_step {
/*
@@ -68,17 +68,17 @@ int fan_table_to_rpm(int fan, int *temp)
* 3. invariant path. (return the current RPM)
*/
- if (temp[TEMP_AMB] < prev_tmp[TEMP_AMB]) {
+ if (temp[TEMP_MEM] < prev_tmp[TEMP_MEM]) {
for (i = current_level; i > 0; i--) {
- if (temp[TEMP_AMB] < fan_step_table[i].off[TEMP_AMB])
+ if (temp[TEMP_MEM] <= fan_step_table[i].off[TEMP_MEM])
current_level = i - 1;
else
break;
}
- } else if (temp[TEMP_AMB] > prev_tmp[TEMP_AMB]) {
+ } else if (temp[TEMP_MEM] > prev_tmp[TEMP_MEM]) {
for (i = current_level; i < NUM_FAN_LEVELS; i++) {
- if (temp[TEMP_AMB] > fan_step_table[i].on[TEMP_AMB])
- current_level = i + 1;
+ if (temp[TEMP_MEM] >= fan_step_table[i].on[TEMP_MEM])
+ current_level = i;
else
break;
}