summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/extpower_falco.c10
-rw-r--r--include/ec_commands.h5
2 files changed, 15 insertions, 0 deletions
diff --git a/common/extpower_falco.c b/common/extpower_falco.c
index dec406703b..4f2daedeaf 100644
--- a/common/extpower_falco.c
+++ b/common/extpower_falco.c
@@ -185,9 +185,19 @@ bad:
CPRINTF("[%T ERROR: can't talk to charger: %d]\n", r);
}
+/* FIXME: There's already a chipset_throttle_cpu() function. However, it's a
+ * fairly large hammer - on x86, it just asserts PROCHOT. That's less than
+ * ideal for the turbo boost charger stuff. We might want to make this
+ * function generic enough to use from other places. For now, meh. */
test_export_static int ap_is_throttled;
static void set_throttle(int on)
{
+ if (on)
+ host_set_events(EC_HOST_EVENT_MASK(
+ EC_HOST_EVENT_THROTTLE_START));
+ else
+ host_set_events(EC_HOST_EVENT_MASK(
+ EC_HOST_EVENT_THROTTLE_STOP));
ap_is_throttled = on;
}
diff --git a/include/ec_commands.h b/include/ec_commands.h
index de1d9a870a..b9d3a8a2f7 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -243,6 +243,11 @@ enum host_event_code {
/* Shutdown due to battery level too low */
EC_HOST_EVENT_BATTERY_SHUTDOWN = 17,
+ /* Suggest that the AP throttle itself */
+ EC_HOST_EVENT_THROTTLE_START = 18,
+ /* Suggest that the AP resume normal speed */
+ EC_HOST_EVENT_THROTTLE_STOP = 19,
+
/*
* The high bit of the event mask is not used as a host event code. If
* it reads back as set, then the entire event mask should be