diff options
author | Heng-Ruey Hsu <henryhsu@chromium.org> | 2019-08-28 15:49:13 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-11-11 04:53:19 +0000 |
commit | d8abaaa35932d7b0e7a0aa99e52a9b81b7d74584 (patch) | |
tree | bdaaec167cdcdc397dea3dba9bf576f86303d1ce /driver/accelgyro_bmi160.c | |
parent | fa1aedace7e2779224d16c7dc496f9ca7f2a8a0a (diff) | |
download | chrome-ec-d8abaaa35932d7b0e7a0aa99e52a9b81b7d74584.tar.gz |
Add double tap and make motion sense wake up ap
Change to use CONFIG_GESTURE_DETECTION_MASK since
CONFIG_GESTURE_SENSOR_BATTERY_TAP and CONFIG_GESTURE_SENSOR_DOUBLE_TAP
both define it.
BUG=b:135575671
BRANCH=none
TEST=build pass. EC can receive double tap interrupt.
Change-Id: I6eec40ef7405ec0653ff62dbce98f975cb19e332
Signed-off-by: Heng-Ruey Hsu <henryhsu@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1710210
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'driver/accelgyro_bmi160.c')
-rw-r--r-- | driver/accelgyro_bmi160.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/driver/accelgyro_bmi160.c b/driver/accelgyro_bmi160.c index 79107cc6ee..41ac393b23 100644 --- a/driver/accelgyro_bmi160.c +++ b/driver/accelgyro_bmi160.c @@ -772,7 +772,7 @@ int manage_activity(const struct motion_sensor_t *s, break; } #endif -#ifdef CONFIG_GESTURE_SENSOR_BATTERY_TAP +#ifdef CONFIG_GESTURE_DETECTION_MASK case MOTIONSENSE_ACTIVITY_DOUBLE_TAP: { int tmp; /* Set double tap interrupt */ @@ -1059,7 +1059,7 @@ static int config_interrupt(const struct motion_sensor_t *s) raw_write8(s->port, s->i2c_spi_addr_flags, BMI160_CMD_REG, BMI160_CMD_INT_RESET); -#ifdef CONFIG_GESTURE_SENSOR_BATTERY_TAP +#ifdef CONFIG_GESTURE_DETECTION_MASK raw_write8(s->port, s->i2c_spi_addr_flags, BMI160_INT_TAP_0, BMI160_TAP_DUR(s, CONFIG_GESTURE_TAP_MAX_INTERSTICE_T)); @@ -1099,7 +1099,7 @@ static int config_interrupt(const struct motion_sensor_t *s) #ifdef CONFIG_GESTURE_SIGMO tmp |= BMI160_INT_ANYMOTION; #endif -#ifdef CONFIG_GESTURE_SENSOR_BATTERY_TAP +#ifdef CONFIG_GESTURE_DETECTION_MASK tmp |= BMI160_INT_D_TAP; #endif #ifdef CONFIG_BMI160_ORIENTATION_SENSOR @@ -1207,7 +1207,7 @@ static int irq_handler(struct motion_sensor_t *s, uint32_t *event) if (rv) return rv; -#ifdef CONFIG_GESTURE_SENSOR_BATTERY_TAP +#ifdef CONFIG_GESTURE_DETECTION_MASK if (interrupt & BMI160_D_TAP_INT) *event |= TASK_EVENT_MOTION_ACTIVITY_INTERRUPT( MOTIONSENSE_ACTIVITY_DOUBLE_TAP); @@ -1311,7 +1311,7 @@ static int init(const struct motion_sensor_t *s) data->disabled_activities |= 1 << MOTIONSENSE_ACTIVITY_SIG_MOTION; #endif -#ifdef CONFIG_GESTURE_SENSOR_BATTERY_TAP +#ifdef CONFIG_GESTURE_DETECTION_MASK data->disabled_activities |= 1 << MOTIONSENSE_ACTIVITY_DOUBLE_TAP; #endif |