summaryrefslogtreecommitdiff
path: root/include/ec_commands.h
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@google.com>2017-06-29 07:14:58 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-06-30 03:08:42 -0700
commitbbb759ceaa843f548f90c35d1668e17c8879bad3 (patch)
tree7e1b84d8cd73740c01d3cad2398666581f16cee4 /include/ec_commands.h
parent5e5788f3cac7fecd45072807bb6a79ce2b767961 (diff)
downloadchrome-ec-bbb759ceaa843f548f90c35d1668e17c8879bad3.tar.gz
Add support for reporting device events
In order to report specific wake events from differernt devices add a host command that allows setting device event mask, and triggering a host event when that device event is set. This is done as a separate command and mask because we are running out of host events, and it takes over the unused thermal overload event that was never used in EC or BIOS. The first use case for this is platforms that have AP wake events that go to the EC, for instance devices that use Deep S3 and have a limited set of wake pins. (such as Eve) This allows the AP to determine the exact wake source for an event so it can be logged and acted on by the AP if necessary. BUG=b:36024430 BRANCH=eve TEST=manual testing on eve with trackpad and dsp wake events Change-Id: I48d94014c00dc1dad098ab96af0ddc7860229762 Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/555632 Reviewed-by: Scott Collyer <scollyer@chromium.org>
Diffstat (limited to 'include/ec_commands.h')
-rw-r--r--include/ec_commands.h35
1 files changed, 34 insertions, 1 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h
index 61bfa345fe..3bc98ae31a 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -502,7 +502,8 @@ enum host_event_code {
EC_HOST_EVENT_BATTERY_CRITICAL = 7,
EC_HOST_EVENT_BATTERY = 8,
EC_HOST_EVENT_THERMAL_THRESHOLD = 9,
- EC_HOST_EVENT_THERMAL_OVERLOAD = 10,
+ /* Event generated by a device attached to the EC */
+ EC_HOST_EVENT_DEVICE = 10,
EC_HOST_EVENT_THERMAL = 11,
EC_HOST_EVENT_USB_CHARGER = 12,
EC_HOST_EVENT_KEY_PRESSED = 13,
@@ -1086,6 +1087,8 @@ enum ec_feature_code {
EC_FEATURE_TOUCHPAD = 29,
/* The MCU has RWSIG task enabled */
EC_FEATURE_RWSIG = 30,
+ /* EC has device events support */
+ EC_FEATURE_DEVICE_EVENT = 31,
};
#define EC_FEATURE_MASK_0(event_code) (1UL << (event_code % 32))
@@ -3525,6 +3528,36 @@ struct __ec_align1 ec_params_host_sleep_event {
};
/*****************************************************************************/
+/* Device events */
+#define EC_CMD_DEVICE_EVENT 0x00AA
+
+enum ec_device_event {
+ EC_DEVICE_EVENT_TRACKPAD,
+ EC_DEVICE_EVENT_DSP,
+ EC_DEVICE_EVENT_WIFI,
+};
+
+enum ec_device_event_param {
+ /* Get and clear pending device events */
+ EC_DEVICE_EVENT_PARAM_GET_CURRENT_EVENTS,
+ /* Get device event mask */
+ EC_DEVICE_EVENT_PARAM_GET_ENABLED_EVENTS,
+ /* Set device event mask */
+ EC_DEVICE_EVENT_PARAM_SET_ENABLED_EVENTS,
+};
+
+#define EC_DEVICE_EVENT_MASK(event_code) (1UL << (event_code % 32))
+
+struct __ec_align_size1 ec_params_device_event {
+ uint32_t event_mask;
+ uint8_t param;
+};
+
+struct __ec_align4 ec_response_device_event {
+ uint32_t event_mask;
+};
+
+/*****************************************************************************/
/* Smart battery pass-through */
/* Get / Set 16-bit smart battery registers */