summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2019-04-09 13:26:18 -0600
committerJett Rink <jettrink@chromium.org>2019-04-24 21:06:49 +0000
commitd6cc4f14205a00b6d17d22fb7e74a0c8b063ec85 (patch)
tree5657bcfb06db820159ebee8d46abe28688e38bf9 /common
parent0f15b8e5a3583cac214ea93b97918e25d5ff88bc (diff)
downloadchrome-ec-d6cc4f14205a00b6d17d22fb7e74a0c8b063ec85.tar.gz
mkbp: take timestamp closer to hardware interrupt
We want to ensure that the timestamp we take for last mkbp is as close to the actual hardware interrupt from EC->AP. BRANCH=none BUG=b:129159505 TEST=passing CTS sensor run (except test 133 nullptr) with this change Change-Id: I94b214f021f0b63ff2883e5fe8e32acc83ce208f Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1560390 Tested-by: Alexandru M Stan <amstan@chromium.org> Reviewed-by: Enrico Granata <egranata@chromium.org> Reviewed-by: Mathew King <mathewk@chromium.org> Commit-Queue: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Diffstat (limited to 'common')
-rw-r--r--common/mkbp_event.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/common/mkbp_event.c b/common/mkbp_event.c
index 5e64183e43..28e6a6fc98 100644
--- a/common/mkbp_event.c
+++ b/common/mkbp_event.c
@@ -106,14 +106,8 @@ static int mkbp_set_host_active_via_event(int active, uint32_t *timestamp)
#ifdef CONFIG_MKBP_USE_HECI
static int mkbp_set_host_active_via_heci(int active, uint32_t *timestamp)
{
- /*
- * TODO change heci_send_mkbp_event declaration. Done in
- * child CL to decouple changes.
- */
- if (timestamp)
- *timestamp = __hw_clock_source_read();
if (active)
- heci_send_mkbp_event();
+ return heci_send_mkbp_event(timestamp);
return EC_SUCCESS;
}
#endif
@@ -132,14 +126,7 @@ static int mkbp_set_host_active_via_heci(int active, uint32_t *timestamp)
static int mkbp_set_host_active(int active, uint32_t *timestamp)
{
#if defined(CONFIG_MKBP_USE_CUSTOM)
- /*
- * TODO change mkbp_set_host_active_via_custom declaration. Done in
- * child CL to decouple changes
- */
- if (timestamp)
- *timestamp = __hw_clock_source_read();
- mkbp_set_host_active_via_custom(active);
- return EC_SUCCESS;
+ return mkbp_set_host_active_via_custom(active, timestamp);
#elif defined(CONFIG_MKBP_USE_HOST_EVENT)
return mkbp_set_host_active_via_event(active, timestamp);
#elif defined(CONFIG_MKBP_USE_GPIO)