diff options
author | Vic Yang <victoryang@chromium.org> | 2012-02-27 13:41:32 -0800 |
---|---|---|
committer | Vic Yang <victoryang@chromium.org> | 2012-02-28 16:51:54 -0800 |
commit | 13b5c41951c2da3e90ac115a3dbe8aaddb959782 (patch) | |
tree | 60737feac456fc38c591d8d209b295fe7fcaa660 /include/thermal.h | |
parent | b2b5455f327804bd1f72b3c617745fd5c5ca086b (diff) | |
download | chrome-ec-13b5c41951c2da3e90ac115a3dbe8aaddb959782.tar.gz |
Thermal Engine
The thermal engine monitors the temperature readings from all sensors.
For each sensor, five threshold temperatures can be set:
1. Low fan speed.
2. High fan speed.
3. SMI warning.
4. Shutdown CPU.
5. Shutdown everything we can.
Each of these thresholds can be set to either a fixed value or disabled.
Currently the real implementation of SMI warning and shutting down is
left as TODO, as indicated in the comment.
Signed-off-by: Vic Yang <victoryang@chromium.org>
BUG=chrome-os-partner:8250
TEST=Manually change threshold value to test all actions can be triggered.
Change-Id: If168dcff78ef2d7a3203cb227e1739a08eca961e
Diffstat (limited to 'include/thermal.h')
-rw-r--r-- | include/thermal.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/include/thermal.h b/include/thermal.h new file mode 100644 index 0000000000..aa6cc08f4f --- /dev/null +++ b/include/thermal.h @@ -0,0 +1,50 @@ +/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* Thermal engine module for Chrome EC */ + +#ifndef __CROS_EC_THERMAL_H +#define __CROS_EC_THERMAL_H + +#include "util.h" + +#define THERMAL_CONFIG_NO_FLAG 0x0 +#define THERMAL_CONFIG_WARNING_ON_FAIL 0x1 +#define THERMAL_CONFIG_NEED_VS 0x2 +#define THERMAL_CONFIG_NEED_CPU 0x4 + +/* Set a threshold temperature to this value to disable the threshold limit. */ +#define THERMAL_THRESHOLD_DISABLE 0 + +/* This macro is used to disable all threshold for a sensor. + * The value 0 expands to all field in the array 'thresholds'. Change this + * if THERMAL_THRESHOLD_DISABLE is no longer 0. + */ +#define THERMAL_THRESHOLD_DISABLE_ALL 0 + +enum thermal_threshold { + /* Low fan speed */ + THRESHOLD_FAN_LO = 0, + /* High fan speed */ + THRESHOLD_FAN_HI, + /* Issue overheating warning */ + THRESHOLD_WARNING, + /* Shut down CPU */ + THRESHOLD_CPU_DOWN, + /* Shut down everything we can */ + THRESHOLD_POWER_DOWN, + + THRESHOLD_COUNT +}; + +/* Configuration for temperature sensor. Temperature value in degree K. */ +struct thermal_config_t { + /* Configuration flags. */ + int8_t config_flags; + /* Threshold temperatures. */ + int16_t thresholds[THRESHOLD_COUNT]; +}; + +#endif /* __CROS_EC_THERMAL_H */ |