summaryrefslogtreecommitdiff
path: root/board/gimble/sensors.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/gimble/sensors.c')
-rw-r--r--board/gimble/sensors.c57
1 files changed, 32 insertions, 25 deletions
diff --git a/board/gimble/sensors.c b/board/gimble/sensors.c
index 3468e3eb35..07f18950f0 100644
--- a/board/gimble/sensors.c
+++ b/board/gimble/sensors.c
@@ -316,17 +316,20 @@ BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
* 130 C. However, sensor is located next to DDR, so we need to use the lower
* DDR temperature limit (85 C)
*/
-static const struct ec_thermal_config thermal_cpu = {
- .temp_host = {
- [EC_TEMP_THRESH_HIGH] = C_TO_K(70),
- [EC_TEMP_THRESH_HALT] = C_TO_K(80),
- },
- .temp_host_release = {
- [EC_TEMP_THRESH_HIGH] = C_TO_K(65),
- },
- .temp_fan_off = C_TO_K(35),
- .temp_fan_max = C_TO_K(50),
-};
+/*
+ * TODO(b/202062363): Remove when clang is fixed.
+ */
+#define THERMAL_CPU \
+ { \
+ .temp_host = { \
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(70), \
+ [EC_TEMP_THRESH_HALT] = C_TO_K(80), \
+ }, \
+ .temp_host_release = { \
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(65), \
+ }, \
+ }
+__maybe_unused static const struct ec_thermal_config thermal_cpu = THERMAL_CPU;
/*
* TODO(b/194318801): confirm thermal limits setting for gimble
@@ -341,23 +344,27 @@ static const struct ec_thermal_config thermal_cpu = {
* Inductors: limit of 125c
* PCB: limit is 80c
*/
-static const struct ec_thermal_config thermal_inductor = {
- .temp_host = {
- [EC_TEMP_THRESH_HIGH] = C_TO_K(75),
- [EC_TEMP_THRESH_HALT] = C_TO_K(80),
- },
- .temp_host_release = {
- [EC_TEMP_THRESH_HIGH] = C_TO_K(65),
- },
- .temp_fan_off = C_TO_K(40),
- .temp_fan_max = C_TO_K(55),
-};
+/*
+ * TODO(b/202062363): Remove when clang is fixed.
+ */
+#define THERMAL_INDUCTOR \
+ { \
+ .temp_host = { \
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(75), \
+ [EC_TEMP_THRESH_HALT] = C_TO_K(80), \
+ }, \
+ .temp_host_release = { \
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(65), \
+ }, \
+ }
+__maybe_unused static const struct ec_thermal_config thermal_inductor =
+ THERMAL_INDUCTOR;
/* this should really be "const" */
struct ec_thermal_config thermal_params[] = {
- [TEMP_SENSOR_1_DDR_SOC] = thermal_cpu,
+ [TEMP_SENSOR_1_DDR_SOC] = THERMAL_CPU,
/* TODO(b/194318801): confirm thermal limits setting for gimble */
- [TEMP_SENSOR_2_FAN] = thermal_inductor,
- [TEMP_SENSOR_3_CHARGER] = thermal_inductor,
+ [TEMP_SENSOR_2_FAN] = THERMAL_INDUCTOR,
+ [TEMP_SENSOR_3_CHARGER] = THERMAL_INDUCTOR,
};
BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT);