summaryrefslogtreecommitdiff
path: root/common/throttle_ap.c
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2020-06-09 11:08:36 -0600
committerCommit Bot <commit-bot@chromium.org>2020-06-11 19:11:52 +0000
commit7b2203f0e45e6dc653aec4bc4c5cd4b72e844b9f (patch)
tree2a135469400c4cbb3c5944ea5065c8fb5e0e5566 /common/throttle_ap.c
parentdf529a8b76057f59b0f9ce5db4ff840f4f577d33 (diff)
downloadchrome-ec-7b2203f0e45e6dc653aec4bc4c5cd4b72e844b9f.tar.gz
throttle_ap: Turn on fans during PROCHOT events
For platforms the monitor the PROCHOT signal as an input to the EC, turn on the fans at 100% duty cycle while PROCHOT is active. BUG=b:157916121 BRANCH=none TEST=make buildall TEST=On Volteer, force EC_PROCHOT_IN signal high, verify fan turns on. Verify fan reverts to automatic mode once PROCHOT clears. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Iba24daef4211d4b0d51833a569b78a9e40c71271 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2237917 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: caveh jalali <caveh@chromium.org>
Diffstat (limited to 'common/throttle_ap.c')
-rw-r--r--common/throttle_ap.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/common/throttle_ap.c b/common/throttle_ap.c
index 52b9c96127..8a4314db4d 100644
--- a/common/throttle_ap.c
+++ b/common/throttle_ap.c
@@ -8,6 +8,7 @@
#include "chipset.h"
#include "common.h"
#include "console.h"
+#include "dptf.h"
#include "hooks.h"
#include "host_command.h"
#include "task.h"
@@ -96,10 +97,18 @@ static void prochot_input_deferred(void)
debounced_prochot_in = prochot_in;
- if (debounced_prochot_in)
+ if (debounced_prochot_in) {
CPRINTS("External PROCHOT assertion detected");
- else
+#ifdef CONFIG_FANS
+ dptf_set_fan_duty_target(100);
+#endif
+ } else {
CPRINTS("External PROCHOT condition cleared");
+#ifdef CONFIG_FANS
+ /* Revert to automatic control of the fan */
+ dptf_set_fan_duty_target(-1);
+#endif
+ }
}
DECLARE_DEFERRED(prochot_input_deferred);