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-08-28 03:33:04 +0000
commitbee0b6334399a341e7e242b5e8b12575262c9791 (patch)
treeb59624aa24decd21b04f9ee06693a4e917e69c4f
parentd64c94dd4ce0f3ed294c391c61facba7b6775c2d (diff)
downloadchrome-ec-bee0b6334399a341e7e242b5e8b12575262c9791.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 -----/ Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: I2c8fd354eddfa412f644555dcdcdb77708a9e3c7 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>
-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