From 7b2203f0e45e6dc653aec4bc4c5cd4b72e844b9f Mon Sep 17 00:00:00 2001 From: Keith Short Date: Tue, 9 Jun 2020 11:08:36 -0600 Subject: 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 Change-Id: Iba24daef4211d4b0d51833a569b78a9e40c71271 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2237917 Reviewed-by: Abe Levkoy Reviewed-by: caveh jalali --- common/throttle_ap.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'common/throttle_ap.c') 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); -- cgit v1.2.1