summaryrefslogtreecommitdiff
path: root/include/mkbp_event.h
diff options
context:
space:
mode:
authorAlexandru M Stan <amstan@chromium.org>2017-11-30 20:43:15 -0800
committerchrome-bot <chrome-bot@chromium.org>2018-05-14 15:32:47 -0700
commit1d518fb85cd7163a2fc390871046d8d6c398ed57 (patch)
tree47da7c7ac36b3f7a1e150ed0a7912eed302f624b /include/mkbp_event.h
parentfda59e57ff0b1ad29786d35abb5ba189011fb479 (diff)
downloadchrome-ec-1d518fb85cd7163a2fc390871046d8d6c398ed57.tar.gz
motion_sense: Lower jitter of EC->AP timestamp
When the EC sends an interrupt to the AP notifying it of new accelerometer data we need to make sure the spot we record the timestamp of the event is virtually identical to the spot the AP records the same point in time. Therefore a better spot for that is right next to the gpio toggling of the interrupt line. BUG=b:67743747 TEST=In the kernel, fifo_info->info.timestamp still has sane values. TEST=CTS should still pass BRANCH=master Change-Id: Ic77101a045123e779f576c46b401c765304976fd Signed-off-by: Alexandru M Stan <amstan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/802976 Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'include/mkbp_event.h')
-rw-r--r--include/mkbp_event.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/mkbp_event.h b/include/mkbp_event.h
index cad43444b5..68e29c0cd4 100644
--- a/include/mkbp_event.h
+++ b/include/mkbp_event.h
@@ -9,6 +9,15 @@
#define __CROS_EC_MKBP_EVENT_H
/*
+ * Last time the host received an interrupt.
+ *
+ * Retrieved via __hw_clock_source_read() as close as possible
+ * to the interrupt source. Intended to be virtually the same time the
+ * first line of the AP hard irq for the EC interrupt.
+ */
+extern uint32_t mkbp_last_event_time;
+
+/*
* Sends an event to the AP.
*
* When this is called, the event data must be ready for query. Otherwise,