diff options
author | Ivan Chen <yulunchen@google.com> | 2023-05-17 03:32:45 +0000 |
---|---|---|
committer | Ivan Chen <yulunchen@google.com> | 2023-05-17 03:32:45 +0000 |
commit | d7c9c6beb03ee5725232b9ac3bfe4825e1e227cb (patch) | |
tree | 3a0d6776c0e76e325d1b087cd51a850cb871358e /common/motion_sense.c | |
parent | 8641442366bd7c2c133e302a57f904dfac3c896b (diff) | |
parent | b34dc2ae9022e2fbb57ae6477891ff32954c62fd (diff) | |
download | chrome-ec-d7c9c6beb03ee5725232b9ac3bfe4825e1e227cb.tar.gz |
Merge remote-tracking branch cros/main into firmware-brya-14505.B-mainfirmware-brya-14505.B-main
Generated by: util/update_release_branch.py --board brya firmware-brya-14505.B-main
Relevant changes:
git log --oneline 8641442366..b34dc2ae90 -- board/brya board/brya
util/getversion.sh
BRANCH=None
TEST=`make -j buildall`
Force-Relevant-Builds: all
Change-Id: I63149b4c1782b3ed57f2556755901c21f5f1e3e9
Signed-off-by: Ivan Chen <yulunchen@google.com>
Diffstat (limited to 'common/motion_sense.c')
-rw-r--r-- | common/motion_sense.c | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/common/motion_sense.c b/common/motion_sense.c index 16a37d37a5..546034c7e2 100644 --- a/common/motion_sense.c +++ b/common/motion_sense.c @@ -698,6 +698,26 @@ static void check_and_queue_gestures(uint32_t *event) if (IS_ENABLED(CONFIG_GESTURE_SENSOR_DOUBLE_TAP) && (*event & TASK_EVENT_MOTION_ACTIVITY_INTERRUPT( MOTIONSENSE_ACTIVITY_DOUBLE_TAP))) { + 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; + vector.activity_data.activity = + MOTIONSENSE_ACTIVITY_DOUBLE_TAP; + vector.activity_data.state = 1 /* triggered */; + vector.sensor_num = MOTION_SENSE_ACTIVITY_SENSOR_ID; + motion_sense_fifo_stage_data(&vector, NULL, 0, + __hw_clock_source_read()); + motion_sense_fifo_commit_data(); + } /* Call board specific function to process tap */ sensor_board_proc_double_tap(); } @@ -705,7 +725,20 @@ static void check_and_queue_gestures(uint32_t *event) (*event & TASK_EVENT_MOTION_ACTIVITY_INTERRUPT( MOTIONSENSE_ACTIVITY_SIG_MOTION))) { struct motion_sensor_t *activity_sensor; - + if (IS_ENABLED(CONFIG_GESTURE_HOST_DETECTION)) { + struct ec_response_motion_sensor_data vector; + + /* Send events to the FIFO */ + 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 */; + vector.sensor_num = MOTION_SENSE_ACTIVITY_SENSOR_ID; + motion_sense_fifo_stage_data(&vector, NULL, 0, + __hw_clock_source_read()); + motion_sense_fifo_commit_data(); + } /* Disable further detection */ activity_sensor = &motion_sensors[CONFIG_GESTURE_SIGMO_SENSOR]; activity_sensor->drv->manage_activity( @@ -730,6 +763,12 @@ static void check_and_queue_gestures(uint32_t *event) (*motion_orientation_ptr(sensor) != MOTIONSENSE_ORIENTATION_UNKNOWN)) { motion_orientation_update(sensor); + vector.activity_data.state = + *motion_orientation_ptr(sensor); + motion_sense_fifo_stage_data( + &vector, NULL, 0, + __hw_clock_source_read()); + motion_sense_fifo_commit_data(); if (IS_ENABLED(CONFIG_DEBUG_ORIENTATION)) { static const char *const mode[] = { "Landscape", "Portrait", |