diff options
author | Gwendal Grignou <gwendal@google.com> | 2021-08-03 23:59:00 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-08-04 18:00:26 +0000 |
commit | 9b779dd2ce02e7b43b5bf835c09aff4f3ea3a21f (patch) | |
tree | 6fe270d21f2496f405665df918431003d88d2c28 /driver/accel_lis2dw12.c | |
parent | 9752d7152b8dd0d1f7d59dbcefe8764c56b3409d (diff) | |
download | chrome-ec-9b779dd2ce02e7b43b5bf835c09aff4f3ea3a21f.tar.gz |
driver: lis2dw12: Set FIFO vector number properly
We have been lucky the accelerometer was always in first position,
as the FIFO filling routine always set the sensor number to 0.
Fix for hayato.
BUG=b:192649615
TEST=On hayato, using
iioservice_simpleclient --channels="accel_x accel_y accel_z"
--device_id=0 --frequency=10 --samples=10
Check the sensor data is constant. (device_id 0 is the base
accelerometer), we get data for that sensor only.
Checking with device_id set to 2 (the lid accelerometer),
that we get samples for that sensor.
BRANCH=asurada
Signed-off-by: Gwendal Grignou <gwendal@google.com>
Change-Id: I96ea5f696c38b8c54aed7537f93eba70a647dc53
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3069990
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Yuval Peress <peress@chromium.org>
Commit-Queue: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Diffstat (limited to 'driver/accel_lis2dw12.c')
-rw-r--r-- | driver/accel_lis2dw12.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/driver/accel_lis2dw12.c b/driver/accel_lis2dw12.c index 2658217d5c..5a0c4bdf65 100644 --- a/driver/accel_lis2dw12.c +++ b/driver/accel_lis2dw12.c @@ -100,7 +100,7 @@ static __maybe_unused int lis2dw12_load_fifo(struct motion_sensor_t *s, vect.data[Y] = axis[Y]; vect.data[Z] = axis[Z]; vect.flags = 0; - vect.sensor_num = 0; + vect.sensor_num = s - motion_sensors; motion_sense_fifo_stage_data(&vect, s, 3, interrupt_timestamp); } |