diff options
author | Vic Yang <victoryang@chromium.org> | 2013-05-16 10:31:27 -0700 |
---|---|---|
committer | Stéphane Marchesin <marcheu@chromium.org> | 2013-05-16 11:10:28 -0700 |
commit | 89e688a3325e91d3c59ac639f04f2c91019c9b10 (patch) | |
tree | b0e87b13139d9dc9d5d09f5977ec18e7634713b1 /common | |
parent | c58c01b14cd45550991be1624146bc813092d202 (diff) | |
download | chrome-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')
-rw-r--r-- | common/temp_sensor.c | 2 | ||||
-rw-r--r-- | common/thermal.c | 13 |
2 files changed, 7 insertions, 8 deletions
diff --git a/common/temp_sensor.c b/common/temp_sensor.c index e33d787b9c..3079e3b2a8 100644 --- a/common/temp_sensor.c +++ b/common/temp_sensor.c @@ -24,7 +24,7 @@ /* Default temperature to report in mapped memory */ #define MAPPED_TEMP_DEFAULT (296 - EC_TEMP_SENSOR_OFFSET) -test_mockable int temp_sensor_read(enum temp_sensor_id id, int *temp_ptr) +int temp_sensor_read(enum temp_sensor_id id, int *temp_ptr) { const struct temp_sensor_t *sensor; 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; } } |