summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-09-19 16:55:40 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-09-23 21:26:26 +0000
commit6277f7e336f0dc96b676905a4c420f9d53951603 (patch)
treeb61b823d7e3dda48182ba927c4e8eb6bcce9fe26
parent61c40db16c0a5c03c9e2c25dfbf1e5e4645364bf (diff)
downloadchrome-ec-6277f7e336f0dc96b676905a4c420f9d53951603.tar.gz
Fix thermal.c compilation if fans are not present.
Currently, it doesn't compile unless CONFIG_FAN is defined. BUG=chrome-os-partner:22803 BRANCH=none TEST=temporarily undefine CONFIG_FAN in board/link/board.h; code compiles and all unit tests pass Change-Id: I251d670ccd299f7a50b1455364a817e07fad4cb1 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/170106
-rw-r--r--chip/lm4/fan.c2
-rw-r--r--common/thermal.c2
-rw-r--r--test/test_config.h6
3 files changed, 9 insertions, 1 deletions
diff --git a/chip/lm4/fan.c b/chip/lm4/fan.c
index cf109573ff..663bcdab1d 100644
--- a/chip/lm4/fan.c
+++ b/chip/lm4/fan.c
@@ -134,7 +134,7 @@ static void fan_set_thermal_control_enabled(int enable)
}
/* The thermal task will only call this function with pct in [0,100]. */
-void pwm_fan_set_percent_needed(int pct)
+test_mockable void pwm_fan_set_percent_needed(int pct)
{
int rpm;
diff --git a/common/thermal.c b/common/thermal.c
index c51b5dc01a..c6c49868d2 100644
--- a/common/thermal.c
+++ b/common/thermal.c
@@ -146,8 +146,10 @@ static void thermal_control(void)
throttle_ap(THROTTLE_OFF, THROTTLE_SOFT, THROTTLE_SRC_THERMAL);
}
+#ifdef CONFIG_FAN
/* Max fan needed is what's needed. */
pwm_fan_set_percent_needed(fmax);
+#endif
}
/* Wait until after the sensors have been read */
diff --git a/test/test_config.h b/test/test_config.h
index 0310e80e40..28aedd1474 100644
--- a/test/test_config.h
+++ b/test/test_config.h
@@ -32,6 +32,9 @@ int board_discharge_on_ac(int enabled);
#ifdef TEST_thermal
#define CONFIG_CHIPSET_CAN_THROTTLE
+#define CONFIG_FAN
+#define CONFIG_FAN_RPM_MAX 5000
+#define CONFIG_FAN_RPM_MIN 1000
#define CONFIG_TEMP_SENSOR
#endif
@@ -42,6 +45,9 @@ int board_discharge_on_ac(int enabled);
#define CONFIG_CHARGER_INPUT_CURRENT 4032
#define CONFIG_CHIPSET_CAN_THROTTLE
#define CONFIG_EXTPOWER_FALCO
+#define CONFIG_FAN
+#define CONFIG_FAN_RPM_MAX 5000
+#define CONFIG_FAN_RPM_MIN 1000
#define CONFIG_TEMP_SENSOR
#define I2C_PORT_BATTERY 1
#define I2C_PORT_CHARGER 1