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 22:44:33 +0000 |
commit | 4700fd0e58dd6fb006c802029fd4ba0b496be14d (patch) | |
tree | 21fa0236a090065f66bd5f1f51d0031205693536 | |
parent | b7b58bc80b44e3dbe7cdd00f6695bf821c0caabc (diff) | |
download | chrome-ec-4700fd0e58dd6fb006c802029fd4ba0b496be14d.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>
(cherry picked from commit 9b779dd2ce02e7b43b5bf835c09aff4f3ea3a21f)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3072401
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
-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 270c2d0eed..40560b3ec9 100644 --- a/driver/accel_lis2dw12.c +++ b/driver/accel_lis2dw12.c @@ -83,7 +83,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); } |