summaryrefslogtreecommitdiff
path: root/common/thermal.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-10-11 10:23:16 -0700
committerGerrit <chrome-bot@google.com>2012-10-11 13:47:17 -0700
commit8f2e99da75152c428c6c92b20a13a62a5fcb40d1 (patch)
treec2d3dc52372a79a03c2d503c55ead568c066a7e1 /common/thermal.c
parentd1bebbbe66f78d2dcfb9380456a80e7c2f26a662 (diff)
downloadchrome-ec-8f2e99da75152c428c6c92b20a13a62a5fcb40d1.tar.gz
link: Temp sensor read can return an error code
This will be used in a follow-up CL to return specific error codes (not powered, not calibrated, etc.) BUG=chrome-os-partner:15174 BRANCH=link TEST=manual Power on system. 'temps' should return all good temps. Power off system (into S5) Only ECInternal temp should work; others should return Error 1 'gpioset enable_vs 1' and wait a second Now all the I2C temps should display good data, but PECI will still be error 1. Change-Id: I925434e71653ad53ad76bad992a7a8fdeadb088c Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35286 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'common/thermal.c')
-rw-r--r--common/thermal.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/common/thermal.c b/common/thermal.c
index 3f570be058..6b4f3fa355 100644
--- a/common/thermal.c
+++ b/common/thermal.c
@@ -188,14 +188,13 @@ static void thermal_process(void)
if (!temp_sensor_powered(i))
continue;
- cur_temp = temp_sensor_read(i);
-
- /* Sensor failure. */
- if (cur_temp == -1) {
+ if (temp_sensor_read(i, &cur_temp)) {
+ /* Sensor failure. */
if (flag & THERMAL_CONFIG_WARNING_ON_FAIL)
smi_sensor_failure_warning();
continue;
}
+
for (j = 0; j < THRESHOLD_COUNT + THERMAL_FAN_STEPS; ++j)
update_and_check_stat(cur_temp, i, j);
}