diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2021-03-22 17:30:39 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-03-29 19:07:38 +0000 |
commit | 4c84afb1cdb1d1da8155f1bc30ea93ecd7b8dd4b (patch) | |
tree | 21a4edcf7386e94e950acb588540f7f779b9d79e /include | |
parent | f4b27032e1c508b693bba1f2d6572ad14d42f319 (diff) | |
download | chrome-ec-4c84afb1cdb1d1da8155f1bc30ea93ecd7b8dd4b.tar.gz |
common: motion_sense: Prevent on/off body from waking up device
Introduce a new flag: BYPASS_FIFO to raise an interrupt to the AP
when an event is sent.
It is not as strong as WAKEUP, as it does not wake up the AP.
BYPASS_FIFO must be set when WAKEUP is set.
It is applied to sync sensor as well as gesture/activity sensor.
BUG=b:123434029
BRANCH=trogdor
TEST=Compile
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Change-Id: Id5aba71e6d11ef31f7fa2c67ba2e07178d088b1b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2780834
Reviewed-by: Ching-Kang Yen <chingkang@chromium.org>
Tested-by: Ching-Kang Yen <chingkang@chromium.org>
Commit-Queue: Ching-Kang Yen <chingkang@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/ec_commands.h | 2 | ||||
-rw-r--r-- | include/motion_sense_fifo.h | 13 |
2 files changed, 13 insertions, 2 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h index 8949077e8e..bd62d3a3ce 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -2770,6 +2770,8 @@ struct ec_motion_sense_activity { #define MOTIONSENSE_SENSOR_FLAG_TABLET_MODE BIT(3) #define MOTIONSENSE_SENSOR_FLAG_ODR BIT(4) +#define MOTIONSENSE_SENSOR_FLAG_BYPASS_FIFO BIT(7) + /* * Send this value for the data element to only perform a read. If you * send any other value, the EC will interpret it as data to set and will diff --git a/include/motion_sense_fifo.h b/include/motion_sense_fifo.h index 554475d9f3..90d3f78879 100644 --- a/include/motion_sense_fifo.h +++ b/include/motion_sense_fifo.h @@ -22,16 +22,25 @@ enum motion_sense_async_event { void motion_sense_fifo_init(void); /** + * Whether or not we need to bypass the FIFO to send an important message. + * + * @return Non zero when a bypass is needed. + */ +int motion_sense_fifo_bypass_needed(void); + +/** * Whether or not we need to wake up the AP. * + * When the wakeup flag is set, the bypass flag must be set to. + * * @return Non zero when a wake-up is needed. */ int motion_sense_fifo_wake_up_needed(void); /** - * Resets the flag for wake up needed. + * Resets the flag for wake up and bypass needed. */ -void motion_sense_fifo_reset_wake_up_needed(void); +void motion_sense_fifo_reset_needed_flags(void); /** * Insert an async event into the fifo. |