summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2018-07-16 12:22:54 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-07-17 21:53:37 -0700
commita8d34b791540534d6e45aac719cee0e72ce79824 (patch)
treeea3962e89a34a392d1d1e16a063e055955fbc174 /test
parent9b7ce9c9dbdb5eb858757dc61a55bb98749019b0 (diff)
downloadchrome-ec-a8d34b791540534d6e45aac719cee0e72ce79824.tar.gz
fan: Enable fan control on AP startup not on shutdown/suspend
There is no need to cool CPU in S3 or S5. We currently don't have fans for a charging system (i.e. a battery or a charger chip). Battery management systems control charge current based on its own temperature readings. Thus, we do not need to keep fans running in S3/S5. Even with a fan for a charging system, it's questionable to run a fan in S3/S5. Under a heated condition, spinning a fan would create more heat as a fan draws current from a battery and the ambient air is hot. With this patch, EC disables fan control when entering S3/S5 (though fan control would be already disabled if DPTF is used). It also makes EC enables fan control when AP starts (for BIOS and OS if DPTF isn't used). Signee-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=none BRANCH=none TEST=Verify fan spins in S0 and stops in S3/S5. Fan is controled by EC in BIOS and by DPTF in OS after warm and cold reboot. Run make run-fan. Change-Id: Idb4610303e65f7fd4d6b24a0dfe511cd629bf6a7 Reviewed-on: https://chromium-review.googlesource.com/1138822 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'test')
-rw-r--r--test/fan.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/fan.c b/test/fan.c
index 6082de1553..c5e4c32fd8 100644
--- a/test/fan.c
+++ b/test/fan.c
@@ -22,6 +22,8 @@
/*****************************************************************************/
/* Tests */
+void set_thermal_control_enabled(int fan, int enable);
+
static int test_fan(void)
{
/* "actual" fan speed from board/host/fan.c */
@@ -32,6 +34,8 @@ static int test_fan(void)
/* With nothing else to do, fans default to full-on */
TEST_ASSERT(fan_get_rpm_actual(0) == FAN_RPM(0)->rpm_max);
+ set_thermal_control_enabled(0, 1);
+
/*
* fan_set_percent_needed() is normally called once a second by the
* thermal task, but we're not using a thermal test in this test so