summaryrefslogtreecommitdiff
path: root/common/thermal.c
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2013-05-16 10:31:27 -0700
committerStéphane Marchesin <marcheu@chromium.org>2013-05-16 11:10:28 -0700
commit89e688a3325e91d3c59ac639f04f2c91019c9b10 (patch)
treeb0e87b13139d9dc9d5d09f5977ec18e7634713b1 /common/thermal.c
parentc58c01b14cd45550991be1624146bc813092d202 (diff)
downloadchrome-ec-89e688a3325e91d3c59ac639f04f2c91019c9b10.tar.gz
Revert "Add thermal engine test"
Time-scale functionality is temporarily reverted and this test is now taking too long. Revert this test now. Will add it back when we solve the time-scale issue. This reverts commit d9cf88b35ad211d873f48b41fd985e22ff049b83 Change-Id: Id9ce1071eb2114dd6968d3df9f0bce395edaeef6 Reviewed-on: https://gerrit.chromium.org/gerrit/51482 Commit-Queue: Vic Yang <victoryang@chromium.org> Tested-by: Vic Yang <victoryang@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Stéphane Marchesin <marcheu@chromium.org> Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Diffstat (limited to 'common/thermal.c')
-rw-r--r--common/thermal.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/common/thermal.c b/common/thermal.c
index 0015f5cca6..00970c6081 100644
--- a/common/thermal.c
+++ b/common/thermal.c
@@ -27,8 +27,7 @@
* temp_sensor_type. Threshold values for overheated action first (warning,
* prochot, power-down), followed by fan speed stepping thresholds.
*/
-test_export_static struct thermal_config_t
- thermal_config[TEMP_SENSOR_TYPE_COUNT] = {
+static struct thermal_config_t thermal_config[TEMP_SENSOR_TYPE_COUNT] = {
/* TEMP_SENSOR_TYPE_CPU */
{THERMAL_CONFIG_WARNING_ON_FAIL,
{373, 378, 383, 327, 335, 343, 351, 359} } ,
@@ -39,8 +38,8 @@ test_export_static struct thermal_config_t
};
/* Fan speed settings. Real max RPM is about 9300. */
-test_export_static const int fan_speed[THERMAL_FAN_STEPS + 1] =
- {0, 3000, 4575, 6150, 7725, -1};
+static const int fan_speed[THERMAL_FAN_STEPS + 1] = {0, 3000, 4575, 6150,
+ 7725, -1};
/* Number of consecutive overheated events for each temperature sensor. */
static int8_t ot_count[TEMP_SENSOR_COUNT][THRESHOLD_COUNT + THERMAL_FAN_STEPS];
@@ -160,9 +159,7 @@ static inline void update_and_check_stat(int temp,
const int16_t threshold = config->thresholds[threshold_id];
const int delay = temp_sensors[sensor_id].action_delay_sec;
- if (threshold <= 0) {
- ot_count[sensor_id][threshold_id] = 0;
- } else if (temp >= threshold) {
+ if (threshold > 0 && temp >= threshold) {
++ot_count[sensor_id][threshold_id];
if (ot_count[sensor_id][threshold_id] >= delay) {
ot_count[sensor_id][threshold_id] = delay;
@@ -177,6 +174,8 @@ static inline void update_and_check_stat(int temp,
* threshold causing overheated actions to trigger repeatedly.
*/
overheated[threshold_id] = 1;
+ } else {
+ ot_count[sensor_id][threshold_id] = 0;
}
}