diff options
author | Randall Spangler <rspangler@chromium.org> | 2012-10-11 12:37:23 -0700 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-10-11 14:24:41 -0700 |
commit | 25c6574da67335b0a6ab36429cc2e3c7fe87afc0 (patch) | |
tree | f52ff17529f0b519d89c801023cdff6e40373ab8 | |
parent | 23fe5ed867b2811a84171755137021608dda5777 (diff) | |
download | chrome-ec-25c6574da67335b0a6ab36429cc2e3c7fe87afc0.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
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>
-rw-r--r-- | board/link/board_temp_sensor.c | 9 | ||||
-rw-r--r-- | common/temp_sensor.c | 17 | ||||
-rw-r--r-- | common/tmp006.c | 6 | ||||
-rw-r--r-- | include/tmp006.h | 1 |
4 files changed, 19 insertions, 14 deletions
diff --git a/board/link/board_temp_sensor.c b/board/link/board_temp_sensor.c index 96ef9050d3..304cc254b0 100644 --- a/board/link/board_temp_sensor.c +++ b/board/link/board_temp_sensor.c @@ -44,9 +44,8 @@ const struct temp_sensor_t temp_sensors[TEMP_SENSOR_COUNT] = { }; const struct tmp006_t tmp006_sensors[TMP006_COUNT] = { - /* TODO: Calibrate sensitivity factors. See crosbug.com/p/9599 */ - {"USB C", TEMP_USB_ADDR, 3.648 * 1e-14f}, - {"PCH D", TEMP_PCH_ADDR, 9.301 * 1e-14f}, - {"Hinge C", TEMP_HINGE_ADDR, -11.000 * 1e-14f}, - {"Charger D", TEMP_CHARGER_ADDR, 10.426 * 1e-14f}, + {"USB C", TEMP_USB_ADDR}, + {"PCH D", TEMP_PCH_ADDR}, + {"Hinge C", TEMP_HINGE_ADDR}, + {"Charger D", TEMP_CHARGER_ADDR}, }; 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; diff --git a/include/tmp006.h b/include/tmp006.h index 1ed9be03d8..3a1c47f49c 100644 --- a/include/tmp006.h +++ b/include/tmp006.h @@ -15,7 +15,6 @@ struct tmp006_t { const char* name; int addr; /* I2C address formed by TMP006_ADDR macro. */ - float S0; /* Sensitivity factor */ }; /** |