summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/config.h13
-rw-r--r--include/motion_sense.h2
-rw-r--r--include/motion_sense_fifo.h7
3 files changed, 17 insertions, 5 deletions
diff --git a/include/config.h b/include/config.h
index a31ba2ba81..ff91073ea5 100644
--- a/include/config.h
+++ b/include/config.h
@@ -44,12 +44,12 @@
* BOARD_*, CHIP_*, and CHIP_FAMILY_*.
*/
-/*
- * Add support for sensor FIFO:
- * define the size of the global fifo, must be a power of 2.
- */
+/* Add support for sensor FIFO */
#undef CONFIG_ACCEL_FIFO
+/* Define the size of the global fifo, must be a power of 2. */
+#undef CONFIG_ACCEL_FIFO_SIZE
+
/* The amount of free entries that trigger an interrupt to the AP. */
#undef CONFIG_ACCEL_FIFO_THRES
@@ -4880,5 +4880,10 @@
#endif
+#ifdef CONFIG_ACCEL_FIFO
+#if !defined(CONFIG_ACCEL_FIFO_SIZE) || !defined(CONFIG_ACCEL_FIFO_THRES)
+#error "Using CONFIG_ACCEL_FIFO, must define _SIZE and _THRES"
+#endif
+#endif /* CONFIG_ACCEL_FIFO */
#endif /* __CROS_EC_CONFIG_H */
diff --git a/include/motion_sense.h b/include/motion_sense.h
index b0e5244e3b..8e0ade7492 100644
--- a/include/motion_sense.h
+++ b/include/motion_sense.h
@@ -76,7 +76,7 @@ enum sensor_config {
#define BASE_RANGE(_range) ((_range) & ~ROUND_UP_FLAG)
#ifdef CONFIG_ACCEL_FIFO
-#define MAX_FIFO_EVENT_COUNT CONFIG_ACCEL_FIFO
+#define MAX_FIFO_EVENT_COUNT CONFIG_ACCEL_FIFO_SIZE
#else
#define MAX_FIFO_EVENT_COUNT 0
#endif
diff --git a/include/motion_sense_fifo.h b/include/motion_sense_fifo.h
index f0d5f853dd..6b306b5f29 100644
--- a/include/motion_sense_fifo.h
+++ b/include/motion_sense_fifo.h
@@ -67,4 +67,11 @@ void motion_sense_fifo_stage_timestamp(uint32_t timestamp);
void motion_sense_get_fifo_info(
struct ec_response_motion_sense_fifo_info *fifo_info);
+/**
+ * Checks if either the AP should be woken up due to the fifo.
+ *
+ * @return 1 if the AP should be woken up, 0 otherwise.
+ */
+int motion_sense_fifo_is_wake_up_needed(void);
+
#endif /* __CROS_EC_MOTION_SENSE_FIFO_H */