summaryrefslogtreecommitdiff
path: root/include/device_event.h
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2021-01-29 10:19:38 -0800
committerCommit Bot <commit-bot@chromium.org>2021-01-30 01:44:26 +0000
commit7b7a3f0adaf415794b50ad6dac9697ed5417cc97 (patch)
treed1715968c25900a72ef841cdb74acf0f70f420b3 /include/device_event.h
parentd835a61ba28a7340dce0a702aabb4fe793f6e0a8 (diff)
downloadchrome-ec-7b7a3f0adaf415794b50ad6dac9697ed5417cc97.tar.gz
device_event: Don't notify host of disabled events
Currently, device_set_events notifies the host even when the device is masked by device_enabled_events. This patch makes it skip notification for disabled devices. This patch also makes device_event skip notification if it's already set. Host reads & clears device_current_events atomically (by device _get_and_clear_events). So, 1->1 transition means host has already been notified but hasn't read it yet. BUG=b:36024430, b:178537669, b:177664326 BRANCH=Trogdor TEST=CoachZ. Verified host event isn't sent until powerd enables WLC. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I075845873b052dab2a50c73e97b0bf55adf9c159 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2659684 Reviewed-by: Duncan Laurie <dlaurie@google.com>
Diffstat (limited to 'include/device_event.h')
-rw-r--r--include/device_event.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/device_event.h b/include/device_event.h
index 81b949076c..debec00d52 100644
--- a/include/device_event.h
+++ b/include/device_event.h
@@ -19,6 +19,8 @@ uint32_t device_get_events(void);
/**
* Set one or more device event bits.
*
+ * Call device_clear_events to unset event bits.
+ *
* @param mask Event bits to set (use EC_DEVICE_EVENT_MASK()).
*/
void device_set_events(uint32_t mask);