diff options
author | Randall Spangler <rspangler@chromium.org> | 2012-10-11 12:37:23 -0700 |
---|---|---|
committer | Rong Chang <rongchang@chromium.org> | 2012-10-16 01:00:23 -0700 |
commit | 829bc77c375eb40717a9bbdf00884a20469d0794 (patch) | |
tree | 1d4118b04cf70c64b6e790829086aa210b154f15 /common | |
parent | f91a593f178ba18e3deba8351cd82e36a2f7aada (diff) | |
download | chrome-ec-829bc77c375eb40717a9bbdf00884a20469d0794.tar.gz |
link: TMP006 S0 param is uncalibrated by default
S0 values are incorrect and may even need to be calibrated on a
per-system basis. Set them to 0 by default so that the EC doesn't
return inaccurate remote temperature readings before calibration data
is sent.
BUG=chrome-os-partner:15174
BRANCH=link
TEST=manual
- temps -> remote temps are all not calibrated
- t6cal 1 s0 9301
- temps -> PCH D-Object temp now returns a temperature
Original-Change-Id: I43facc60cf947ebd9441a8a629a76f7ffc8f3959
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/35302
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
(cherry picked from commit 25c6574da67335b0a6ab36429cc2e3c7fe87afc0)
Change-Id: I866251e0b8d886e1c531ee5a211674a8e16dc217
Reviewed-on: https://gerrit.chromium.org/gerrit/35672
Reviewed-by: Rong Chang <rongchang@chromium.org>
Tested-by: Rong Chang <rongchang@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/temp_sensor.c | 17 | ||||
-rw-r--r-- | common/tmp006.c | 6 |
2 files changed, 15 insertions, 8 deletions
diff --git a/common/temp_sensor.c b/common/temp_sensor.c index 799f4f609e..7f5a5e7a53 100644 --- a/common/temp_sensor.c +++ b/common/temp_sensor.c @@ -139,11 +139,22 @@ static int command_temps(int argc, char **argv) for (i = 0; i < TEMP_SENSOR_COUNT; ++i) { ccprintf(" %-20s: ", temp_sensors[i].name); rv = temp_sensor_read(i, &t); - if (rv) { - ccprintf("Error %d\n", rv); + if (rv) rv1 = rv; - } else + + switch (rv) { + case EC_SUCCESS: ccprintf("%d K = %d C\n", t, t - 273); + break; + case EC_ERROR_NOT_POWERED: + ccprintf("Not powered\n"); + break; + case EC_ERROR_NOT_CALIBRATED: + ccprintf("Not calibrated\n"); + break; + default: + ccprintf("Error %d\n", rv); + } } return rv1; diff --git a/common/tmp006.c b/common/tmp006.c index 93d4d8c0de..3ad4772995 100644 --- a/common/tmp006.c +++ b/common/tmp006.c @@ -258,11 +258,7 @@ static int tmp006_init(void) /* Report error until we actually read the sensor */ tdata->fail = FAIL_INIT; - /* - * TODO: remove default calibration data; sensor should fail - * until calibrated by host or console command. - */ - tdata->s0 = tmp006_sensors[i].S0; + /* Use defaults for Bn params */ tdata->b0 = B0; tdata->b1 = B1; tdata->b2 = B2; |