diff options
Diffstat (limited to 'common/motion_sense.c')
-rw-r--r-- | common/motion_sense.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/common/motion_sense.c b/common/motion_sense.c index efb6552078..4dd8b6cc13 100644 --- a/common/motion_sense.c +++ b/common/motion_sense.c @@ -777,15 +777,14 @@ static void check_and_queue_gestures(uint32_t *event) if (IS_ENABLED(CONFIG_GESTURE_HOST_DETECTION)) { struct ec_response_motion_sensor_data vector; + vector.flags = MOTIONSENSE_SENSOR_FLAG_BYPASS_FIFO; /* * Send events to the FIFO * AP is ignoring double tap event, do no wake up and no * automatic disable. */ if (IS_ENABLED(CONFIG_GESTURE_SENSOR_DOUBLE_TAP_FOR_HOST)) - vector.flags = MOTIONSENSE_SENSOR_FLAG_WAKEUP; - else - vector.flags = 0; + vector.flags |= MOTIONSENSE_SENSOR_FLAG_WAKEUP; vector.activity_data.activity = MOTIONSENSE_ACTIVITY_DOUBLE_TAP; vector.activity_data.state = 1 /* triggered */; @@ -805,7 +804,8 @@ static void check_and_queue_gestures(uint32_t *event) struct ec_response_motion_sensor_data vector; /* Send events to the FIFO */ - vector.flags = MOTIONSENSE_SENSOR_FLAG_WAKEUP; + vector.flags = MOTIONSENSE_SENSOR_FLAG_WAKEUP | + MOTIONSENSE_SENSOR_FLAG_BYPASS_FIFO; vector.activity_data.activity = MOTIONSENSE_ACTIVITY_SIG_MOTION; vector.activity_data.state = 1 /* triggered */; @@ -951,7 +951,7 @@ void motion_sense_task(void *u) * - we haven't done it for a while. */ if (IS_ENABLED(CONFIG_ACCEL_FIFO) && - (motion_sense_fifo_wake_up_needed() || + (motion_sense_fifo_bypass_needed() || event & (TASK_EVENT_MOTION_ODR_CHANGE | TASK_EVENT_MOTION_FLUSH_PENDING) || motion_sense_fifo_over_thres() || @@ -974,8 +974,10 @@ void motion_sense_task(void *u) sensor_active == SENSOR_ACTIVE_S0) || motion_sense_fifo_wake_up_needed()))) { mkbp_send_event(EC_MKBP_EVENT_SENSOR_FIFO); - motion_sense_fifo_reset_wake_up_needed(); } + if (motion_sense_fifo_bypass_needed()) + /* wakeup flag is a subset of bypass flag. */ + motion_sense_fifo_reset_needed_flags(); } ts_end_task = get_time(); |