summaryrefslogtreecommitdiff
path: root/common/body_detection.c
diff options
context:
space:
mode:
authorTim Van Patten <timvp@google.com>2023-02-10 09:49:06 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-02-24 17:59:54 +0000
commit8441cf441de4cfc0e46bc5f511ac36c89ab196b2 (patch)
tree4b277d82a380a31dffd5931b97cc82cd349fb1f7 /common/body_detection.c
parent521ff2e2ad382223ffbfec47d5bd1f17df9d0c82 (diff)
downloadchrome-ec-8441cf441de4cfc0e46bc5f511ac36c89ab196b2.tar.gz
Add host event: EC_HOST_EVENT_BODY_DETECT_CHANGE
Add the host event EC_HOST_EVENT_BODY_DETECT_CHANGE. Previously, the EC sent the host event EC_HOST_EVENT_MODE_CHANGE when body detection changed between lap/desk mode. However, that event is a wake event, which resulted in spurious AP wake events being triggered when the EC detected lap/desk mode changes while the AP was suspended. To resolve this, the new host event EC_HOST_EVENT_BODY_DETECT_CHANGE is being added, which will not be a wake event. BRANCH=none BUG=b:261141172 TEST=bodydetectmode on|off, verify host event is received Change-Id: Id03ffaea81da6321987ec4c517d22a8c1d72ba97 Signed-off-by: Tim Van Patten <timvp@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4255279 Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Raul Rangel <rrangel@chromium.org>
Diffstat (limited to 'common/body_detection.c')
-rw-r--r--common/body_detection.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/common/body_detection.c b/common/body_detection.c
index 8623948897..a846c5131c 100644
--- a/common/body_detection.c
+++ b/common/body_detection.c
@@ -115,9 +115,8 @@ void body_detect_change_state(enum body_detect_states state, bool spoof)
stationary_timeframe = 0;
}
-#ifdef CONFIG_BODY_DETECTION_NOTIFY_MODE_CHANGE
- host_set_single_event(EC_HOST_EVENT_MODE_CHANGE);
-#endif
+ if (IS_ENABLED(CONFIG_BODY_DETECTION_NOTIFY_MODE_CHANGE))
+ host_set_single_event(EC_HOST_EVENT_BODY_DETECT_CHANGE);
hook_notify(HOOK_BODY_DETECT_CHANGE);