From 6c8d7c8cf289ef2483ce595aa33119f313c45b18 Mon Sep 17 00:00:00 2001 From: Rob Barnes Date: Wed, 8 Sep 2021 14:09:10 -0600 Subject: bmi3xx: Fix sensor_num in ec_response_motion_sensor_data The sensor_num should match the sensor index of the sensor that produced the data. It was incorrectly set to sens_cnt, which is just the offset of the sensors on the bmi3xx. BUG=b:195264765, b:197186738 TEST=Passed the following tests on guybrush: iioservice_simpleclient --channels='accel_x' --frequency=12.5 --device_id=2 --samples=1 run cts -m CtsSensorTestCases -t android.hardware.cts.SensorBatchingTests#testAccelUncalibrated_50hz_batching BRANCH=None Change-Id: Id51ea52a0426fc50a5001437e720eedf41c333ad Signed-off-by: Rob Barnes Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3150058 Reviewed-by: Diana Z Reviewed-by: Gwendal Grignou --- driver/accelgyro_bmi3xx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/driver/accelgyro_bmi3xx.c b/driver/accelgyro_bmi3xx.c index 08020f926a..90641a209e 100644 --- a/driver/accelgyro_bmi3xx.c +++ b/driver/accelgyro_bmi3xx.c @@ -404,8 +404,7 @@ int bmi3_parse_fifo_data(struct motion_sensor_t *s, struct bmi3_fifo_frame vect.data[Y] = v[Y]; vect.data[Z] = v[Z]; vect.flags = 0; - vect.sensor_num = sens_cnt; - + vect.sensor_num = s - motion_sensors + sens_cnt; motion_sense_fifo_stage_data(&vect, sens_output, 3, last_ts); } -- cgit v1.2.1