summaryrefslogtreecommitdiff
path: root/include/host_command.h
diff options
context:
space:
mode:
authorJenny TC <jenny.tc@intel.com>2017-11-22 09:58:19 +0530
committerchrome-bot <chrome-bot@chromium.org>2017-12-06 03:45:57 -0800
commit67c31eb10bc1ce6e559562aedd2f641de4243bb8 (patch)
tree506d18fd02ac83ec2e89282366a11378c56c984e /include/host_command.h
parentfb32b6d30cf55408f4bdb36b729c99452f6e8e11 (diff)
downloadchrome-ec-67c31eb10bc1ce6e559562aedd2f641de4243bb8.tar.gz
host_events: Introduce unified host event command
Unified Host Event Programming Interface (UHEPI) enables a unified host command EC_CMD_PROGRAM_HOST_EVENT to set/get/clear different host events. Old host event commands (0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F) is supported for backward compatibility. But newer version of BIOS/OS is expected to use UHEPI command (EC_CMD_PROGRAM_HOST_EVENT) The UHEPI also enables the active and lazy wake masks. Active wake mask is the mask that is programmed in the LPC driver (i.e. the mask that is actively used by LPC driver for waking the host during suspended state). It is same as the current wake mask that is set by the smihandler on host just before entering sleep state S3/S5. On the other hand, lazy wake masks are per-sleep masks (S0ix, S3, S5) so that they can be used by EC to set the active wake mask depending upon the type of sleep that the host has entered. This allows the host BIOS to perform one-time programming of the wake masks for each supported sleep type and then EC can take care of appropriately setting the active mask when host enters a particular sleep state. BRANCH=none BUG=b:63969337 TEST=make buildall -j. And verfieid following scenario 1). Verified wake masks with ec hostevent command on S0,S3,S5 and S0ix 2). suspend_stress_test with S3 and S0ix 3). Verified "mosys eventlog list" in S3 and s0ix resume to confirm wake sources (Lid, power buttton and Mode change) 4). Verified "mosys eventlog list" in S5 resume to confirm wake sources (Power Button) 5). Verified above scenarios with combination of Old BIOS + New EC and New BIOS + Old EC(making get_feature_flags1() return 0) Change-Id: Idb82ee87fffb475cd3fa9771bf7a5efda67af616 Signed-off-by: Jenny TC <jenny.tc@intel.com> Reviewed-on: https://chromium-review.googlesource.com/576047 Commit-Ready: Jenny Tc <jenny.tc@intel.com> Commit-Ready: Jenny Tc <jenny.tc@intel.corp-partner.google.com> Tested-by: Jenny Tc <jenny.tc@intel.com> Tested-by: Jenny Tc <jenny.tc@intel.corp-partner.google.com> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Diffstat (limited to 'include/host_command.h')
-rw-r--r--include/host_command.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/host_command.h b/include/host_command.h
index 6fdbc639e9..f83ffcc616 100644
--- a/include/host_command.h
+++ b/include/host_command.h
@@ -10,6 +10,7 @@
#include "common.h"
#include "ec_commands.h"
+enum power_state;
/* Args for host command handler */
struct host_cmd_handler_args {
@@ -182,6 +183,28 @@ host_event_t host_get_events(void);
* @return true if <event> is set or false otherwise
*/
int host_is_event_set(enum host_event_code event);
+
+#ifdef CONFIG_LPC
+
+/*
+ * Get lazy wake masks for the sleep state provided
+ *
+ * @param state Sleep state
+ * @param mask Lazy wake mask.
+ *
+ * @return EC_SUCCESS for success and EC_ERROR_INVAL for error
+ */
+
+int get_lazy_wake_mask(enum power_state state, host_event_t *mask);
+
+/*
+ * Check if active wake mask set by host
+ *
+ *
+ * @return 1 if active wake mask set by host else return 0
+ */
+uint8_t lpc_is_active_wm_set_by_host(void);
+#endif
#endif
/**