summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2020-08-21 21:34:00 -0700
committerCommit Bot <commit-bot@chromium.org>2020-10-29 17:14:07 +0000
commit546a4c0d6bcbeb526d2b83a1c9627a00a59cae11 (patch)
treece59fdeb52e77ad1e7d6ec89013f8378b09ed709
parent2187a50f7cb738aee572e3b2cbabe1c23d76000c (diff)
downloadchrome-ec-546a4c0d6bcbeb526d2b83a1c9627a00a59cae11.tar.gz
driver: bmi160: Read only the first 2 bytes of the interrupt field
The remaining 2 are qualifier for single/double tap we are not interested in. They are not reset to 0 even after we process the interrupt, so when gesture is enabled, we are stuck in the interrupt routine for a while. BMI260 does not have this problem as the interrupt register is now explicitly 16 bit. Gesture is currently enabled on eve that does not have the loop on interrupt, so no other branch than ToT is affected. BUG=b:164974014 BRANCH=none TEST=Without, we would be stuck in bmi160 irq_hanlder: (timestamp of int) (interrupt mask) ... [5064.237873 a hw int: 769270447 - 2 0x00C00000] [5064.238989 a hw int: 769270447 - 2 0x00C04000] [5064.241277 a hw int: 769270447 - 2 0x00C00000] [5064.242397 a hw int: 769270447 - 2 0x00C00000] [5064.243527 a hw int: 769270447 - 2 0x00C00000] [5064.244647 a hw int: 769270447 - 2 0x00C00000] [5064.246419 a hw int: 769270447 - 2 0x00C00000] ... / Qualifier -----/ Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2370152 Reviewed-by: Patryk Duda <pdk@semihalf.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Patryk Duda <pdk@semihalf.com> (cherry picked from commit bee0b6334399a341e7e242b5e8b12575262c9791) Change-Id: I2c8fd354eddfa412f644555dcdcdb77708a9e3c7 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2492532 Reviewed-by: Ching-Kang Yen <chingkang@chromium.org> Reviewed-by: Yuval Peress <peress@chromium.org>
-rw-r--r--driver/accelgyro_bmi160.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/driver/accelgyro_bmi160.c b/driver/accelgyro_bmi160.c
index 7959ac42ba..d7b08e0c9e 100644
--- a/driver/accelgyro_bmi160.c
+++ b/driver/accelgyro_bmi160.c
@@ -536,7 +536,7 @@ static int irq_handler(struct motion_sensor_t *s, uint32_t *event)
return EC_ERROR_NOT_HANDLED;
do {
- rv = bmi_read32(s->port, s->i2c_spi_addr_flags,
+ rv = bmi_read16(s->port, s->i2c_spi_addr_flags,
BMI160_INT_STATUS_0, &interrupt);
/*
* Bail out of this loop there was an error reading the register