summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Tesi <mario.tesi@st.com>2019-11-07 11:09:53 +0100
committerCommit Bot <commit-bot@chromium.org>2019-11-19 18:51:44 +0000
commite9bc15a9ac68e3b28e68c0191794e842927622ee (patch)
tree922742191111b34d7f0ac5ce2a3e2eabed7585bf
parent9a2ff7e3094f10e4376a0306073dadfc7511ace8 (diff)
downloadchrome-ec-e9bc15a9ac68e3b28e68c0191794e842927622ee.tar.gz
driver: lsm6dso: Fix build issue and align to motion sense fifo api
Fix build issue, replaced motion_sense_fifo_add_data with motion_sense_fifo_stage_data and motion_sense_fifo_commit_data fifo api. BUG=none BRANCH=master TEST=Fixed build issue. Tested on discovery target BOARD with LSM6DSO connected to EC i2c master bus and motion sense task running. Change-Id: I7e4e81f1b6fe95b33ef6a4bfc5fdd509273c6f7b Signed-off-by: Mario Tesi <mario.tesi@st.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1903129 Reviewed-by: Yuval Peress <peress@chromium.org>
-rw-r--r--driver/accelgyro_lsm6dso.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/driver/accelgyro_lsm6dso.c b/driver/accelgyro_lsm6dso.c
index 617186872b..e8ea0794d7 100644
--- a/driver/accelgyro_lsm6dso.c
+++ b/driver/accelgyro_lsm6dso.c
@@ -15,6 +15,7 @@
#include "hooks.h"
#include "hwtimer.h"
#include "math_util.h"
+#include "motion_sense_fifo.h"
#include "task.h"
#include "timer.h"
@@ -153,7 +154,7 @@ static void push_fifo_data(struct motion_sensor_t *main_s, uint8_t *fifo,
vect.flags = 0;
vect.sensor_num = sensor - motion_sensors;
- motion_sense_fifo_add_data(&vect, sensor, 3, saved_ts);
+ motion_sense_fifo_stage_data(&vect, sensor, 3, saved_ts);
}
static inline int load_fifo(struct motion_sensor_t *s,
@@ -253,6 +254,9 @@ static int irq_handler(struct motion_sensor_t *s, uint32_t *event)
if (fsts.len & LSM6DSO_FIFO_DIFF_MASK)
ret = load_fifo(s, &fsts, last_interrupt_timestamp);
+
+ if (IS_ENABLED(CONFIG_ACCEL_FIFO) && ret > 0)
+ motion_sense_fifo_commit_data();
}
return ret;