summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2021-11-09 17:37:01 -0600
committerCommit Bot <commit-bot@chromium.org>2021-11-18 04:52:35 +0000
commit241c9c97331146473ba5c4cc2ba349b59b0e2ffc (patch)
tree321653bd327e96f6b122954bea02be094c52dd07
parentdeb7b9dbaf9c54b5c34dbc6269f178861c8e5992 (diff)
downloadchrome-ec-241c9c97331146473ba5c4cc2ba349b59b0e2ffc.tar.gz
Revert "host_event: Perform lpc_init_mask before keyboard/button init"
This reverts commit 708f6f1f21d4cee970c6bf7dadefee3936af228d. BUG=b:200823466 TEST=make buildall -j Change-Id: If0542e60b642064de68a8aa6187aace5bb6d640b Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273445 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
-rw-r--r--common/host_event_commands.c7
-rw-r--r--common/main.c10
-rw-r--r--include/lpc.h3
3 files changed, 6 insertions, 14 deletions
diff --git a/common/host_event_commands.c b/common/host_event_commands.c
index 2d76bbaa89..ee60d9fc50 100644
--- a/common/host_event_commands.c
+++ b/common/host_event_commands.c
@@ -190,7 +190,7 @@ host_event_t __attribute__((weak)) lpc_override_always_report_mask(void)
return LPC_HOST_EVENT_ALWAYS_REPORT_DEFAULT_MASK;
}
-void lpc_init_mask(void)
+static void lpc_init_mask(void)
{
/*
* First check if masks were stashed before sysjump. If no masks were
@@ -201,6 +201,11 @@ void lpc_init_mask(void)
lpc_host_event_mask[LPC_HOST_EVENT_ALWAYS_REPORT] =
lpc_override_always_report_mask();
}
+/*
+ * This hook is required to run before chip gets to initialize LPC because
+ * update host events will need the masks to be correctly restored.
+ */
+DECLARE_HOOK(HOOK_INIT, lpc_init_mask, HOOK_PRIO_INIT_LPC - 1);
void lpc_s3_resume_clear_masks(void)
{
diff --git a/common/main.c b/common/main.c
index 85b70680ed..e6bdc49cc5 100644
--- a/common/main.c
+++ b/common/main.c
@@ -142,16 +142,6 @@ test_mockable __keep int main(void)
#ifdef CONFIG_EEPROM
eeprom_init();
#endif
-
- /*
- * Keyboard scan init/Button init can set recovery events to
- * indicate to host entry into recovery mode. Before this is
- * done, lpc always report mask needs to be initialized
- * correctly.
- */
-#ifdef CONFIG_LPC
- lpc_init_mask();
-#endif
if (IS_ENABLED(CONFIG_I2C_CONTROLLER)) {
/*
* Some devices (like the I2C keyboards, CBI) need I2C access
diff --git a/include/lpc.h b/include/lpc.h
index 8cbd29292c..f31c49d83f 100644
--- a/include/lpc.h
+++ b/include/lpc.h
@@ -145,9 +145,6 @@ void lpc_update_host_event_status(void);
*/
host_event_t lpc_override_always_report_mask(void);
-/* Initialize LPC masks. */
-void lpc_init_mask(void);
-
/*
* Clear LPC masks for SMI, SCI and wake upon resume from S3. This is done to
* mask these events until host unmasks them itself.