diff options
-rw-r--r-- | common/host_event_commands.c | 22 | ||||
-rw-r--r-- | include/config.h | 4 |
2 files changed, 19 insertions, 7 deletions
diff --git a/common/host_event_commands.c b/common/host_event_commands.c index 0364474de0..1dc9ac5c0c 100644 --- a/common/host_event_commands.c +++ b/common/host_event_commands.c @@ -40,9 +40,14 @@ uint32_t host_get_events(void) void host_set_events(uint32_t mask) { - /* Only print if something's about to change */ - if ((events & mask) != mask || (events_copy_b & mask) != mask) - CPRINTS("event set 0x%08x", mask); + /* ignore host events the rest of board doesn't care about */ + mask &= CONFIG_HOST_EVENT_REPORT_MASK; + + /* exit now if nothing has changed */ + if (!((events & mask) != mask || (events_copy_b & mask) != mask)) + return; + + CPRINTS("event set 0x%08x", mask); atomic_or(&events, mask); atomic_or(&events_copy_b, mask); @@ -62,9 +67,14 @@ void host_set_events(uint32_t mask) void host_clear_events(uint32_t mask) { - /* Only print if something's about to change */ - if (events & mask) - CPRINTS("event clear 0x%08x", mask); + /* ignore host events the rest of board doesn't care about */ + mask &= CONFIG_HOST_EVENT_REPORT_MASK; + + /* return early if nothing changed */ + if (!(events & mask)) + return; + + CPRINTS("event clear 0x%08x", mask); atomic_clear(&events, mask); diff --git a/include/config.h b/include/config.h index 93d0aa593b..1058750fa0 100644 --- a/include/config.h +++ b/include/config.h @@ -1256,7 +1256,6 @@ #undef CONFIG_GESTURE_SIGMO_EVENT - /* Do we want to detect the lid angle? */ #undef CONFIG_LID_ANGLE @@ -1323,6 +1322,9 @@ */ #undef CONFIG_HOST_COMMAND_STATUS +/* clear bit(s) to mask reporting of an EC_HOST_EVENT_XXX event(s) */ +#define CONFIG_HOST_EVENT_REPORT_MASK 0xffffffff + /* * The host commands are sorted in the .rodata.hcmds section so use the binary * search algorithm to match a command to its handler |