summaryrefslogtreecommitdiff
path: root/board/elemi/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/elemi/board.c')
-rw-r--r--board/elemi/board.c91
1 files changed, 54 insertions, 37 deletions
diff --git a/board/elemi/board.c b/board/elemi/board.c
index bb59308213..6bca0e577d 100644
--- a/board/elemi/board.c
+++ b/board/elemi/board.c
@@ -98,47 +98,64 @@ const struct fan_t fans[FAN_CH_COUNT] = {
* 130 C. However, sensor is located next to DDR, so we need to use the lower
* DDR temperature limit (85 C)
*/
-const static struct ec_thermal_config thermal_cpu = {
- .temp_host = {
- [EC_TEMP_THRESH_HIGH] = C_TO_K(68),
- [EC_TEMP_THRESH_HALT] = C_TO_K(70),
- },
- .temp_host_release = {
- [EC_TEMP_THRESH_HIGH] = C_TO_K(58),
- },
- .temp_fan_off = C_TO_K(40),
- .temp_fan_max = C_TO_K(60),
-};
+/*
+ * TODO(b/202062363): Remove when clang is fixed.
+ */
+#define THERMAL_CPU \
+ { \
+ .temp_host = { \
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(68), \
+ [EC_TEMP_THRESH_HALT] = C_TO_K(70), \
+ }, \
+ .temp_host_release = { \
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(58), \
+ }, \
+ .temp_fan_off = C_TO_K(40), \
+ .temp_fan_max = C_TO_K(60), \
+ }
+__maybe_unused static const struct ec_thermal_config thermal_cpu = THERMAL_CPU;
-const static struct ec_thermal_config thermal_charger = {
- .temp_host = {
- [EC_TEMP_THRESH_HIGH] = C_TO_K(78),
- [EC_TEMP_THRESH_HALT] = C_TO_K(80),
- },
- .temp_host_release = {
- [EC_TEMP_THRESH_HIGH] = C_TO_K(68),
- },
- .temp_fan_off = C_TO_K(40),
- .temp_fan_max = C_TO_K(70),
-};
+/*
+ * TODO(b/202062363): Remove when clang is fixed.
+ */
+#define THERMAL_CHARGER \
+ { \
+ .temp_host = { \
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(78), \
+ [EC_TEMP_THRESH_HALT] = C_TO_K(80), \
+ }, \
+ .temp_host_release = { \
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(68), \
+ }, \
+ .temp_fan_off = C_TO_K(40), \
+ .temp_fan_max = C_TO_K(70), \
+ }
+__maybe_unused static const struct ec_thermal_config thermal_charger =
+ THERMAL_CHARGER;
-const static struct ec_thermal_config thermal_regulator = {
- .temp_host = {
- [EC_TEMP_THRESH_HIGH] = C_TO_K(68),
- [EC_TEMP_THRESH_HALT] = C_TO_K(70),
- },
- .temp_host_release = {
- [EC_TEMP_THRESH_HIGH] = C_TO_K(58),
- },
- .temp_fan_off = C_TO_K(40),
- .temp_fan_max = C_TO_K(55),
-};
+/*
+ * TODO(b/202062363): Remove when clang is fixed.
+ */
+#define THERMAL_REGULATOR \
+ { \
+ .temp_host = { \
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(68), \
+ [EC_TEMP_THRESH_HALT] = C_TO_K(70), \
+ }, \
+ .temp_host_release = { \
+ [EC_TEMP_THRESH_HIGH] = C_TO_K(58), \
+ }, \
+ .temp_fan_off = C_TO_K(40), \
+ .temp_fan_max = C_TO_K(55), \
+ }
+__maybe_unused static const struct ec_thermal_config thermal_regulator =
+ THERMAL_REGULATOR;
struct ec_thermal_config thermal_params[] = {
- [TEMP_SENSOR_1_CHARGER] = thermal_charger,
- [TEMP_SENSOR_2_PP3300_REGULATOR] = thermal_regulator,
- [TEMP_SENSOR_3_DDR_SOC] = thermal_cpu,
- [TEMP_SENSOR_4_FAN] = thermal_cpu,
+ [TEMP_SENSOR_1_CHARGER] = THERMAL_CHARGER,
+ [TEMP_SENSOR_2_PP3300_REGULATOR] = THERMAL_REGULATOR,
+ [TEMP_SENSOR_3_DDR_SOC] = THERMAL_CPU,
+ [TEMP_SENSOR_4_FAN] = THERMAL_CPU,
};
BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT);