summaryrefslogtreecommitdiff
path: root/board/eldrid
diff options
context:
space:
mode:
authorScott Chao <scott_chao@wistron.corp-partner.google.com>2021-03-03 11:48:46 +0800
committerCommit Bot <commit-bot@chromium.org>2021-03-03 17:30:33 +0000
commit90be32c398c45b8f441c9bb54743e369cc33bba5 (patch)
treea591e7c7e76e05dc3ee05ae059e467356e815d5b /board/eldrid
parent55709d8850459e63c641924fad8f2fabd33cd5e4 (diff)
downloadchrome-ec-90be32c398c45b8f441c9bb54743e369cc33bba5.tar.gz
eldrid: only logged when the fan speed level is changed
BUG=b:181695381 BRANCH=firmware-volteer-13672.B-master TEST=make buildall Signed-off-by: Scott Chao <scott_chao@wistron.corp-partner.google.com> Change-Id: Id16c9cef804a5d14ab35500e5fa18172c474710f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2731167 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'board/eldrid')
-rw-r--r--board/eldrid/thermal.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/board/eldrid/thermal.c b/board/eldrid/thermal.c
index ba8600a072..4f9ac8796b 100644
--- a/board/eldrid/thermal.c
+++ b/board/eldrid/thermal.c
@@ -135,6 +135,9 @@ int fan_table_to_rpm(int fan, int *temp)
{
/* current fan level */
static int current_level;
+ /* previous fan level */
+ static int prev_current_level;
+
/* previous sensor temperature */
static int prev_temp[TEMP_SENSOR_COUNT];
const int num_fan_levels = ARRAY_SIZE(fan_table);
@@ -149,8 +152,6 @@ int fan_table_to_rpm(int fan, int *temp)
* 3. invariant path. (return the current RPM)
*/
- CPRINTS("temp: %d, prev_temp: %d", temp[TEMP_SENSOR_3_DDR_SOC],
- prev_temp[TEMP_SENSOR_3_DDR_SOC]);
if (temp[TEMP_SENSOR_3_DDR_SOC] < prev_temp[TEMP_SENSOR_3_DDR_SOC]) {
for (i = current_level; i > 0; i--) {
if (temp[TEMP_SENSOR_3_DDR_SOC] <
@@ -173,10 +174,16 @@ int fan_table_to_rpm(int fan, int *temp)
if (current_level < 0)
current_level = 0;
+ if (current_level != prev_current_level) {
+ CPRINTS("temp: %d, prev_temp: %d", temp[TEMP_SENSOR_3_DDR_SOC],
+ prev_temp[TEMP_SENSOR_3_DDR_SOC]);
+ CPRINTS("current_level: %d", current_level);
+ }
+
for (i = 0; i < TEMP_SENSOR_COUNT; ++i)
prev_temp[i] = temp[i];
- CPRINTS("current_level: %d", current_level);
+ prev_current_level = current_level;
switch (fan) {
case FAN_CH_0: