diff options
-rw-r--r-- | board/link/board_temp_sensor.c | 9 | ||||
-rw-r--r-- | common/tmp006.c | 3 | ||||
-rw-r--r-- | include/tmp006.h | 2 |
3 files changed, 9 insertions, 5 deletions
diff --git a/board/link/board_temp_sensor.c b/board/link/board_temp_sensor.c index 91b3d1ba4c..4534f0ba05 100644 --- a/board/link/board_temp_sensor.c +++ b/board/link/board_temp_sensor.c @@ -56,8 +56,9 @@ const struct temp_sensor_t temp_sensors[TEMP_SENSOR_COUNT] = { }; const struct tmp006_t tmp006_sensors[TMP006_COUNT] = { - {"CPU", TEMP_CPU_ADDR}, - {"PCH", TEMP_PCH_ADDR}, - {"DDR", TEMP_DDR_ADDR}, - {"Charger", TEMP_CHARGER_ADDR}, + /* TODO: Calibrate sensitivity factors. See crosbug.com/p/9599 */ + {"CPU", TEMP_CPU_ADDR, 2771}, + {"PCH", TEMP_PCH_ADDR, 4762}, + {"DDR", TEMP_DDR_ADDR, 6400}, + {"Charger", TEMP_CHARGER_ADDR, 7154}, }; diff --git a/common/tmp006.c b/common/tmp006.c index 18882c5fde..819ecda7c2 100644 --- a/common/tmp006.c +++ b/common/tmp006.c @@ -160,7 +160,8 @@ static int tmp006_read_object_temp(int idx) v); /* TODO: Calibrate the sensitivity factor. */ - return tmp006_calculate_object_temp(t, v, 6400) / 100; + return tmp006_calculate_object_temp(t, v, + tmp006_sensors[idx].sens) / 100; } static int tmp006_poll_sensor(int sensor_id) diff --git a/include/tmp006.h b/include/tmp006.h index 1d6e07ffdd..6d8b26857d 100644 --- a/include/tmp006.h +++ b/include/tmp006.h @@ -16,6 +16,8 @@ struct tmp006_t { const char* name; /* I2C address formed by TMP006_ADDR macro. */ int addr; + /* Sensitivity factor, in 10^11. */ + int sens; }; /* Poll all TMP006 sensors. Return 0 on success. */ |